Skip to content

Add TLS setup, cross-arch build support, custom image overrides, and … - #203

Merged
dkwon17 merged 8 commits into
mainfrom
tls
Nov 12, 2026
Merged

dkwon17 merged 8 commits into
mainfrom
tls

Conversation

@dkwon17

@dkwon17 dkwon17 commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

…APIServer watcher backoff

What does this PR do?

Adds functionality to get TLS profile and adherence policy from the apiserver resource.

The TLS profile is then applied to the web-terminal-operator pod and the web-terminal-exec DevWorkspaceTemplate via env var.

What issues does this PR fix or reference?

https://redhat.atlassian.net/browse/WTO-353?search_id=ecd2f8bd-0ab7-4924-9d77-6cef1d370be1&referrer=quick-find&xpis=eyJicmlkZ2UiOiJxdWlja0ZpbmQiLCJpZCI6IjE3OTIxODI4OTc4MTIiLCJzb3VyY2UiOiJqaXJhLXNvZnR3YXJlIn0%3D

Is it tested? How?

To fully test this feature, we need changes from redhat-developer/web-terminal-exec#142.

I built and pushed the exec image here: quay.io/dkwon17/web-terminal-exec:tls.

I've also built the operator image: quay.io/dkwon17/web-terminal-operator:tls and the index image: quay.io/dkwon17/web-terminal-operator-index:tls which can be used to test this PR.

To test this PR:

1. Apply the catalog source and subscription:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: wto-custom-catalog
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/dkwon17/web-terminal-operator-index:tls
  displayName: WTO Custom Catalog
  publisher: dkwon17
  updateStrategy:
    registryPoll:
      interval: 10m
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: web-terminal
  namespace: openshift-operators
spec:
  channel: fast
  installPlanApproval: Automatic
  name: web-terminal
  source: wto-custom-catalog
  sourceNamespace: openshift-marketplace

2. Confirm no tlsAdherence or tlsSecurityProfile is set:

oc get apiserver cluster -o jsonpath='{.spec}'

3. Check logs that mention that TLS min version is set to TLS 1.2

In the web-terminal-controller-* pod logs:

{"level":"info","ts":"2026-10-16T19:21:45Z","logger":"setup","msg":"Using library-go default TLS profile","minTLSVersion":"VersionTLS12","adherencePolicy":""}

Start a web terminal and check the web terminal's web-terminal-exec container log:

time="2026-10-16T19:25:47Z" level=info msg="Setting TLS min version to TLS 1.2"

4. Set tlsadherence

Run:

oc patch apiserver cluster --type=merge -p '{
  "spec": {
    "tlsAdherence": "StrictAllComponents",
    "tlsSecurityProfile": {
      "type": "Intermediate",
      "intermediate": {}
    }
  }
}'

and verify that the web-terminal-controller-* pod eventually restarts and prints this log:

{"level":"info","ts":"2026-10-16T19:40:02Z","logger":"setup","msg":"Applying cluster TLS profile","minTLSVersion":"VersionTLS12"}

5. Set the profile to modern

Run:

oc patch apiserver cluster --type=merge -p '{
  "spec": {
    "tlsSecurityProfile": {
      "type": "Modern",
      "modern": {}
    }
  }
}'

and verify that the web-terminal-controller-* pod eventually restarts and prints this log:

{"level":"info","ts":"2026-10-16T20:17:17Z","logger":"setup","msg":"Applying cluster TLS profile","minTLSVersion":"VersionTLS13"}

Next, if the web terminal from step 2 is still running, stop the web terminal by setting started: false in the web terminal's DevWorkspace.

Start the web terminal again, and verify that the web terminal's pod's web-terminal-exec container has the following log:

time="2026-10-16T20:40:27Z" level=info msg="Setting TLS min version to TLS 1.3"

For example:
image

@rohanKanojia

Copy link
Copy Markdown
Collaborator

@dkwon17 : Unit tests seem to be failing. Probably some arguments need to be adjusted

# github.com/redhat-developer/web-terminal-operator/pkg/webterminal [github.com/redhat-developer/web-terminal-operator/pkg/webterminal.test]
Error: pkg/webterminal/exec_test.go:132:34: not enough arguments in call to getSpecExecTemplate
	have (string)
	want (string, tlssetup.ServerTLS)
Error: pkg/webterminal/exec_test.go:153:32: not enough arguments in call to getSpecExecTemplate
	have (string)
	want (string, tlssetup.ServerTLS)
	github.com/redhat-developer/web-terminal-operator/pkg/tlssetup		coverage: 0.0% of statements
FAIL	github.com/redhat-developer/web-terminal-operator/pkg/webterminal [build failed]

Comment thread pkg/tlssetup/server_tls.go Resolved
@codecov-commenter

codecov-commenter commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 32.47863% with 79 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.78%. Comparing base (eda133e) to head (30c54ab).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/tlssetup/server_tls.go 31.19% 73 Missing and 2 partials ⚠️
pkg/webterminal/defaults.go 0.00% 2 Missing ⚠️
pkg/webterminal/exec.go 66.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #203       +/-   ##
===========================================
- Coverage   66.66%   55.78%   -10.89%     
===========================================
  Files           4        5        +1     
  Lines         234      346      +112     
===========================================
+ Hits          156      193       +37     
- Misses         78      151       +73     
- Partials        0        2        +2     
Flag Coverage Δ
unit-tests 55.78% <32.47%> (-10.89%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/webterminal/defaults.go 0.00% <0.00%> (ø)
pkg/webterminal/exec.go 71.79% <66.66%> (+0.74%) ⬆️
pkg/tlssetup/server_tls.go 31.19% <31.19%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread pkg/tlssetup/server_tls.go Resolved
Comment thread pkg/tlssetup/server_tls.go Resolved
Comment thread build/scripts/build_index_image.sh Resolved
Comment thread build/makefiles/controller.mk Resolved
Comment thread pkg/tlssetup/server_tls.go Resolved
dkwon17 and others added 5 commits November 2, 2026 18:18
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: David Kwon <dakwon@redhat.com>
Add missing parameter in getSpecExecTemplate function calls in exec_test.go

Signed-off-by: David Kwon <dakwon@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: David Kwon <dakwon@redhat.com>
…field

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: David Kwon <dakwon@redhat.com>
…ilently giving up

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: David Kwon <dakwon@redhat.com>
Comment thread Makefile Resolved
Comment thread pkg/tlssetup/server_tls.go Resolved
Comment thread pkg/tlssetup/server_tls.go Resolved
Signed-off-by: David Kwon <dakwon@redhat.com>
Signed-off-by: David Kwon <dakwon@redhat.com>
# Conflicts:
#	manifests/web-terminal.clusterserviceversion.yaml
@dkwon17
dkwon17 merged commit 22d15fc into main Nov 12, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants