Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BZ 1768751: Add Web UI to rotate-certs.sh #499

Merged
merged 3 commits into from
Mar 17, 2020

Conversation

mareklibra
Copy link
Contributor

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1768751

Release note:

Fixes BZ 1768751 by including Web UI within `rotate-certs.sh` script.

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/XS labels Mar 16, 2020
@mareklibra
Copy link
Contributor Author

@tiraboschi , can you please suggest branch to backport this PR to?
Fixes BZ 1768751, the Web UI is missing in later releases.

@mareklibra
Copy link
Contributor Author

/assign @tiraboschi

@mareklibra mareklibra changed the title Add Web UI to rotate-certs.sh BZ 1768751: Add Web UI to rotate-certs.sh Mar 16, 2020
formerVersion=$(${_kubectl} get kwebui kubevirt-web-ui -o yaml | grep ' version: '|sed 's/^.*: *\(.*\)$/\1/g')
echo Detected former Web UI version: ${formerVersion}
${_kubectl} patch kwebui kubevirt-web-ui --patch '{"spec": {"version": ""}}' --type=merge # undeploy
sleep 15 # give kubevirt-web-ui-operator enough time to react, but it's usually instant
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The web-ui-operator needs to start reconciliation (means undeployment). We do not need to wait till it's finished.

Copy link
Member

@rmohr rmohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commands don't look like they would work for CNV after 1.4. The script should work for 1.4, 2.0, 2.1 and 2.2.

Can you verify that it can cope with CNV installations without the UI?

@mareklibra
Copy link
Contributor Author

mareklibra commented Mar 16, 2020

The script should work for 1.4, 2.0, 2.1 and 2.2.

Good point, thank you. This should be valid for 1.4.Z only. I have added check for presence of the corresponding CRD.

Copy link
Member

@rmohr rmohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

formerVersion=$(${_kubectl} get kwebui kubevirt-web-ui -o yaml | grep ' version: '|sed 's/^.*: *\(.*\)$/\1/g')
echo Detected former Web UI version: ${formerVersion}
${_kubectl} patch kwebui kubevirt-web-ui --patch '{"spec": {"version": ""}}' --type=merge # undeploy
sleep 15 # give kubevirt-web-ui-operator enough time to react, but it's usually instant
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An unconditional sleep is not really good. You are probably waiting for the ui-deployment to be scaled down or deleted. Could you either just scale down the deployment (which is waiting), or periodically check that the deployment got deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I already had code here checking presence of pods (they are about to be terminated). But found that this is not important. The operator just needs to get time to initiate the reconciliation - to start undeployment. We do not need to wait for this undeployment to be finished.

If really requested, I can add similar check back, either based on status in the CR or pod presence, but it will make the code here harder to read with no/very limited benefit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the undeploy does not happen withing 15 seconds (e.g. temporary error or rbac issue, or whatever)? You would set the version again after 15 seconds. Wouldn't you then risk that no rotation happened at all?

Copy link
Contributor Author

@mareklibra mareklibra Mar 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, waiting is added

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2020
@rmohr
Copy link
Member

rmohr commented Mar 16, 2020

/lgtm cancel

@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2020
@mareklibra mareklibra force-pushed the bz1768751.web-ui.rotateCert branch from 0e54afe to 85b7119 Compare March 16, 2020 14:31
Copy link
Member

@rmohr rmohr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2020
tools/rotate-certs.sh Outdated Show resolved Hide resolved
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2020
tools/rotate-certs.sh Outdated Show resolved Hide resolved
@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. and removed dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 16, 2020
@tiraboschi tiraboschi force-pushed the bz1768751.web-ui.rotateCert branch from b847104 to 16710d7 Compare March 16, 2020 16:02
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed lgtm Indicates that a PR is ready to be merged. dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Mar 16, 2020
@tiraboschi
Copy link
Member

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 16, 2020
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rmohr, tiraboschi

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 16, 2020
@tiraboschi
Copy link
Member

/retest

@tiraboschi
Copy link
Member

/test pull-hyperconverged-cluster-operator-e2e-k8s-1.15.1

@tiraboschi
Copy link
Member

/retest

@tiraboschi
Copy link
Member

/test pull-hyperconverged-cluster-operator-e2e-k8s-1.15.1

@jelkosz
Copy link

jelkosz commented Mar 17, 2020

/retest

mareklibra and others added 2 commits March 17, 2020 08:17
@mareklibra mareklibra force-pushed the bz1768751.web-ui.rotateCert branch from 16710d7 to b690c91 Compare March 17, 2020 07:19
@kubevirt-bot kubevirt-bot added dco-signoff: no Indicates the PR's author has not DCO signed all their commits. and removed lgtm Indicates that a PR is ready to be merged. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Mar 17, 2020
@mareklibra mareklibra force-pushed the bz1768751.web-ui.rotateCert branch from b690c91 to 85663f8 Compare March 17, 2020 07:20
@kubevirt-bot kubevirt-bot added dco-signoff: yes Indicates the PR's author has DCO signed all their commits. and removed dco-signoff: no Indicates the PR's author has not DCO signed all their commits. labels Mar 17, 2020
@mareklibra
Copy link
Contributor Author

/test pull-hyperconverged-cluster-operator-e2e-k8s-1.15.1

@mareklibra
Copy link
Contributor Author

/retest

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2020
@djzager
Copy link
Contributor

djzager commented Mar 17, 2020

/test pull-hyperconverged-cluster-operator-e2e-k8s-1.15.1

@kubevirt-bot kubevirt-bot merged commit de56e55 into kubevirt:master Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants