This is an automated email from the ASF dual-hosted git repository. astefanutti pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 9dcab49b395dd956951fa78f42bf20acc3a67079 Author: phantomjinx <[email protected]> AuthorDate: Wed May 5 11:07:00 2021 +0100 fix(operator): Stop conflict between cluster-roles when using Global flag * When Global flag is used, the cluster-role-openshift conflicts with the promoted role so renames it to cluster-role-console-openshift * Updates all source relating to new cluster-role name * Re-generated resources --- config/rbac/kustomization.yaml | 4 ++-- ...or-cluster-role-console-binding-openshift.yaml} | 2 +- ...> operator-cluster-role-console-openshift.yaml} | 2 +- deploy/traits.yaml | 2 +- pkg/install/cluster.go | 2 +- pkg/install/operator.go | 8 ++++---- pkg/resources/resources.go | 24 +++++++++++----------- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml index 861e8cc..a1f09b3 100644 --- a/config/rbac/kustomization.yaml +++ b/config/rbac/kustomization.yaml @@ -32,5 +32,5 @@ resources: - operator-role-binding-podmonitors.yaml - operator-role-binding-strimzi.yaml - operator-role-binding.yaml -- operator-cluster-role-openshift.yaml -- operator-cluster-role-binding-openshift.yaml +- operator-cluster-role-console-openshift.yaml +- operator-cluster-role-console-binding-openshift.yaml diff --git a/config/rbac/operator-cluster-role-binding-openshift.yaml b/config/rbac/operator-cluster-role-console-binding-openshift.yaml similarity index 96% rename from config/rbac/operator-cluster-role-binding-openshift.yaml rename to config/rbac/operator-cluster-role-console-binding-openshift.yaml index 5f181fe..c900f9e 100644 --- a/config/rbac/operator-cluster-role-binding-openshift.yaml +++ b/config/rbac/operator-cluster-role-console-binding-openshift.yaml @@ -18,7 +18,7 @@ kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: camel-k-operator-openshift + name: camel-k-operator-console-openshift labels: app: "camel-k" subjects: diff --git a/config/rbac/operator-cluster-role-openshift.yaml b/config/rbac/operator-cluster-role-console-openshift.yaml similarity index 96% rename from config/rbac/operator-cluster-role-openshift.yaml rename to config/rbac/operator-cluster-role-console-openshift.yaml index 196655c..c0b6c10 100644 --- a/config/rbac/operator-cluster-role-openshift.yaml +++ b/config/rbac/operator-cluster-role-console-openshift.yaml @@ -18,7 +18,7 @@ kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: - name: camel-k-operator-openshift + name: camel-k-operator-console-openshift labels: app: "camel-k" rules: diff --git a/deploy/traits.yaml b/deploy/traits.yaml index 855ba4a..18cea7e 100755 --- a/deploy/traits.yaml +++ b/deploy/traits.yaml @@ -318,7 +318,7 @@ traits: description: Can be used to enable or disable a trait. All traits share this common property. - name: discovery-cache - type: ./pkg/trait.discoveryCacheType + type: github.com/apache/camel-k/pkg/trait.discoveryCacheType description: Discovery client cache to be used, either `disabled`, `disk` or `memory` (default `memory`) - name: ingress diff --git a/pkg/install/cluster.go b/pkg/install/cluster.go index 30b26a7..3cd37ea 100644 --- a/pkg/install/cluster.go +++ b/pkg/install/cluster.go @@ -173,7 +173,7 @@ func SetupClusterWideResourcesOrCollect(ctx context.Context, clientProvider clie return err } if !ok || collection != nil { - err := installResource(ctx, c, collection, "/rbac/operator-cluster-role-openshift.yaml") + err := installResource(ctx, c, collection, "/rbac/operator-cluster-role-console-openshift.yaml") if err != nil { return err } diff --git a/pkg/install/operator.go b/pkg/install/operator.go index b1ca8a7..1c78fbe 100644 --- a/pkg/install/operator.go +++ b/pkg/install/operator.go @@ -208,7 +208,7 @@ func OperatorOrCollect(ctx context.Context, c client.Client, cfg OperatorConfigu if err := installOpenShiftRoles(ctx, c, cfg.Namespace, customizer, collection, force); err != nil { return err } - if err := installOpenShiftClusterRoleBinding(ctx, c, collection, cfg.Namespace); err != nil { + if err := installOpenShiftClusterRoleConsoleBinding(ctx, c, collection, cfg.Namespace); err != nil { if k8serrors.IsForbidden(err) { fmt.Println("Warning: the operator will not be able to manage ConsoleCLIDownload resources. Try installing the operator as cluster-admin.") } else { @@ -283,12 +283,12 @@ func OperatorOrCollect(ctx context.Context, c client.Client, cfg OperatorConfigu return nil } -func installOpenShiftClusterRoleBinding(ctx context.Context, c client.Client, collection *kubernetes.Collection, namespace string) error { +func installOpenShiftClusterRoleConsoleBinding(ctx context.Context, c client.Client, collection *kubernetes.Collection, namespace string) error { var target *rbacv1.ClusterRoleBinding - existing, err := c.RbacV1().ClusterRoleBindings().Get(ctx, "camel-k-operator-openshift", metav1.GetOptions{}) + existing, err := c.RbacV1().ClusterRoleBindings().Get(ctx, "camel-k-operator-console-openshift", metav1.GetOptions{}) if k8serrors.IsNotFound(err) { existing = nil - obj, err := kubernetes.LoadResourceFromYaml(c.GetScheme(), resources.ResourceAsString("/rbac/operator-cluster-role-binding-openshift.yaml")) + obj, err := kubernetes.LoadResourceFromYaml(c.GetScheme(), resources.ResourceAsString("/rbac/operator-cluster-role-console-binding-openshift.yaml")) if err != nil { return err } diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go index d053a94..15cabbc 100644 --- a/pkg/resources/resources.go +++ b/pkg/resources/resources.go @@ -196,19 +196,19 @@ var assets = func() http.FileSystem { compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xc4\x54\x4f\x8f\xdb\xb6\x13\xbd\xf3\x53\x3c\x48\x97\xe4\x87\xb5\xfc\x6b\x4f\x85\x7b\x72\x37\xbb\xad\xd1\xc0\x06\x56\x4e\x83\x1c\xc7\xd4\x58\x1a\x2c\x45\xb2\x24\xb5\xca\xf6\xd3\x17\xa2\xed\xae\x1d\xa7\xff\xd0\x00\xd1\xc5\xd4\xf0\xf1\xcd\x7b\x7c\x63\x95\x98\x7d\xb9\x47\x95\x78\x2b\x9a\x6d\xe4\x06\xc9\x21\x75\x8c\xa5\x27\xdd\x31\x6a\xb7\x4f\x23\x05\xc6\xbd\x1b\x6c\x43\x49\x9c\xc5\xab\x65\x7d\xff\x1a\x83\x6d\x38\xc0\x59\x [...] }, - "/rbac/operator-cluster-role-binding-openshift.yaml": &vfsgen۰CompressedFileInfo{ - name: "operator-cluster-role-binding-openshift.yaml", + "/rbac/operator-cluster-role-console-binding-openshift.yaml": &vfsgen۰CompressedFileInfo{ + name: "operator-cluster-role-console-binding-openshift.yaml", modTime: time.Time{}, - uncompressedSize: 1239, + uncompressedSize: 1247, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x53\x4d\x8f\xdb\x36\x10\xbd\xf3\x57\x3c\x58\x97\x04\x58\xcb\x6d\x4f\x85\x7b\x72\x36\xbb\xad\xd0\xc0\x06\x2c\xa7\x41\x8e\x34\x35\x96\xa6\x4b\x71\xd4\x21\xb5\x8a\xfb\xeb\x0b\xca\x76\xb3\x41\xd0\x22\x87\xf0\x24\x41\xa3\xf7\x31\xef\xb1\xc0\xf2\xfb\x1d\x53\xe0\x1d\x3b\x0a\x91\x1a\x24\x41\xea\x08\x9b\xc1\xba\x8e\x50\xcb\x29\x4d\x56\x09\x8f\x32\x86\xc6\x26\x96\x80\x57\x9b\xfa\xf1\x35\xc6\xd0\x90\x42\x02\x41\x14\xbd\x28\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x93\x41\x8f\xdb\x36\x10\x85\xef\xfc\x15\x0f\xd6\x25\x01\xd6\x72\xdb\x53\xe1\x9e\x9c\xcd\x6e\x2b\x34\xb0\x01\xcb\x69\x90\x23\x4d\x8d\xa5\xe9\x52\x1c\x75\x48\xad\xb2\xfd\xf5\x05\x65\xbb\x71\x10\x24\xa7\xf0\x26\x89\x9c\xf7\x3d\xbe\xa7\x02\xcb\x1f\xb7\x4c\x81\x77\xec\x28\x44\x6a\x90\x04\xa9\x23\x6c\x06\xeb\x3a\x42\x2d\xa7\x34\x59\x25\x3c\xca\x18\x1a\x9b\x58\x02\x5e\x6d\xea\xc7\xd7\x18\x43\x43\x0a\x09\x04\x51\xf4\xa2\x [...] }, - "/rbac/operator-cluster-role-openshift.yaml": &vfsgen۰CompressedFileInfo{ - name: "operator-cluster-role-openshift.yaml", + "/rbac/operator-cluster-role-console-openshift.yaml": &vfsgen۰CompressedFileInfo{ + name: "operator-cluster-role-console-openshift.yaml", modTime: time.Time{}, - uncompressedSize: 1254, + uncompressedSize: 1262, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x53\xc1\x6e\xdb\x46\x10\xbd\xef\x57\x3c\x88\x97\x04\xb0\xe8\xb6\xa7\x42\x3d\xa9\x8e\xdd\x12\x0d\x24\xc0\x54\x1a\xe4\x38\x22\x47\xe4\xc0\xcb\x1d\x76\x76\x69\xc6\xfd\xfa\x62\x29\x29\xb1\xd1\x6b\xf6\xc2\xe1\xf2\xf1\xcd\x7b\xfb\x66\x0b\xac\x7f\xdc\x72\x05\x3e\x4a\xc3\x21\x72\x8b\xa4\x48\x3d\x63\x3b\x52\xd3\x33\x6a\x3d\xa5\x99\x8c\xf1\xa0\x53\x68\x29\x89\x06\xbc\xdb\xd6\x0f\xef\x31\x85\x96\x0d\x1a\x18\x6a\x18\xd4\xd8\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x53\xc1\x8e\xdb\x36\x10\xbd\xf3\x2b\x1e\xac\x4b\x02\xac\xb5\x6d\x4f\x85\x7b\x72\x37\xbb\xad\xd0\xc0\x06\x56\x4e\x83\x1c\x69\x6a\x2c\x0d\x96\xe2\xa8\x43\x6a\x95\xed\xd7\x17\xa4\xed\x64\x17\xbd\x86\x17\x8d\xa8\xc7\x37\xef\xf1\x8d\x2a\xac\x7f\xdc\x32\x15\x3e\xb2\xa3\x10\xa9\x43\x12\xa4\x81\xb0\x9d\xac\x1b\x08\xad\x9c\xd2\x62\x95\xf0\x20\x73\xe8\x6c\x62\x09\x78\xb7\x6d\x1f\xde\x63\x0e\x1d\x29\x24\x10\x44\x31\x8a\x92\x [...] }, "/rbac/operator-role-binding-events.yaml": &vfsgen۰CompressedFileInfo{ name: "operator-role-binding-events.yaml", @@ -467,9 +467,9 @@ var assets = func() http.FileSystem { "/traits.yaml": &vfsgen۰CompressedFileInfo{ name: "traits.yaml", modTime: time.Time{}, - uncompressedSize: 42583, + uncompressedSize: 42607, - compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x6b\x73\x5b\xb9\xb1\xe0\x77\xff\x0a\x94\xee\x56\x59\x52\x91\x94\x27\xb9\x49\x66\xb5\x3b\x9b\xd2\x78\x3c\x89\x66\xfc\xd0\xda\xce\x64\x6f\x79\xa7\x42\xf0\x9c\x26\x09\x0b\x04\x4e\x00\x1c\xc9\xcc\xde\xfd\xef\x5b\xe8\x6e\x3c\x0e\x49\x49\x94\xc7\x9a\x8d\x6e\xdd\xe4\xc3\x58\xd2\x01\xd0\x68\x34\xfa\xdd\x8d\xe0\xa4\x0a\xfe\xf4\xc9\x58\x18\xb9\x82\x53\x21\xe7\x73\x65\x54\x58\x3f\x11\xa2\xd3\x32\xcc\xad\x5b\x9d\x8a\xb9\x [...] + compressedContent: []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x7d\x6b\x73\x5b\xb9\xb1\xe0\x77\xff\x0a\x94\xee\x56\x59\x52\x91\x94\x27\xb9\x49\x66\xb5\x3b\x9b\xd2\x78\x3c\x89\x66\xfc\xd0\xda\xce\x64\x6f\x79\xa7\x42\xf0\x9c\x26\x09\x0b\x04\x4e\x00\x1c\xc9\xcc\xde\xfd\xef\x5b\xe8\x6e\x3c\x0e\x49\x49\x94\xc7\x9a\x8d\x6e\xdd\xe4\xc3\x58\xd2\x01\xd0\x68\x34\xfa\xdd\x8d\xe0\xa4\x0a\xfe\xf4\xc9\x58\x18\xb9\x82\x53\x21\xe7\x73\x65\x54\x58\x3f\x11\xa2\xd3\x32\xcc\xad\x5b\x9d\x8a\xb9\x [...] }, } fs["/"].(*vfsgen۰DirInfo).entries = []os.FileInfo{ @@ -518,8 +518,8 @@ var assets = func() http.FileSystem { fs["/rbac/builder-role-binding.yaml"].(os.FileInfo), fs["/rbac/builder-role-kubernetes.yaml"].(os.FileInfo), fs["/rbac/builder-role-openshift.yaml"].(os.FileInfo), - fs["/rbac/operator-cluster-role-binding-openshift.yaml"].(os.FileInfo), - fs["/rbac/operator-cluster-role-openshift.yaml"].(os.FileInfo), + fs["/rbac/operator-cluster-role-console-binding-openshift.yaml"].(os.FileInfo), + fs["/rbac/operator-cluster-role-console-openshift.yaml"].(os.FileInfo), fs["/rbac/operator-role-binding-events.yaml"].(os.FileInfo), fs["/rbac/operator-role-binding-knative.yaml"].(os.FileInfo), fs["/rbac/operator-role-binding-leases.yaml"].(os.FileInfo),
