Skip to content

Commit 03612ed

Browse files
authored
Update to latest commit of argo-rollouts-manager 'b3e573f0e6ea3a5ec3eeba70ebb5d90e58efcd68' (#718)
* Update to latest commit of argo-rollouts-manager 'c132cfa3b12975c44d7397009ea7351f9f386e82' Signed-off-by: Jonathan West <[email protected]> * Add CRD to scheme, enable namespace-scoped hooks Signed-off-by: Jonathan West <[email protected]> --------- Signed-off-by: Jonathan West <[email protected]>
1 parent 6d06274 commit 03612ed

File tree

10 files changed

+69
-12
lines changed

10 files changed

+69
-12
lines changed

bundle.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
77
LABEL operators.operatorframework.io.bundle.package.v1=gitops-operator
88
LABEL operators.operatorframework.io.bundle.channels.v1=latest,gitops-1.8
99
LABEL operators.operatorframework.io.bundle.channel.default.v1=latest
10-
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.1
10+
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.22.2
1111
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
1212
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3
1313

bundle/manifests/argoproj.io_rolloutmanagers.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ spec:
3434
spec:
3535
description: RolloutManagerSpec defines the desired state of Argo Rollouts
3636
properties:
37+
additionalMetadata:
38+
description: Metadata to apply to the generated resources
39+
properties:
40+
annotations:
41+
additionalProperties:
42+
type: string
43+
description: Annotations to add to the resources during its creation.
44+
type: object
45+
labels:
46+
additionalProperties:
47+
type: string
48+
description: Labels to add to the resources during its creation.
49+
type: object
50+
type: object
3751
env:
3852
description: Env lets you specify environment for Rollouts pods
3953
items:

bundle/manifests/gitops-operator.clusterserviceversion.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,12 @@ metadata:
164164
capabilities: Deep Insights
165165
console.openshift.io/plugins: '["gitops-plugin"]'
166166
containerImage: quay.io/redhat-developer/gitops-operator
167-
createdAt: "2024-05-23T14:48:45Z"
168167
description: Enables teams to adopt GitOps principles for managing cluster configurations
169168
and application delivery across hybrid multi-cluster Kubernetes environments.
170169
operatorframework.io/cluster-monitoring: "true"
171170
operatorframework.io/suggested-namespace: openshift-gitops-operator
172171
operators.openshift.io/infrastructure-features: '["disconnected"]'
173-
operators.operatorframework.io/builder: operator-sdk-v1.34.1
172+
operators.operatorframework.io/builder: operator-sdk-v1.22.2
174173
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
175174
repository: https://github.com/redhat-developer/gitops-operator
176175
support: Red Hat
@@ -411,6 +410,14 @@ spec:
411410
- get
412411
- list
413412
- watch
413+
- apiGroups:
414+
- apiextensions.k8s.io
415+
resources:
416+
- customresourcedefinitions
417+
verbs:
418+
- get
419+
- list
420+
- watch
414421
- apiGroups:
415422
- appmesh.k8s.aws
416423
resources:

bundle/metadata/annotations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ annotations:
66
operators.operatorframework.io.bundle.package.v1: gitops-operator
77
operators.operatorframework.io.bundle.channels.v1: latest,gitops-1.8
88
operators.operatorframework.io.bundle.channel.default.v1: latest
9-
operators.operatorframework.io.metrics.builder: operator-sdk-v1.34.1
9+
operators.operatorframework.io.metrics.builder: operator-sdk-v1.22.2
1010
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
1111
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3
1212

config/crd/bases/argoproj.io_rolloutmanagers.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ spec:
3535
spec:
3636
description: RolloutManagerSpec defines the desired state of Argo Rollouts
3737
properties:
38+
additionalMetadata:
39+
description: Metadata to apply to the generated resources
40+
properties:
41+
annotations:
42+
additionalProperties:
43+
type: string
44+
description: Annotations to add to the resources during its creation.
45+
type: object
46+
labels:
47+
additionalProperties:
48+
type: string
49+
description: Labels to add to the resources during its creation.
50+
type: object
51+
type: object
3852
env:
3953
description: Env lets you specify environment for Rollouts pods
4054
items:

config/rbac/role.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
12
---
23
apiVersion: rbac.authorization.k8s.io/v1
34
kind: ClusterRole
45
metadata:
6+
creationTimestamp: null
57
name: manager-role
68
rules:
79
- apiGroups:
@@ -84,6 +86,14 @@ rules:
8486
- get
8587
- list
8688
- watch
89+
- apiGroups:
90+
- apiextensions.k8s.io
91+
resources:
92+
- customresourcedefinitions
93+
verbs:
94+
- get
95+
- list
96+
- watch
8797
- apiGroups:
8898
- appmesh.k8s.aws
8999
resources:

controllers/gitopsservice_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ type ReconcileGitopsService struct {
189189
//+kubebuilder:rbac:groups="split.smi-spec.io",resources=trafficsplits,verbs=create;watch;get;update;patch
190190
//+kubebuilder:rbac:groups="traefik.containo.us",resources=traefikservices,verbs=watch;get;update
191191
//+kubebuilder:rbac:groups="x.getambassador.io",resources=ambassadormappings;mappings,verbs=create;watch;get;update;list;delete
192-
// +kubebuilder:rbac:groups=argoproj.io,resources=notificationsconfigurations;notificationsconfigurations/finalizers,verbs=*
192+
//+kubebuilder:rbac:groups=argoproj.io,resources=notificationsconfigurations;notificationsconfigurations/finalizers,verbs=*
193+
//+kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch;
193194

194195
// Reconcile reads that state of the cluster for a GitopsService object and makes changes based on the state read
195196
// and what is in the GitopsService.Spec

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/redhat-developer/gitops-operator
33
go 1.21
44

55
require (
6-
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240508151103-837f3074a22a
6+
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240525211646-b3e573f0e6ea
77
github.com/argoproj-labs/argocd-operator v0.9.0-rc3.0.20240522063919-1ff45e5571c1
88
github.com/coreos/prometheus-operator v0.40.0
99
github.com/go-logr/logr v1.4.1
@@ -18,6 +18,7 @@ require (
1818
golang.org/x/mod v0.17.0
1919
gotest.tools v2.2.0+incompatible
2020
k8s.io/api v0.29.2
21+
k8s.io/apiextensions-apiserver v0.29.2
2122
k8s.io/apimachinery v0.29.2
2223
k8s.io/client-go v12.0.0+incompatible
2324
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
@@ -81,7 +82,6 @@ require (
8182
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
8283
gopkg.in/yaml.v2 v2.4.0 // indirect
8384
gopkg.in/yaml.v3 v3.0.1 // indirect
84-
k8s.io/apiextensions-apiserver v0.29.2 // indirect
8585
k8s.io/component-base v0.29.2 // indirect
8686
k8s.io/klog/v2 v2.120.1 // indirect
8787
k8s.io/kube-openapi v0.0.0-20240227032403-f107216b40e2 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -637,8 +637,8 @@ github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4x
637637
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
638638
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
639639
github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
640-
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240508151103-837f3074a22a h1:bjcQkMYM5tlE52DS9AAZftzMZVDcEPueSDrmx6QtniM=
641-
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240508151103-837f3074a22a/go.mod h1:+qJpu01daETe3BpdO4XKaTe3ivFYY1LkrxeGfTbPI3I=
640+
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240525211646-b3e573f0e6ea h1:mEBK+0Y8wd/JFxq9TYyE9UY3Q1vC9G+U6+nFqy9GTvw=
641+
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240525211646-b3e573f0e6ea/go.mod h1:seR9B+tx6AbGaya+JA61HDBFciKx7FM7t/1IMhOwXlM=
642642
github.com/argoproj-labs/argocd-operator v0.9.0-rc3.0.20240522063919-1ff45e5571c1 h1:YDYzf9ixW2hxGf+3UjBPJHlJxHAqZy15gu5I+FiJHio=
643643
github.com/argoproj-labs/argocd-operator v0.9.0-rc3.0.20240522063919-1ff45e5571c1/go.mod h1:7sKiKXblkKFvdZQ6VVerbp4+HBboi3VdZuqSuTa7OX8=
644644
github.com/argoproj/argo-cd/v2 v2.10.8 h1:WRnzXqMiAapSYzR6fkDUBfen+irHlOeCG6zrXWuPU9E=

main.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import (
4545
templatev1 "github.com/openshift/api/template/v1"
4646
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
4747
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
48+
crdv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
4849
"k8s.io/apimachinery/pkg/labels"
4950
"k8s.io/apimachinery/pkg/runtime"
5051
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
@@ -169,6 +170,7 @@ func main() {
169170
registerComponentOrExit(mgr, templatev1.AddToScheme)
170171
registerComponentOrExit(mgr, appsv1.AddToScheme)
171172
registerComponentOrExit(mgr, oauthv1.AddToScheme)
173+
registerComponentOrExit(mgr, crdv1.AddToScheme)
172174

173175
// Start webhook only if ENABLE_CONVERSION_WEBHOOK is set
174176
if strings.EqualFold(os.Getenv("ENABLE_CONVERSION_WEBHOOK"), "true") {
@@ -218,10 +220,19 @@ func main() {
218220
os.Exit(1)
219221
}
220222

223+
isNamespaceScoped := strings.ToLower(os.Getenv(rolloutManagerProvisioner.NamespaceScopedArgoRolloutsController)) == "true"
224+
225+
if isNamespaceScoped {
226+
setupLog.Info("Argo Rollouts manager running in namespaced-scoped mode")
227+
} else {
228+
setupLog.Info("Argo Rollouts manager running in cluster-scoped mode")
229+
}
230+
221231
if err = (&rolloutManagerProvisioner.RolloutManagerReconciler{
222-
Client: mgr.GetClient(),
223-
Scheme: mgr.GetScheme(),
224-
OpenShiftRoutePluginLocation: getArgoRolloutsOpenshiftRouteTrafficManagerPath(),
232+
Client: mgr.GetClient(),
233+
Scheme: mgr.GetScheme(),
234+
OpenShiftRoutePluginLocation: getArgoRolloutsOpenshiftRouteTrafficManagerPath(),
235+
NamespaceScopedArgoRolloutsController: isNamespaceScoped,
225236
}).SetupWithManager(mgr); err != nil {
226237
setupLog.Error(err, "unable to create controller", "controller", "Argo Rollouts")
227238
os.Exit(1)

0 commit comments

Comments
 (0)