Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=gitops-operator
LABEL operators.operatorframework.io.bundle.channels.v1=latest,gitops-1.8
LABEL operators.operatorframework.io.bundle.channel.default.v1=latest
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.34.1
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.22.2
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
14 changes: 14 additions & 0 deletions bundle/manifests/argoproj.io_rolloutmanagers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ spec:
spec:
description: RolloutManagerSpec defines the desired state of Argo Rollouts
properties:
additionalMetadata:
description: Metadata to apply to the generated resources
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
type: object
type: object
env:
description: Env lets you specify environment for Rollouts pods
items:
Expand Down
11 changes: 9 additions & 2 deletions bundle/manifests/gitops-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,12 @@ metadata:
capabilities: Deep Insights
console.openshift.io/plugins: '["gitops-plugin"]'
containerImage: quay.io/redhat-developer/gitops-operator
createdAt: "2024-05-23T14:48:45Z"
description: Enables teams to adopt GitOps principles for managing cluster configurations
and application delivery across hybrid multi-cluster Kubernetes environments.
operatorframework.io/cluster-monitoring: "true"
operatorframework.io/suggested-namespace: openshift-gitops-operator
operators.openshift.io/infrastructure-features: '["disconnected"]'
operators.operatorframework.io/builder: operator-sdk-v1.34.1
operators.operatorframework.io/builder: operator-sdk-v1.22.2
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/redhat-developer/gitops-operator
support: Red Hat
Expand Down Expand Up @@ -411,6 +410,14 @@ spec:
- get
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- apiGroups:
- appmesh.k8s.aws
resources:
Expand Down
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ annotations:
operators.operatorframework.io.bundle.package.v1: gitops-operator
operators.operatorframework.io.bundle.channels.v1: latest,gitops-1.8
operators.operatorframework.io.bundle.channel.default.v1: latest
operators.operatorframework.io.metrics.builder: operator-sdk-v1.34.1
operators.operatorframework.io.metrics.builder: operator-sdk-v1.22.2
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/argoproj.io_rolloutmanagers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,20 @@ spec:
spec:
description: RolloutManagerSpec defines the desired state of Argo Rollouts
properties:
additionalMetadata:
description: Metadata to apply to the generated resources
properties:
annotations:
additionalProperties:
type: string
description: Annotations to add to the resources during its creation.
type: object
labels:
additionalProperties:
type: string
description: Labels to add to the resources during its creation.
type: object
type: object
env:
description: Env lets you specify environment for Rollouts pods
items:
Expand Down
10 changes: 10 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: manager-role
rules:
- apiGroups:
Expand Down Expand Up @@ -84,6 +86,14 @@ rules:
- get
- list
- watch
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- list
- watch
- apiGroups:
- appmesh.k8s.aws
resources:
Expand Down
3 changes: 2 additions & 1 deletion controllers/gitopsservice_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ type ReconcileGitopsService struct {
//+kubebuilder:rbac:groups="split.smi-spec.io",resources=trafficsplits,verbs=create;watch;get;update;patch
//+kubebuilder:rbac:groups="traefik.containo.us",resources=traefikservices,verbs=watch;get;update
//+kubebuilder:rbac:groups="x.getambassador.io",resources=ambassadormappings;mappings,verbs=create;watch;get;update;list;delete
// +kubebuilder:rbac:groups=argoproj.io,resources=notificationsconfigurations;notificationsconfigurations/finalizers,verbs=*
//+kubebuilder:rbac:groups=argoproj.io,resources=notificationsconfigurations;notificationsconfigurations/finalizers,verbs=*
//+kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch;

// Reconcile reads that state of the cluster for a GitopsService object and makes changes based on the state read
// and what is in the GitopsService.Spec
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/redhat-developer/gitops-operator
go 1.21

require (
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240508151103-837f3074a22a
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240525211646-b3e573f0e6ea
github.com/argoproj-labs/argocd-operator v0.9.0-rc3.0.20240522063919-1ff45e5571c1
github.com/coreos/prometheus-operator v0.40.0
github.com/go-logr/logr v1.4.1
Expand All @@ -18,6 +18,7 @@ require (
golang.org/x/mod v0.17.0
gotest.tools v2.2.0+incompatible
k8s.io/api v0.29.2
k8s.io/apiextensions-apiserver v0.29.2
k8s.io/apimachinery v0.29.2
k8s.io/client-go v12.0.0+incompatible
k8s.io/utils v0.0.0-20240102154912-e7106e64919e
Expand Down Expand Up @@ -81,7 +82,6 @@ require (
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.29.2 // indirect
k8s.io/component-base v0.29.2 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240227032403-f107216b40e2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,8 @@ github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4x
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/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240508151103-837f3074a22a h1:bjcQkMYM5tlE52DS9AAZftzMZVDcEPueSDrmx6QtniM=
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240508151103-837f3074a22a/go.mod h1:+qJpu01daETe3BpdO4XKaTe3ivFYY1LkrxeGfTbPI3I=
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240525211646-b3e573f0e6ea h1:mEBK+0Y8wd/JFxq9TYyE9UY3Q1vC9G+U6+nFqy9GTvw=
github.com/argoproj-labs/argo-rollouts-manager v0.0.3-0.20240525211646-b3e573f0e6ea/go.mod h1:seR9B+tx6AbGaya+JA61HDBFciKx7FM7t/1IMhOwXlM=
github.com/argoproj-labs/argocd-operator v0.9.0-rc3.0.20240522063919-1ff45e5571c1 h1:YDYzf9ixW2hxGf+3UjBPJHlJxHAqZy15gu5I+FiJHio=
github.com/argoproj-labs/argocd-operator v0.9.0-rc3.0.20240522063919-1ff45e5571c1/go.mod h1:7sKiKXblkKFvdZQ6VVerbp4+HBboi3VdZuqSuTa7OX8=
github.com/argoproj/argo-cd/v2 v2.10.8 h1:WRnzXqMiAapSYzR6fkDUBfen+irHlOeCG6zrXWuPU9E=
Expand Down
17 changes: 14 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import (
templatev1 "github.com/openshift/api/template/v1"
operatorsv1 "github.com/operator-framework/api/pkg/operators/v1"
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
crdv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
Expand Down Expand Up @@ -169,6 +170,7 @@ func main() {
registerComponentOrExit(mgr, templatev1.AddToScheme)
registerComponentOrExit(mgr, appsv1.AddToScheme)
registerComponentOrExit(mgr, oauthv1.AddToScheme)
registerComponentOrExit(mgr, crdv1.AddToScheme)

// Start webhook only if ENABLE_CONVERSION_WEBHOOK is set
if strings.EqualFold(os.Getenv("ENABLE_CONVERSION_WEBHOOK"), "true") {
Expand Down Expand Up @@ -218,10 +220,19 @@ func main() {
os.Exit(1)
}

isNamespaceScoped := strings.ToLower(os.Getenv(rolloutManagerProvisioner.NamespaceScopedArgoRolloutsController)) == "true"

if isNamespaceScoped {
setupLog.Info("Argo Rollouts manager running in namespaced-scoped mode")
} else {
setupLog.Info("Argo Rollouts manager running in cluster-scoped mode")
}

if err = (&rolloutManagerProvisioner.RolloutManagerReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
OpenShiftRoutePluginLocation: getArgoRolloutsOpenshiftRouteTrafficManagerPath(),
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
OpenShiftRoutePluginLocation: getArgoRolloutsOpenshiftRouteTrafficManagerPath(),
NamespaceScopedArgoRolloutsController: isNamespaceScoped,
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Argo Rollouts")
os.Exit(1)
Expand Down