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 e417abbaa42df3c1a8d42f2b245c11cc6267248d
Author: phantomjinx <[email protected]>
AuthorDate: Fri Sep 17 15:59:47 2021 +0100

    Moves viewer role and binding out of kustomize config
    
    * Role installed by operator so not applicable to the kustomize install
---
 config/rbac/kustomization.yaml                     |  2 --
 pkg/install/kamelets.go                            |  4 +--
 pkg/resources/resources.go                         | 39 +++++++++++++---------
 .../user-global-kamelet-viewer-role-binding.yaml   |  0
 .../viewer}/user-global-kamelet-viewer-role.yaml   |  0
 5 files changed, 25 insertions(+), 20 deletions(-)

diff --git a/config/rbac/kustomization.yaml b/config/rbac/kustomization.yaml
index 4b84f1c..7069130 100644
--- a/config/rbac/kustomization.yaml
+++ b/config/rbac/kustomization.yaml
@@ -22,8 +22,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization
 
 resources:
-- user-global-kamelet-viewer-role.yaml
-- user-global-kamelet-viewer-role-binding.yaml
 - user-cluster-role.yaml
 - operator-role-events.yaml
 - operator-role-knative.yaml
diff --git a/pkg/install/kamelets.go b/pkg/install/kamelets.go
index 939c6a9..f1f7562 100644
--- a/pkg/install/kamelets.go
+++ b/pkg/install/kamelets.go
@@ -109,8 +109,8 @@ func KameletCatalog(ctx context.Context, c client.Client, 
namespace string) erro
 
 // KameletViewerRole installs the role that allows any user ro access kamelets 
in the global namespace
 func KameletViewerRole(ctx context.Context, c client.Client, namespace string) 
error {
-       if err := Resource(ctx, c, namespace, true, IdentityResourceCustomizer, 
"/rbac/user-global-kamelet-viewer-role.yaml"); err != nil {
+       if err := Resource(ctx, c, namespace, true, IdentityResourceCustomizer, 
"/viewer/user-global-kamelet-viewer-role.yaml"); err != nil {
                return err
        }
-       return Resource(ctx, c, namespace, true, IdentityResourceCustomizer, 
"/rbac/user-global-kamelet-viewer-role-binding.yaml")
+       return Resource(ctx, c, namespace, true, IdentityResourceCustomizer, 
"/viewer/user-global-kamelet-viewer-role-binding.yaml")
 }
diff --git a/pkg/resources/resources.go b/pkg/resources/resources.go
index 1186d7e..ddc09e8 100644
--- a/pkg/resources/resources.go
+++ b/pkg/resources/resources.go
@@ -394,20 +394,6 @@ var assets = func() http.FileSystem {
 
                        compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x53\xc1\x8e\xdb\x36\x10\xbd\xf3\x2b\x1e\xa4\x4b\x52\xac\xe5\xb6\xa7\x42\x3d\xb9\x9b\xdd\x56\x68\x60\x03\x2b\xa7\x41\x50\xf4\x40\x8b\x63\x69\xb0\x14\xa9\x0e\xa9\x55\xb6\x5f\x5f\x90\xb6\x37\x5e\x14\x3d\x04\x08\x6f\x24\x87\x6f\xde\x9b\xf7\x58\x62\xf5\xed\x96\x2a\xf1\x9e\x3b\x72\x81\x0c\xa2\x47\x1c\x08\x9b\x49\x77\x03\xa1\xf5\xc7\xb8\x68\x21\xdc\xfb\xd9\x19\x1d\xd9\x3b\xbc\xd9\xb4\xf7\x6f\x31\x3b\x43\x02\xef\x08\x5e\x
 [...]
                },
-               "/rbac/user-global-kamelet-viewer-role-binding.yaml": 
&vfsgen۰CompressedFileInfo{
-                       name:             
"user-global-kamelet-viewer-role-binding.yaml",
-                       modTime:          time.Time{},
-                       uncompressedSize: 1353,
-
-                       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\xdb\x6d\x4f\x85\x7b\x72\x36\xbb\xad\xd0\xc0\x06\x2c\xa7\x41\x8e\x63\x6a\x2c\x4d\x4d\x71\x54\x92\x5a\xc5\xfd\xf5\x05\xb5\x76\xbc\x41\x81\x16\x01\x56\x37\x81\xc3\xf7\x31\xef\xb1\xc0\xfc\xf5\x3e\x53\xe0\x83\x58\xf6\x91\x6b\x24\x45\x6a\x19\xeb\x9e\x6c\xcb\xa8\xf4\x98\x46\x0a\x8c\x47\x1d\x7c\x4d\x49\xd4\xe3\xcd\xba\x7a\x7c\x8b\xc1\xd7\x1c\xa0\x9e\xa1\x01\x9d\x06\x
 [...]
-               },
-               "/rbac/user-global-kamelet-viewer-role.yaml": 
&vfsgen۰CompressedFileInfo{
-                       name:             
"user-global-kamelet-viewer-role.yaml",
-                       modTime:          time.Time{},
-                       uncompressedSize: 1262,
-
-                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x53\x4d\x8f\xdb\x36\x14\xbc\xf3\x57\x0c\xac\x4b\x02\xac\xe5\xb6\xa7\xc2\x3d\xb9\x9b\xdd\x56\x68\x60\x03\x2b\xa7\x41\x8e\xcf\xd4\xb3\xf4\x60\x8a\x4f\x25\xa9\x55\xb6\xbf\xbe\xa0\x2c\x67\x37\xe8\x35\xbc\xf8\x43\xa3\x79\x33\x6f\x86\x05\xd6\x3f\xee\x98\x02\x1f\xc5\xb2\x8f\xdc\x20\x29\x52\xc7\xd8\x0d\x64\x3b\x46\xad\xe7\x34\x51\x60\x3c\xea\xe8\x1b\x4a\xa2\x1e\xef\x76\xf5\xe3\x7b\x8c\xbe\xe1\x00\xf5\x0c\x0d\xe8\x35\xb0\x
 [...]
-               },
                "/samples": &vfsgen۰DirInfo{
                        name:    "samples",
                        modTime: time.Time{},
@@ -525,6 +511,24 @@ var assets = func() http.FileSystem {
 
                        compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x44\x8e\x31\x4e\x04\x31\x0c\x45\xfb\x9c\xe2\x2b\xdb\x32\xd2\xd0\x5a\xa2\xa2\x41\xe2\x00\xd4\x66\xd7\x33\x44\x24\x71\xe4\x38\x12\x73\x7b\x94\x1d\xc1\xba\xfc\x7e\xf6\x7f\x17\x5c\xb9\x48\x5e\xbe\x09\x99\xeb\x3e\x78\x97\x97\x83\x4b\x0e\xe1\x82\x0f\x4b\x2e\x38\x74\x18\x4c\x87\x4b\xc7\x97\x98\x3c\x61\x53\x83\xfc\x70\x69\x59\x28\x2c\xd8\x4c\x0b\x05\x00\x18\x96\x08\xd1\x53\x11\xa3\xf9\x24\xde\xd3\xc6\xc6\x45\x5c\xac\x9f\x14\x
 [...]
                },
+               "/viewer": &vfsgen۰DirInfo{
+                       name:    "viewer",
+                       modTime: time.Time{},
+               },
+               "/viewer/user-global-kamelet-viewer-role-binding.yaml": 
&vfsgen۰CompressedFileInfo{
+                       name:             
"user-global-kamelet-viewer-role-binding.yaml",
+                       modTime:          time.Time{},
+                       uncompressedSize: 1353,
+
+                       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\xdb\x6d\x4f\x85\x7b\x72\x36\xbb\xad\xd0\xc0\x06\x2c\xa7\x41\x8e\x63\x6a\x2c\x4d\x4d\x71\x54\x92\x5a\xc5\xfd\xf5\x05\xb5\x76\xbc\x41\x81\x16\x01\x56\x37\x81\xc3\xf7\x31\xef\xb1\xc0\xfc\xf5\x3e\x53\xe0\x83\x58\xf6\x91\x6b\x24\x45\x6a\x19\xeb\x9e\x6c\xcb\xa8\xf4\x98\x46\x0a\x8c\x47\x1d\x7c\x4d\x49\xd4\xe3\xcd\xba\x7a\x7c\x8b\xc1\xd7\x1c\xa0\x9e\xa1\x01\x9d\x06\x
 [...]
+               },
+               "/viewer/user-global-kamelet-viewer-role.yaml": 
&vfsgen۰CompressedFileInfo{
+                       name:             
"user-global-kamelet-viewer-role.yaml",
+                       modTime:          time.Time{},
+                       uncompressedSize: 1262,
+
+                       compressedContent: 
[]byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xac\x53\x4d\x8f\xdb\x36\x14\xbc\xf3\x57\x0c\xac\x4b\x02\xac\xe5\xb6\xa7\xc2\x3d\xb9\x9b\xdd\x56\x68\x60\x03\x2b\xa7\x41\x8e\xcf\xd4\xb3\xf4\x60\x8a\x4f\x25\xa9\x55\xb6\xbf\xbe\xa0\x2c\x67\x37\xe8\x35\xbc\xf8\x43\xa3\x79\x33\x6f\x86\x05\xd6\x3f\xee\x98\x02\x1f\xc5\xb2\x8f\xdc\x20\x29\x52\xc7\xd8\x0d\x64\x3b\x46\xad\xe7\x34\x51\x60\x3c\xea\xe8\x1b\x4a\xa2\x1e\xef\x76\xf5\xe3\x7b\x8c\xbe\xe1\x00\xf5\x0c\x0d\xe8\x35\xb0\x
 [...]
+               },
                "/camel-catalog-1.9.0.yaml": &vfsgen۰CompressedFileInfo{
                        name:             "camel-catalog-1.9.0.yaml",
                        modTime:          time.Time{},
@@ -551,6 +555,7 @@ var assets = func() http.FileSystem {
                fs["/samples"].(os.FileInfo),
                fs["/templates"].(os.FileInfo),
                fs["/traits.yaml"].(os.FileInfo),
+               fs["/viewer"].(os.FileInfo),
        }
        fs["/addons"].(*vfsgen۰DirInfo).entries = []os.FileInfo{
                fs["/addons/master"].(os.FileInfo),
@@ -612,8 +617,6 @@ var assets = func() http.FileSystem {
                fs["/rbac/patch-role-to-clusterrole.yaml"].(os.FileInfo),
                
fs["/rbac/patch-rolebinding-to-clusterrolebinding.yaml"].(os.FileInfo),
                fs["/rbac/user-cluster-role.yaml"].(os.FileInfo),
-               
fs["/rbac/user-global-kamelet-viewer-role-binding.yaml"].(os.FileInfo),
-               fs["/rbac/user-global-kamelet-viewer-role.yaml"].(os.FileInfo),
        }
        fs["/rbac/openshift"].(*vfsgen۰DirInfo).entries = []os.FileInfo{
                
fs["/rbac/openshift/operator-cluster-role-console-binding-openshift.yaml"].(os.FileInfo),
@@ -643,6 +646,10 @@ var assets = func() http.FileSystem {
                fs["/templates/xml.tmpl"].(os.FileInfo),
                fs["/templates/yaml.tmpl"].(os.FileInfo),
        }
+       fs["/viewer"].(*vfsgen۰DirInfo).entries = []os.FileInfo{
+               
fs["/viewer/user-global-kamelet-viewer-role-binding.yaml"].(os.FileInfo),
+               
fs["/viewer/user-global-kamelet-viewer-role.yaml"].(os.FileInfo),
+       }
 
        return fs
 }()
diff --git a/config/rbac/user-global-kamelet-viewer-role-binding.yaml 
b/resources/viewer/user-global-kamelet-viewer-role-binding.yaml
similarity index 100%
rename from config/rbac/user-global-kamelet-viewer-role-binding.yaml
rename to resources/viewer/user-global-kamelet-viewer-role-binding.yaml
diff --git a/config/rbac/user-global-kamelet-viewer-role.yaml 
b/resources/viewer/user-global-kamelet-viewer-role.yaml
similarity index 100%
rename from config/rbac/user-global-kamelet-viewer-role.yaml
rename to resources/viewer/user-global-kamelet-viewer-role.yaml

Reply via email to