Skip to content

Commit 0ebf74e

Browse files
committed
chore(k8s): k8s deprecated api migration
1 parent f362284 commit 0ebf74e

8 files changed

Lines changed: 7 additions & 25 deletions

File tree

charts/controller/templates/_helpers.tpl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
{{/*
2-
Set apiVersion based on .Capabilities.APIVersions
3-
*/}}
4-
{{- define "rbacAPIVersion" -}}
5-
{{- if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1beta1" -}}
6-
rbac.authorization.k8s.io/v1beta1
7-
{{- else if .Capabilities.APIVersions.Has "rbac.authorization.k8s.io/v1alpha1" -}}
8-
rbac.authorization.k8s.io/v1alpha1
9-
{{- else -}}
10-
rbac.authorization.k8s.io/v1
11-
{{- end -}}
12-
{{- end -}}
13-
14-
151
{{/* Generate controller deployment envs */}}
162
{{- define "controller.envs" -}}
173
{{ $redisNodeCount := .Values.redis.replicas | int }}

charts/controller/templates/controller-clusterrole.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{- if (.Values.global.use_rbac) -}}
2-
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
32
kind: ClusterRole
4-
apiVersion: {{ template "rbacAPIVersion" . }}
3+
apiVersion: rbac.authorization.k8s.io/v1
54
metadata:
65
name: drycc:drycc-controller
76
labels:
@@ -75,4 +74,3 @@ rules:
7574
resources: ["servicebindings"]
7675
verbs: ["get", "list", "watch", "create", "delete", "patch", "update"]
7776
{{- end -}}
78-
{{- end -}}

charts/controller/templates/controller-clusterrolebinding.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{{- if (.Values.global.use_rbac) -}}
2-
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
32
kind: ClusterRoleBinding
4-
apiVersion: {{ template "rbacAPIVersion" . }}
3+
apiVersion: rbac.authorization.k8s.io/v1
54
metadata:
65
name: drycc:drycc-controller
76
labels:
@@ -16,4 +15,3 @@ subjects:
1615
name: drycc-controller
1716
namespace: {{ .Release.Namespace }}
1817
{{- end -}}
19-
{{- end -}}

charts/controller/templates/controller-cronjob-daily.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: batch/v1beta1
1+
apiVersion: batch/v1
22
kind: CronJob
33
metadata:
44
name: drycc-controller-cronjob-daily

charts/controller/templates/controller-cronjob-hourly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: batch/v1beta1
1+
apiVersion: batch/v1
22
kind: CronJob
33
metadata:
44
name: drycc-controller-cronjob-daily

charts/controller/templates/controller-ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: networking.k8s.io/v1beta1
1+
apiVersion: networking.k8s.io/v1
22
kind: Ingress
33
metadata:
44
name: "controller-api-server"

rootfs/scheduler/resources/ingress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def manifest(self, api_version, ingress, ingress_class, namespace, **kwargs):
9292

9393
class Ingress(Resource):
9494

95-
api_version = 'networking.k8s.io/v1beta1'
95+
api_version = 'networking.k8s.io/v1'
9696
api_prefix = 'apis'
9797
short_name = 'ingress'
9898

rootfs/scheduler/tests/test_ingress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_get_ingress(self):
3636
data = response.json()
3737

3838
self.assertEqual(response.status_code, 200, data)
39-
self.assertEqual(data['apiVersion'], 'networking.k8s.io/v1beta1')
39+
self.assertEqual(data['apiVersion'], 'networking.k8s.io/v1')
4040
self.assertEqual(data['kind'], 'Ingress')
4141

4242
def test_delete_failure(self):

0 commit comments

Comments
 (0)