Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version of clusterroles, add resoureName for leases #738

Merged
merged 1 commit into from
Aug 5, 2022
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: machine-controller-manager-control
Expand Down
3 changes: 2 additions & 1 deletion kubernetes/deployment/in-tree/control-cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: machine-controller-manager-control
Expand Down Expand Up @@ -53,6 +53,7 @@ rules:
- leases
resourceNames:
- machine-controller-manager
- machine-controller
verbs:
- get
- watch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: machine-controller-manager-target
Expand Down
2 changes: 1 addition & 1 deletion kubernetes/deployment/in-tree/target-cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: machine-controller-manager-target
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: machine-controller-manager-control
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: machine-controller-manager-control
Expand Down Expand Up @@ -58,6 +58,7 @@ rules:
- leases
resourceNames:
- machine-controller-manager
- machine-controller
verbs:
- get
- watch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: machine-controller-manager-target
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: machine-controller-manager-target
Expand Down
14 changes: 7 additions & 7 deletions pkg/test/integration/common/helpers/handling_files.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
v1alpha1 "github.com/gardener/machine-controller-manager/pkg/apis/machine/v1alpha1"
mcmscheme "github.com/gardener/machine-controller-manager/pkg/client/clientset/versioned/scheme"
v1 "k8s.io/api/apps/v1"
rbacv1bata1 "k8s.io/api/rbac/v1beta1"
rbacv1 "k8s.io/api/rbac/v1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
apiextensionsscheme "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset/scheme"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -150,20 +150,20 @@ func (c *Cluster) applyFile(filePath string, namespace string) error {
return err
}
case "ClusterRoleBinding":
resource := obj.(*rbacv1bata1.ClusterRoleBinding)
resource := obj.(*rbacv1.ClusterRoleBinding)
for i := range resource.Subjects {
resource.Subjects[i].Namespace = namespace
}

if _, err := c.Clientset.RbacV1beta1().
if _, err := c.Clientset.RbacV1().
ClusterRoleBindings().
Create(ctx, resource, metav1.CreateOptions{}); err != nil {
return err
}
case "ClusterRole":
resource := obj.(*rbacv1bata1.ClusterRole)
resource := obj.(*rbacv1.ClusterRole)

if _, err := c.Clientset.RbacV1beta1().
if _, err := c.Clientset.RbacV1().
ClusterRoles().
Create(ctx, resource, metav1.CreateOptions{}); err != nil {
return err
Expand Down Expand Up @@ -306,7 +306,7 @@ func (c *Cluster) deleteResource(filePath string, namespace string) error {
return err
}
case "ClusterRoleBinding":
resource := obj.(*rbacv1bata1.ClusterRoleBinding)
resource := obj.(*rbacv1.ClusterRoleBinding)
for i := range resource.Subjects {
resource.Subjects[i].Namespace = namespace
}
Expand All @@ -320,7 +320,7 @@ func (c *Cluster) deleteResource(filePath string, namespace string) error {
return err
}
case "ClusterRole":
resource := obj.(*rbacv1bata1.ClusterRole)
resource := obj.(*rbacv1.ClusterRole)
if err := c.Clientset.RbacV1beta1().
ClusterRoles().
Delete(
Expand Down