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

ACM-5994 Reinstall operator when deployment arguments are mismatched #249

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

o-farag
Copy link
Contributor

@o-farag o-farag commented Jun 22, 2023

Description of the change(s):

  • Reinstall operator when operator deployment args change

Why do we need this PR:

  • If OIDC args are added after operator is already installed, the operator isn't reinstalled with new args. This change watches operator deployment args and reinstalls the operator if they differ from expected args

Issue reference:

Test API/Unit - Success

?       github.com/stolostron/hypershift-addon-operator/cmd     [no test files]
ok      github.com/stolostron/hypershift-addon-operator/pkg/agent       13.068s coverage: 71.2% of statements
ok      github.com/stolostron/hypershift-addon-operator/pkg/install     178.439s        coverage: 86.3% of statements
ok      github.com/stolostron/hypershift-addon-operator/pkg/manager     120.040s        coverage: 60.6% of statements
ok      github.com/stolostron/hypershift-addon-operator/pkg/metrics     0.005s  coverage: 100.0% of statements
?       github.com/stolostron/hypershift-addon-operator/pkg/util        [no test files]

@openshift-ci
Copy link

openshift-ci bot commented Jun 22, 2023

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci
Copy link

openshift-ci bot commented Jun 22, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: o-farag
Once this PR has been reviewed and has the lgtm label, please assign philipwu08 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

Signed-off-by: Omar Farag <[email protected]>
@o-farag
Copy link
Contributor Author

o-farag commented Jun 22, 2023

/test all

1 similar comment
@o-farag
Copy link
Contributor Author

o-farag commented Jun 23, 2023

/test all

@o-farag
Copy link
Contributor Author

o-farag commented Jun 23, 2023

/test all

Signed-off-by: Omar Farag <[email protected]>
@o-farag o-farag marked this pull request as ready for review June 23, 2023 21:08
@o-farag o-farag changed the title ACM-5994 Reinstall operator when deployment arguments change ACM-5994 Reinstall operator when deployment arguments are mismatched Jun 23, 2023
Signed-off-by: Omar Farag <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Jun 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

92.9% 92.9% Coverage
0.0% 0.0% Duplication

@o-farag o-farag requested a review from rokej June 26, 2023 18:23
Copy link
Contributor

@rokej rokej left a comment

Choose a reason for hiding this comment

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

@o-farag I think this will work for checking changes in S3 bucket name. This does not catch cases where there was OIDC configuration but not any more... etc.

I am wondering if we can have more generic way to check for changes like https://github.com/stolostron/hypershift-addon-operator/blob/main/pkg/install/hypershift_test.go#L880. Based on user input and secrets, the hypershift install code generates a certain set of args for installing hypershift.

@o-farag
Copy link
Contributor Author

o-farag commented Jun 26, 2023

@o-farag I think this will work for checking changes in S3 bucket name. This does not catch cases where there was OIDC configuration but not any more... etc.

@rokej not completely sure what you mean, could you elaborate more? Doesn't this line: https://github.com/o-farag/hypershift-addon-operator/blob/ce8bc890e78dfb0152ce5c802e2daca58fb380c4/pkg/install/upgrade.go#L222 catch the case where there was OIDC configuration but not anymore?

I am wondering if we can have more generic way to check for changes like https://github.com/stolostron/hypershift-addon-operator/blob/main/pkg/install/hypershift_test.go#L880. Based on user input and secrets, the hypershift install code generates a certain set of args for installing hypershift.

To confirm, a generic way to check for mismatch of all args instead of just OIDC args?

@o-farag o-farag marked this pull request as draft June 27, 2023 17:57
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.

2 participants