-
Notifications
You must be signed in to change notification settings - Fork 47
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
Recreate missing Secrets for RepositoryCredentials. #666
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #666 +/- ##
==========================================
+ Coverage 62.64% 62.72% +0.07%
==========================================
Files 99 99
Lines 18162 18237 +75
==========================================
+ Hits 11378 11439 +61
- Misses 5518 5529 +11
- Partials 1266 1269 +3
☔ View full report in Codecov by Sentry. |
|
||
repositoryCredentials.Created_on = time.Now().Add(time.Duration(-(31 * time.Minute))) | ||
err := dbq.UpdateRepositoryCredentials(ctx, &repositoryCredentials) | ||
Expect(err).ToNot(HaveOccurred()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this part here up to before the HaveLen check be commoned up with what is done in the previous test?
@@ -72,7 +72,8 @@ func (r *ApplicationReconciler) startTimerForNextCycle(ctx context.Context, name | |||
cleanOrphanedCRsfromCluster_Operation(ctx, r.DB, r.Client, log) | |||
|
|||
// Recreate Secrets that are required by Applications, but missing from cluster. | |||
recreateClusterSecrets(ctx, r.DB, r.Client, log) | |||
recreateClusterSecrets_ManagedEnvironments(ctx, r.DB, r.Client, log) | |||
recreateClusterSecrets_RepositoryCredentials(ctx, r.DB, r.Client, log) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new function has some code in common with the original recreateClusterSecrets_ManagedEnvironments function. I wonder if it can be commoned up? If not simple to refactor, then leave it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is updated, PTAL.
1ba0e6e
to
34032b7
Compare
This reverts commit f82975d.
bff1d1c
to
84b79c9
Compare
An unrelated E2E is failing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks perfect, thanks @jparsai, and thanks @keithchong for reviewing!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jgwest, jparsai 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 |
@jparsai: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Description:
This PR is to add a logic to recreate Secrets in Argo CD namespace if they are required by RepositoryCredentials but missing in Cluster for some reason.
JIRA Ticket:
https://issues.redhat.com/browse/GITOPSRVCE-740
Type of changes
recreateClusterSecrets_ManagedEnvironments
function.recreateClusterSecrets
which callsrecreateClusterSecrets_ManagedEnvironments
function for creating missing secret for ManagedEnvironments andrecreateClusterSecrets_RepositoryCredentials
for RepositoryCredentials.