Skip to content

Commit

Permalink
Drop support for AdmissionReview v1beta1
Browse files Browse the repository at this point in the history
  • Loading branch information
ymmt2005 committed Dec 6, 2021
1 parent a81511c commit 663b0ea
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.7.0
labels:
app.kubernetes.io/name: accurate
name: subnamespaces.accurate.cybozu.com
Expand Down
3 changes: 0 additions & 3 deletions charts/accurate/templates/generated/generated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ metadata:
webhooks:
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: '{{ template "accurate.fullname" . }}-webhook-service'
Expand Down Expand Up @@ -289,7 +288,6 @@ metadata:
webhooks:
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: '{{ template "accurate.fullname" . }}-webhook-service'
Expand All @@ -311,7 +309,6 @@ webhooks:
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: '{{ template "accurate.fullname" . }}-webhook-service'
Expand Down
2 changes: 1 addition & 1 deletion config/crd/bases/accurate.cybozu.com_subnamespaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.6.1
controller-gen.kubebuilder.io/version: v0.7.0
creationTimestamp: null
name: subnamespaces.accurate.cybozu.com
spec:
Expand Down
3 changes: 0 additions & 3 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ metadata:
webhooks:
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: webhook-service
Expand Down Expand Up @@ -37,7 +36,6 @@ metadata:
webhooks:
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: webhook-service
Expand All @@ -59,7 +57,6 @@ webhooks:
sideEffects: None
- admissionReviewVersions:
- v1
- v1beta1
clientConfig:
service:
name: webhook-service
Expand Down
2 changes: 1 addition & 1 deletion hooks/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)

//+kubebuilder:webhook:path=/validate-v1-namespace,mutating=false,failurePolicy=fail,sideEffects=None,groups="",resources=namespaces,verbs=create;update;delete,versions=v1,name=vnamespace.kb.io,admissionReviewVersions={v1,v1beta1}
//+kubebuilder:webhook:path=/validate-v1-namespace,mutating=false,failurePolicy=fail,sideEffects=None,groups="",resources=namespaces,verbs=create;update;delete,versions=v1,name=vnamespace.kb.io,admissionReviewVersions={v1}

type namespaceValidator struct {
client.Client
Expand Down
4 changes: 2 additions & 2 deletions hooks/subnamespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
)

//+kubebuilder:webhook:path=/mutate-accurate-cybozu-com-v1-subnamespace,mutating=true,failurePolicy=fail,sideEffects=None,groups=accurate.cybozu.com,resources=subnamespaces,verbs=create;update,versions=v1,name=msubnamespace.kb.io,admissionReviewVersions={v1,v1beta1}
//+kubebuilder:webhook:path=/mutate-accurate-cybozu-com-v1-subnamespace,mutating=true,failurePolicy=fail,sideEffects=None,groups=accurate.cybozu.com,resources=subnamespaces,verbs=create;update,versions=v1,name=msubnamespace.kb.io,admissionReviewVersions={v1}

type subNamespaceMutator struct {
dec *admission.Decoder
Expand All @@ -49,7 +49,7 @@ func (m *subNamespaceMutator) Handle(ctx context.Context, req admission.Request)
return admission.PatchResponseFromRaw(req.Object.Raw, data)
}

//+kubebuilder:webhook:path=/validate-accurate-cybozu-com-v1-subnamespace,mutating=false,failurePolicy=fail,sideEffects=None,groups=accurate.cybozu.com,resources=subnamespaces,verbs=create;update,versions=v1,name=vsubnamespace.kb.io,admissionReviewVersions={v1,v1beta1}
//+kubebuilder:webhook:path=/validate-accurate-cybozu-com-v1-subnamespace,mutating=false,failurePolicy=fail,sideEffects=None,groups=accurate.cybozu.com,resources=subnamespaces,verbs=create;update,versions=v1,name=vsubnamespace.kb.io,admissionReviewVersions={v1}

type subNamespaceValidator struct {
client.Client
Expand Down

0 comments on commit 663b0ea

Please sign in to comment.