Skip to content

Commit

Permalink
namespace labels (#134)
Browse files Browse the repository at this point in the history
* namespace labels

* namespace labels

* namespace labels

* manifests changes

* namespace labels

* namespace labels

* namespace labels version
  • Loading branch information
pasha-codefresh authored Aug 8, 2022
1 parent 9cea6c1 commit 7fb7af3
Show file tree
Hide file tree
Showing 14 changed files with 665 additions and 437 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.4-cap-CR-12372-fix-split-err
2.3.4-cap-CR-namespace-labels
6 changes: 6 additions & 0 deletions assets/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -6781,6 +6781,12 @@
"automated": {
"$ref": "#/definitions/v1alpha1SyncPolicyAutomated"
},
"createNamespaceLabels": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"retry": {
"$ref": "#/definitions/v1alpha1RetryStrategy"
},
Expand Down
5 changes: 5 additions & 0 deletions controller/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
return true
}
return false
}, func(un *unstructured.Unstructured) bool {
if un != nil && len(app.Spec.SyncPolicy.CreateNamespaceLabels) > 0 {
un.SetLabels(app.Spec.SyncPolicy.CreateNamespaceLabels)
}
return true
}),
sync.WithSyncWaveHook(delayBetweenSyncWaves),
sync.WithPruneLast(syncOp.SyncOptions.HasOption(common.SyncOptionPruneLast)),
Expand Down
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ require (
)

replace (
github.com/argoproj/gitops-engine => github.com/codefresh-io/gitops-engine v0.6.3

// 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
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,6 @@ github.com/antonmedv/expr v1.8.9/go.mod h1:5qsM3oLGDND7sDmQGDXHkYfkjYMUX14qsgqmH
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/appscode/go v0.0.0-20190808133642-1d4ef1f1c1e0/go.mod h1:iy07dV61Z7QQdCKJCIvUoDL21u6AIceRhZzyleh2ymc=
github.com/argoproj/gitops-engine v0.6.2 h1:hM+pQeplCeIPAvfAmr1f91+ykxqaU0GAzuxVujqlKHM=
github.com/argoproj/gitops-engine v0.6.2/go.mod h1:pRgVpLW7pZqf7n3COJ7UcDepk4cI61LAcJd64Q3Jq/c=
github.com/argoproj/notifications-engine v0.3.1-0.20220127183449-91deed20b998 h1:V9RDg+IZeebnm3XjkfkbN07VM21Fu1Cy/RJNoHO++VM=
github.com/argoproj/notifications-engine v0.3.1-0.20220127183449-91deed20b998/go.mod h1:5mKv7zEgI3NO0L+fsuRSwBSY9EIXSuyIsDND8O8TTIw=
github.com/argoproj/pkg v0.11.1-0.20211203175135-36c59d8fafe0 h1:Cfp7rO/HpVxnwlRqJe0jHiBbZ77ZgXhB6HWlYD02Xdc=
Expand Down Expand Up @@ -196,6 +194,8 @@ github.com/cockroachdb/datadriven v0.0.0-20200714090401-bf6692d28da5/go.mod h1:h
github.com/cockroachdb/errors v1.2.4/go.mod h1:rQD95gz6FARkaKkQXUksEje/d9a6wBJoCr5oaCLELYA=
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI=
github.com/codefresh-io/gitops-engine v0.6.3 h1:w+GNezuISNyu8lf7fKoItYRGv1B6ugLLAPXI0oF4rNA=
github.com/codefresh-io/gitops-engine v0.6.3/go.mod h1:pRgVpLW7pZqf7n3COJ7UcDepk4cI61LAcJd64Q3Jq/c=
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
github.com/codeskyblue/go-sh v0.0.0-20190412065543-76bd3d59ff27/go.mod h1:VQx0hjo2oUeQkQUET7wRwradO6f+fN5jzXgB/zROxxE=
github.com/container-storage-interface/spec v1.5.0/go.mod h1:8K96oQNkJ7pFcC2R9Z1ynGGBB1I93kcS6PGg3SsOk8s=
Expand Down
4 changes: 4 additions & 0 deletions manifests/core-install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ spec:
(default: false)'
type: boolean
type: object
createNamespaceLabels:
additionalProperties:
type: string
type: object
retry:
description: Retry controls failed sync retry behavior
properties:
Expand Down
4 changes: 4 additions & 0 deletions manifests/crds/application-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,10 @@ spec:
(default: false)'
type: boolean
type: object
createNamespaceLabels:
additionalProperties:
type: string
type: object
retry:
description: Retry controls failed sync retry behavior
properties:
Expand Down
4 changes: 4 additions & 0 deletions manifests/ha/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ spec:
(default: false)'
type: boolean
type: object
createNamespaceLabels:
additionalProperties:
type: string
type: object
retry:
description: Retry controls failed sync retry behavior
properties:
Expand Down
4 changes: 4 additions & 0 deletions manifests/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,10 @@ spec:
(default: false)'
type: boolean
type: object
createNamespaceLabels:
additionalProperties:
type: string
type: object
retry:
description: Retry controls failed sync retry behavior
properties:
Expand Down
Loading

0 comments on commit 7fb7af3

Please sign in to comment.