You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by as...@apache.org on 2020/10/02 12:39:03 UTC
[camel-k] 01/02: chore: Update rbac authorization k8s from v1beta1
to v1
This is an automated email from the ASF dual-hosted git repository.
astefanutti pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit c93841b17efa6ee3a81ed53d146239a0430eb74a
Author: Christoph Deppisch <cd...@redhat.com>
AuthorDate: Thu Oct 1 20:38:53 2020 +0200
chore: Update rbac authorization k8s from v1beta1 to v1
---
deploy/addons/master/master-role-binding.tmpl | 2 +-
deploy/addons/master/master-role.tmpl | 2 +-
deploy/builder-role-binding.yaml | 2 +-
deploy/builder-role-kubernetes.yaml | 2 +-
deploy/builder-role-openshift.yaml | 2 +-
deploy/operator-role-binding-events.yaml | 2 +-
deploy/operator-role-binding-knative.yaml | 2 +-
deploy/operator-role-binding-servicemonitors.yaml | 2 +-
deploy/operator-role-binding.yaml | 2 +-
deploy/operator-role-events.yaml | 2 +-
deploy/operator-role-knative.yaml | 2 +-
deploy/operator-role-kubernetes.yaml | 2 +-
deploy/operator-role-olm-cluster.yaml | 2 +-
deploy/operator-role-olm.yaml | 2 +-
deploy/operator-role-openshift.yaml | 2 +-
deploy/operator-role-servicemonitors.yaml | 2 +-
.../attachments/tekton/camel-k-pipeline-permissions.yaml | 4 ++--
helm/camel-k/templates/operator-role-binding.yaml | 2 +-
helm/camel-k/templates/operator-role.yaml | 2 +-
pkg/cmd/uninstall.go | 4 ++--
pkg/install/operator.go | 12 ++++++------
21 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/deploy/addons/master/master-role-binding.tmpl b/deploy/addons/master/master-role-binding.tmpl
index b6d0bea..41ca199 100644
--- a/deploy/addons/master/master-role-binding.tmpl
+++ b/deploy/addons/master/master-role-binding.tmpl
@@ -1,5 +1,5 @@
kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Name }}
namespace: {{ .Namespace }}
diff --git a/deploy/addons/master/master-role.tmpl b/deploy/addons/master/master-role.tmpl
index efe939e..ac4ff90 100644
--- a/deploy/addons/master/master-role.tmpl
+++ b/deploy/addons/master/master-role.tmpl
@@ -1,5 +1,5 @@
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Name }}
namespace: {{ .Namespace }}
diff --git a/deploy/builder-role-binding.yaml b/deploy/builder-role-binding.yaml
index 1c860b4..4487f6f 100644
--- a/deploy/builder-role-binding.yaml
+++ b/deploy/builder-role-binding.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-builder
labels:
diff --git a/deploy/builder-role-kubernetes.yaml b/deploy/builder-role-kubernetes.yaml
index 7a551ca..172eca7 100644
--- a/deploy/builder-role-kubernetes.yaml
+++ b/deploy/builder-role-kubernetes.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-builder
labels:
diff --git a/deploy/builder-role-openshift.yaml b/deploy/builder-role-openshift.yaml
index 7271d04..d3c4f4f 100644
--- a/deploy/builder-role-openshift.yaml
+++ b/deploy/builder-role-openshift.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-builder
labels:
diff --git a/deploy/operator-role-binding-events.yaml b/deploy/operator-role-binding-events.yaml
index dbbb3a7..7b1d41d 100644
--- a/deploy/operator-role-binding-events.yaml
+++ b/deploy/operator-role-binding-events.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator-events
labels:
diff --git a/deploy/operator-role-binding-knative.yaml b/deploy/operator-role-binding-knative.yaml
index 3ab51f8..034baef 100644
--- a/deploy/operator-role-binding-knative.yaml
+++ b/deploy/operator-role-binding-knative.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator-knative
labels:
diff --git a/deploy/operator-role-binding-servicemonitors.yaml b/deploy/operator-role-binding-servicemonitors.yaml
index cb49320..120e83e 100644
--- a/deploy/operator-role-binding-servicemonitors.yaml
+++ b/deploy/operator-role-binding-servicemonitors.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator-servicemonitors
labels:
diff --git a/deploy/operator-role-binding.yaml b/deploy/operator-role-binding.yaml
index f6a8ffa..afbdf27 100644
--- a/deploy/operator-role-binding.yaml
+++ b/deploy/operator-role-binding.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator
labels:
diff --git a/deploy/operator-role-events.yaml b/deploy/operator-role-events.yaml
index aa09f62..d109b73 100644
--- a/deploy/operator-role-events.yaml
+++ b/deploy/operator-role-events.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator-events
labels:
diff --git a/deploy/operator-role-knative.yaml b/deploy/operator-role-knative.yaml
index 36c6a44..c59021d 100644
--- a/deploy/operator-role-knative.yaml
+++ b/deploy/operator-role-knative.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator-knative
labels:
diff --git a/deploy/operator-role-kubernetes.yaml b/deploy/operator-role-kubernetes.yaml
index 4e9db4c..26c4c48 100644
--- a/deploy/operator-role-kubernetes.yaml
+++ b/deploy/operator-role-kubernetes.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator
labels:
diff --git a/deploy/operator-role-olm-cluster.yaml b/deploy/operator-role-olm-cluster.yaml
index 09cf5f8..9520a6a 100644
--- a/deploy/operator-role-olm-cluster.yaml
+++ b/deploy/operator-role-olm-cluster.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: ClusterRole
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator
labels:
diff --git a/deploy/operator-role-olm.yaml b/deploy/operator-role-olm.yaml
index d5ac5f4..fa6c6f3 100644
--- a/deploy/operator-role-olm.yaml
+++ b/deploy/operator-role-olm.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator
labels:
diff --git a/deploy/operator-role-openshift.yaml b/deploy/operator-role-openshift.yaml
index d939b96..31696bc 100644
--- a/deploy/operator-role-openshift.yaml
+++ b/deploy/operator-role-openshift.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator
labels:
diff --git a/deploy/operator-role-servicemonitors.yaml b/deploy/operator-role-servicemonitors.yaml
index aae49c0..98b2061 100644
--- a/deploy/operator-role-servicemonitors.yaml
+++ b/deploy/operator-role-servicemonitors.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator-servicemonitors
labels:
diff --git a/docs/modules/ROOT/assets/attachments/tekton/camel-k-pipeline-permissions.yaml b/docs/modules/ROOT/assets/attachments/tekton/camel-k-pipeline-permissions.yaml
index fff7f1e..3b05991 100644
--- a/docs/modules/ROOT/assets/attachments/tekton/camel-k-pipeline-permissions.yaml
+++ b/docs/modules/ROOT/assets/attachments/tekton/camel-k-pipeline-permissions.yaml
@@ -22,7 +22,7 @@ metadata:
name: camel-k-pipeline
---
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-pipeline
rules:
@@ -166,7 +166,7 @@ rules:
- create
---
kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-pipeline
subjects:
diff --git a/helm/camel-k/templates/operator-role-binding.yaml b/helm/camel-k/templates/operator-role-binding.yaml
index df55af3..0c785ef 100644
--- a/helm/camel-k/templates/operator-role-binding.yaml
+++ b/helm/camel-k/templates/operator-role-binding.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: RoleBinding
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator
labels:
diff --git a/helm/camel-k/templates/operator-role.yaml b/helm/camel-k/templates/operator-role.yaml
index d4f7ef4..c54ead2 100644
--- a/helm/camel-k/templates/operator-role.yaml
+++ b/helm/camel-k/templates/operator-role.yaml
@@ -16,7 +16,7 @@
# ---------------------------------------------------------------------------
kind: Role
-apiVersion: rbac.authorization.k8s.io/v1beta1
+apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: camel-k-operator
labels:
diff --git a/pkg/cmd/uninstall.go b/pkg/cmd/uninstall.go
index c6aeb6a..2cf796f 100644
--- a/pkg/cmd/uninstall.go
+++ b/pkg/cmd/uninstall.go
@@ -47,7 +47,7 @@ func newCmdUninstall(rootCmdOptions *RootCmdOptions) (*cobra.Command, *uninstall
}
cmd.Flags().Bool("skip-operator", false, "Do not uninstall the Camel K Operator in the current namespace")
- cmd.Flags().Bool("skip-crd", true, "Do not uninstall the Camel-k Custom Resource Definitions (CRD)")
+ cmd.Flags().Bool("skip-crd", true, "Do not uninstall the Camel K Custom Resource Definitions (CRD)")
cmd.Flags().Bool("skip-role-bindings", false, "Do not uninstall the Camel K Role Bindings in the current namespace")
cmd.Flags().Bool("skip-roles", false, "Do not uninstall the Camel K Roles in the current namespace")
cmd.Flags().Bool("skip-cluster-roles", true, "Do not uninstall the Camel K Cluster Roles")
@@ -60,7 +60,7 @@ func newCmdUninstall(rootCmdOptions *RootCmdOptions) (*cobra.Command, *uninstall
cmd.Flags().String("olm-package", olm.DefaultPackage, "Name of the Camel K package in the OLM source or marketplace")
cmd.Flags().String("olm-global-namespace", olm.DefaultGlobalNamespace, "A namespace containing an OperatorGroup that defines "+
"global scope for the operator (used in combination with the --global flag)")
- cmd.Flags().Bool("all", false, "Do uninstall all Camel-K resources")
+ cmd.Flags().Bool("all", false, "Do uninstall all Camel K resources")
return &cmd, &options
}
diff --git a/pkg/install/operator.go b/pkg/install/operator.go
index 37215fe..dee26d3 100644
--- a/pkg/install/operator.go
+++ b/pkg/install/operator.go
@@ -25,7 +25,7 @@ import (
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
- "k8s.io/api/rbac/v1beta1"
+ rbacv1 "k8s.io/api/rbac/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
@@ -81,9 +81,9 @@ func OperatorOrCollect(ctx context.Context, c client.Client, cfg OperatorConfigu
}
// Turn Role & RoleBinding into their equivalent cluster types
- if r, ok := o.(*v1beta1.Role); ok {
+ if r, ok := o.(*rbacv1.Role); ok {
if strings.HasPrefix(r.Name, "camel-k-operator") {
- o = &v1beta1.ClusterRole{
+ o = &rbacv1.ClusterRole{
ObjectMeta: metav1.ObjectMeta{
Namespace: cfg.Namespace,
Name: r.Name,
@@ -93,17 +93,17 @@ func OperatorOrCollect(ctx context.Context, c client.Client, cfg OperatorConfigu
}
}
- if rb, ok := o.(*v1beta1.RoleBinding); ok {
+ if rb, ok := o.(*rbacv1.RoleBinding); ok {
if strings.HasPrefix(rb.Name, "camel-k-operator") {
rb.Subjects[0].Namespace = cfg.Namespace
- o = &v1beta1.ClusterRoleBinding{
+ o = &rbacv1.ClusterRoleBinding{
ObjectMeta: metav1.ObjectMeta{
Namespace: cfg.Namespace,
Name: rb.Name,
},
Subjects: rb.Subjects,
- RoleRef: v1beta1.RoleRef{
+ RoleRef: rbacv1.RoleRef{
APIGroup: rb.RoleRef.APIGroup,
Kind: "ClusterRole",
Name: rb.RoleRef.Name,