Skip to content

Commit

Permalink
chore: upgrade gitops-engine
Browse files Browse the repository at this point in the history
This requires argoproj/gitops-engine#537. This builds upon argoproj#13965,
with the difference that this does not require any changes in the usage
of `managedNamespaceMetadata`.

Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
  • Loading branch information
blakepettersson committed Aug 18, 2023
1 parent bc07a52 commit f9f16ac
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/user-guide/sync-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@ spec:
- CreateNamespace=true
```

In order for Argo CD to manage the labels and annotations on the namespace, `CreateNamespace=true` needs to be set as a
In order for ArgoCD to manage the labels and annotations on the namespace, `CreateNamespace=true` needs to be set as a
sync option, otherwise nothing will happen. If the namespace doesn't already exist, or if it already exists and doesn't
already have labels and/or annotations set on it, you're good to go. Using `managedNamespaceMetadata` will also set the
resource tracking label (or annotation) on the namespace, so you can easily track which namespaces are managed by Argo CD.
resource tracking label (or annotation) on the namespace, so you can easily track which namespaces are managed by ArgoCD.

In the case you do not have any custom annotations or labels but would nonetheless want to have resource tracking set on
your namespace, that can be done by setting `managedNamespaceMetadata` with an empty `labels` and/or `annotations` map,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ require (
)

replace (
github.com/argoproj/gitops-engine => github.com/fengshunli/gitops-engine v0.7.1-0.20230608143836-bd5248bb6b4f
github.com/argoproj/gitops-engine => github.com/blakepettersson/gitops-engine v0.0.0-20230817215925-fff71d9ae72b
// https://github.com/golang/go/issues/33546#issuecomment-519656923
github.com/go-check/check => github.com/go-check/check v0.0.0-20180628173108-788fd7840127

Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM=
github.com/blakepettersson/gitops-engine v0.0.0-20230817215925-fff71d9ae72b/go.mod h1:/a5oG4Ozy1mVNWiHLGT3tIq6bTYns+PB1P+0D1F7Gw0=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
github.com/bmatcuk/doublestar/v4 v4.6.0 h1:HTuxyug8GyFbRkrffIpzNCSK4luc0TY3wzXvzIZhEXc=
Expand Down
8 changes: 4 additions & 4 deletions test/e2e/app_management_ns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2089,8 +2089,8 @@ metadata:
delete(ns.Annotations, "argocd.argoproj.io/tracking-id")
delete(ns.Annotations, "kubectl.kubernetes.io/last-applied-configuration")

assert.Equal(t, map[string]string{"foo": "bar"}, ns.Labels)
assert.Equal(t, map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true", "bar": "bat"}, ns.Annotations)
assert.Equal(t, map[string]string{"test": "true", "foo": "bar"}, ns.Labels)
assert.Equal(t, map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true", "something": "whatevs", "bar": "bat"}, ns.Annotations)
})).
When().
And(func() {
Expand All @@ -2109,7 +2109,7 @@ metadata:
delete(ns.Annotations, "kubectl.kubernetes.io/last-applied-configuration")
delete(ns.Annotations, "argocd.argoproj.io/tracking-id")

assert.Equal(t, map[string]string{"foo": "bar"}, ns.Labels)
assert.Equal(t, map[string]string{"test": "true", "foo": "bar"}, ns.Labels)
assert.Equal(t, map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true", "something": "hmm", "bar": "bat"}, ns.Annotations)
assert.Equal(t, map[string]string{"something": "hmm", "bar": "bat"}, app.Spec.SyncPolicy.ManagedNamespaceMetadata.Annotations)
})).
Expand All @@ -2130,7 +2130,7 @@ metadata:
delete(ns.Annotations, "kubectl.kubernetes.io/last-applied-configuration")
delete(ns.Annotations, "argocd.argoproj.io/tracking-id")

assert.Equal(t, map[string]string{"foo": "bar"}, ns.Labels)
assert.Equal(t, map[string]string{"test": "true", "foo": "bar"}, ns.Labels)
assert.Equal(t, map[string]string{"argocd.argoproj.io/sync-options": "ServerSideApply=true", "bar": "bat"}, ns.Annotations)
assert.Equal(t, map[string]string{"bar": "bat"}, app.Spec.SyncPolicy.ManagedNamespaceMetadata.Annotations)
})).
Expand Down

0 comments on commit f9f16ac

Please sign in to comment.