Skip to content

Conversation

@amisevsk
Copy link
Collaborator

What does this PR do?

In some clusters, adding ImagePullSecrets to a ServiceAccount can take a second or two. If the DevWorkspace Operator creates the workspace Deployment before this occurs, then once the pull secret is added the Deployment needs to roll out a new version, resulting in a delay in workspace start.

To avoid this, if the ServiceAccount does not have any image pull secrets, we wait up to 5 seconds from the creation timestamp of the ServiceAccount before continuing.

What issues does this PR fix or reference?

Closes #847

Is it tested? How?

The easiest way to test is to check that the new status message is set briefly during startup:

❯ kubectl apply -f samples/theia-next.yaml && kubectl get dw -w
devworkspace.workspace.devfile.io/theia-next created
NAME                DEVWORKSPACE ID   PHASE   INFO
test-contrib-code                             
test-contrib-code   test                      
test-contrib-code   test              Starting   Initializing DevWorkspace
test-contrib-code   test              Starting   Preparing networking
test-contrib-code   test              Starting   Preparing services
test-contrib-code   test              Starting   Networking ready
test-contrib-code   test              Starting   Waiting for DevWorkspace ServiceAccount
test-contrib-code   test              Starting   Waiting for DevWorkspace pull secrets <---- This one
test-contrib-code   test              Starting   Waiting for workspace deployment

(I've removed duplicate entries from the list above -- what's important is that the Waiting for DevWorkspace pull secrets appears).

Of course, this will only happen if #847 is encountered during startup

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

In some clusters, adding ImagePullSecrets to a ServiceAccount can take a
second or two. If the DevWorkspace Operator creates the workspace
Deployment before this occurs, then once the pull secret is added the
Deployment needs to roll out a new version, resulting in a delay in
workspace start.

To avoid this, if the ServiceAccount does not have any image pull
secrets, we wait up to 5 seconds from the creation timestamp of the
ServiceAccount before continuing.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
@amisevsk amisevsk requested a review from ibuziuk as a code owner May 31, 2022 20:37
@openshift-ci
Copy link

openshift-ci bot commented Jun 1, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk, ibuziuk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ibuziuk ibuziuk merged commit f778e31 into devfile:main Jun 1, 2022
@amisevsk amisevsk deleted the wait-image-pull-secret branch June 2, 2022 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DWO sometimes creates a deployment before serviceaccount gets pull secrets

2 participants