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

Add ArgoCD sync options to prevent premature pruning of bootstrap deployment #127

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

HappyTetrahedron
Copy link
Contributor

With the new setup, the bootstrap deployment is at some point deleted (to be replaced by the operator-managed one). However, this has to happen after the operator-managed ArgoCD is deployed. To prevent premature pruning, the bootstrap deployment is set to not be auto-pruned. A post-sync job in the ArgoCD component will remove these annotations at the appropriate time.

Checklist

  • Keep pull requests small so they can be easily reviewed.
  • Categorize the PR by setting a good title and adding one of the labels:
    bug, enhancement, documentation, change, breaking, dependency
    as they show up in the changelog

@HappyTetrahedron HappyTetrahedron added the bug Something isn't working label Jun 30, 2023
@@ -22,11 +22,13 @@ func createApplicationControllerStatefulSet(ctx context.Context, clientset *kube
for k, v := range argoLabels {
labels[k] = v
}
annotations := argoAnnotations
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the underlying map modified by the client? The labels above are copied so i'm not sure here if that is also needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I could see, the labels are copied because there are some additional labels being inserted as literals (line 18ff) and then the argoLabels map is effectively merged into that. I'm not doing that with the annotations, so I figured the copying wouldn't be necessary. I don't see why the client would modify the map.

Copy link
Contributor

@bastjan bastjan Jul 12, 2023

Choose a reason for hiding this comment

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

In Go slices and maps are passed by reference, unlike the other types. and i do wonder what the client does with the reference since the client updates the given object with the object returned by the cluster

@HappyTetrahedron HappyTetrahedron requested review from bastjan and removed request for bastjan July 12, 2023 09:09
@HappyTetrahedron HappyTetrahedron merged commit 29bfc0f into master Jul 12, 2023
3 checks passed
@HappyTetrahedron HappyTetrahedron deleted the feat/argocd-annotations branch July 12, 2023 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants