Use non-deprecated API versions in CRDs and Webhooks (#733)
Resolves #144
This commit is contained in:
parent
91c22ef964
commit
167c5b4dc9
|
|
@ -34,7 +34,7 @@ func (r *Runner) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
||||||
Complete()
|
Complete()
|
||||||
}
|
}
|
||||||
|
|
||||||
// +kubebuilder:webhook:path=/mutate-actions-summerwind-dev-v1alpha1-runner,verbs=create;update,mutating=true,failurePolicy=fail,groups=actions.summerwind.dev,resources=runners,versions=v1alpha1,name=mutate.runner.actions.summerwind.dev,sideEffects=None,webhookVersions=v1beta1
|
// +kubebuilder:webhook:path=/mutate-actions-summerwind-dev-v1alpha1-runner,verbs=create;update,mutating=true,failurePolicy=fail,groups=actions.summerwind.dev,resources=runners,versions=v1alpha1,name=mutate.runner.actions.summerwind.dev,sideEffects=None,admissionReviewVersions=v1beta1
|
||||||
|
|
||||||
var _ webhook.Defaulter = &Runner{}
|
var _ webhook.Defaulter = &Runner{}
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ func (r *Runner) Default() {
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
// +kubebuilder:webhook:path=/validate-actions-summerwind-dev-v1alpha1-runner,verbs=create;update,mutating=false,failurePolicy=fail,groups=actions.summerwind.dev,resources=runners,versions=v1alpha1,name=validate.runner.actions.summerwind.dev,sideEffects=None,webhookVersions=v1beta1
|
// +kubebuilder:webhook:path=/validate-actions-summerwind-dev-v1alpha1-runner,verbs=create;update,mutating=false,failurePolicy=fail,groups=actions.summerwind.dev,resources=runners,versions=v1alpha1,name=validate.runner.actions.summerwind.dev,sideEffects=None,admissionReviewVersions=v1beta1
|
||||||
|
|
||||||
var _ webhook.Validator = &Runner{}
|
var _ webhook.Validator = &Runner{}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ func (r *RunnerDeployment) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
||||||
Complete()
|
Complete()
|
||||||
}
|
}
|
||||||
|
|
||||||
// +kubebuilder:webhook:path=/mutate-actions-summerwind-dev-v1alpha1-runnerdeployment,verbs=create;update,mutating=true,failurePolicy=fail,groups=actions.summerwind.dev,resources=runnerdeployments,versions=v1alpha1,name=mutate.runnerdeployment.actions.summerwind.dev,webhookVersions=v1beta1
|
// +kubebuilder:webhook:path=/mutate-actions-summerwind-dev-v1alpha1-runnerdeployment,verbs=create;update,mutating=true,failurePolicy=fail,groups=actions.summerwind.dev,resources=runnerdeployments,versions=v1alpha1,name=mutate.runnerdeployment.actions.summerwind.dev,sideEffects=None,admissionReviewVersions=v1beta1
|
||||||
|
|
||||||
var _ webhook.Defaulter = &RunnerDeployment{}
|
var _ webhook.Defaulter = &RunnerDeployment{}
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ func (r *RunnerDeployment) Default() {
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
// +kubebuilder:webhook:path=/validate-actions-summerwind-dev-v1alpha1-runnerdeployment,verbs=create;update,mutating=false,failurePolicy=fail,groups=actions.summerwind.dev,resources=runnerdeployments,versions=v1alpha1,name=validate.runnerdeployment.actions.summerwind.dev,webhookVersions=v1beta1
|
// +kubebuilder:webhook:path=/validate-actions-summerwind-dev-v1alpha1-runnerdeployment,verbs=create;update,mutating=false,failurePolicy=fail,groups=actions.summerwind.dev,resources=runnerdeployments,versions=v1alpha1,name=validate.runnerdeployment.actions.summerwind.dev,sideEffects=None,admissionReviewVersions=v1beta1
|
||||||
|
|
||||||
var _ webhook.Validator = &RunnerDeployment{}
|
var _ webhook.Validator = &RunnerDeployment{}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ func (r *RunnerReplicaSet) SetupWebhookWithManager(mgr ctrl.Manager) error {
|
||||||
Complete()
|
Complete()
|
||||||
}
|
}
|
||||||
|
|
||||||
// +kubebuilder:webhook:path=/mutate-actions-summerwind-dev-v1alpha1-runnerreplicaset,verbs=create;update,mutating=true,failurePolicy=fail,groups=actions.summerwind.dev,resources=runnerreplicasets,versions=v1alpha1,name=mutate.runnerreplicaset.actions.summerwind.dev,sideEffects=None,webhookVersions=v1beta1
|
// +kubebuilder:webhook:path=/mutate-actions-summerwind-dev-v1alpha1-runnerreplicaset,verbs=create;update,mutating=true,failurePolicy=fail,groups=actions.summerwind.dev,resources=runnerreplicasets,versions=v1alpha1,name=mutate.runnerreplicaset.actions.summerwind.dev,sideEffects=None,admissionReviewVersions=v1beta1
|
||||||
|
|
||||||
var _ webhook.Defaulter = &RunnerReplicaSet{}
|
var _ webhook.Defaulter = &RunnerReplicaSet{}
|
||||||
|
|
||||||
|
|
@ -43,7 +43,7 @@ func (r *RunnerReplicaSet) Default() {
|
||||||
// Nothing to do.
|
// Nothing to do.
|
||||||
}
|
}
|
||||||
|
|
||||||
// +kubebuilder:webhook:path=/validate-actions-summerwind-dev-v1alpha1-runnerreplicaset,verbs=create;update,mutating=false,failurePolicy=fail,groups=actions.summerwind.dev,resources=runnerreplicasets,versions=v1alpha1,name=validate.runnerreplicaset.actions.summerwind.dev,sideEffects=None,webhookVersions=v1beta1
|
// +kubebuilder:webhook:path=/validate-actions-summerwind-dev-v1alpha1-runnerreplicaset,verbs=create;update,mutating=false,failurePolicy=fail,groups=actions.summerwind.dev,resources=runnerreplicasets,versions=v1alpha1,name=validate.runnerreplicaset.actions.summerwind.dev,sideEffects=None,admissionReviewVersions=v1beta1
|
||||||
|
|
||||||
var _ webhook.Validator = &RunnerReplicaSet{}
|
var _ webhook.Validator = &RunnerReplicaSet{}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
|
|
||||||
---
|
---
|
||||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: MutatingWebhookConfiguration
|
kind: MutatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
|
|
@ -83,7 +83,7 @@ webhooks:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
"actions-runner-controller/inject-registration-token": "true"
|
"actions-runner-controller/inject-registration-token": "true"
|
||||||
---
|
---
|
||||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# The following patch adds a directive for certmanager to inject CA into the CRD
|
# The following patch adds a directive for certmanager to inject CA into the CRD
|
||||||
# CRD conversion requires k8s 1.13 or later.
|
# CRD conversion requires k8s 1.13 or later.
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,18 @@
|
||||||
# The following patch enables conversion webhook for CRD
|
# The following patch enables conversion webhook for CRD
|
||||||
# CRD conversion requires k8s 1.13 or later.
|
# CRD conversion requires k8s 1.13 or later.
|
||||||
apiVersion: apiextensions.k8s.io/v1beta1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
name: runners.actions.summerwind.dev
|
name: runners.actions.summerwind.dev
|
||||||
spec:
|
spec:
|
||||||
conversion:
|
conversion:
|
||||||
strategy: Webhook
|
strategy: Webhook
|
||||||
webhookClientConfig:
|
webhook:
|
||||||
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
|
clientConfig:
|
||||||
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
|
# this is "\n" used as a placeholder, otherwise it will be rejected by the apiserver for being blank,
|
||||||
caBundle: Cg==
|
# but we're going to set it later using the cert-manager (or potentially a patch if not using cert-manager)
|
||||||
service:
|
caBundle: Cg==
|
||||||
namespace: system
|
service:
|
||||||
name: webhook-service
|
namespace: system
|
||||||
path: /convert
|
name: webhook-service
|
||||||
|
path: /convert
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
# This patch add annotation to admission webhook config and
|
# This patch add annotation to admission webhook config and
|
||||||
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize.
|
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize.
|
||||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: MutatingWebhookConfiguration
|
kind: MutatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
name: mutating-webhook-configuration
|
name: mutating-webhook-configuration
|
||||||
annotations:
|
annotations:
|
||||||
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
|
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
|
||||||
---
|
---
|
||||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
kind: ValidatingWebhookConfiguration
|
kind: ValidatingWebhookConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
name: validating-webhook-configuration
|
name: validating-webhook-configuration
|
||||||
|
|
|
||||||
|
|
@ -1,130 +0,0 @@
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
|
||||||
kind: MutatingWebhookConfiguration
|
|
||||||
metadata:
|
|
||||||
creationTimestamp: null
|
|
||||||
name: mutating-webhook-configuration
|
|
||||||
webhooks:
|
|
||||||
- admissionReviewVersions: null
|
|
||||||
clientConfig:
|
|
||||||
service:
|
|
||||||
name: webhook-service
|
|
||||||
namespace: system
|
|
||||||
path: /mutate-actions-summerwind-dev-v1alpha1-runner
|
|
||||||
failurePolicy: Fail
|
|
||||||
name: mutate.runner.actions.summerwind.dev
|
|
||||||
rules:
|
|
||||||
- apiGroups:
|
|
||||||
- actions.summerwind.dev
|
|
||||||
apiVersions:
|
|
||||||
- v1alpha1
|
|
||||||
operations:
|
|
||||||
- CREATE
|
|
||||||
- UPDATE
|
|
||||||
resources:
|
|
||||||
- runners
|
|
||||||
sideEffects: None
|
|
||||||
- admissionReviewVersions: null
|
|
||||||
clientConfig:
|
|
||||||
service:
|
|
||||||
name: webhook-service
|
|
||||||
namespace: system
|
|
||||||
path: /mutate-actions-summerwind-dev-v1alpha1-runnerdeployment
|
|
||||||
failurePolicy: Fail
|
|
||||||
name: mutate.runnerdeployment.actions.summerwind.dev
|
|
||||||
rules:
|
|
||||||
- apiGroups:
|
|
||||||
- actions.summerwind.dev
|
|
||||||
apiVersions:
|
|
||||||
- v1alpha1
|
|
||||||
operations:
|
|
||||||
- CREATE
|
|
||||||
- UPDATE
|
|
||||||
resources:
|
|
||||||
- runnerdeployments
|
|
||||||
sideEffects: null
|
|
||||||
- admissionReviewVersions: null
|
|
||||||
clientConfig:
|
|
||||||
service:
|
|
||||||
name: webhook-service
|
|
||||||
namespace: system
|
|
||||||
path: /mutate-actions-summerwind-dev-v1alpha1-runnerreplicaset
|
|
||||||
failurePolicy: Fail
|
|
||||||
name: mutate.runnerreplicaset.actions.summerwind.dev
|
|
||||||
rules:
|
|
||||||
- apiGroups:
|
|
||||||
- actions.summerwind.dev
|
|
||||||
apiVersions:
|
|
||||||
- v1alpha1
|
|
||||||
operations:
|
|
||||||
- CREATE
|
|
||||||
- UPDATE
|
|
||||||
resources:
|
|
||||||
- runnerreplicasets
|
|
||||||
sideEffects: None
|
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: admissionregistration.k8s.io/v1beta1
|
|
||||||
kind: ValidatingWebhookConfiguration
|
|
||||||
metadata:
|
|
||||||
creationTimestamp: null
|
|
||||||
name: validating-webhook-configuration
|
|
||||||
webhooks:
|
|
||||||
- admissionReviewVersions: null
|
|
||||||
clientConfig:
|
|
||||||
service:
|
|
||||||
name: webhook-service
|
|
||||||
namespace: system
|
|
||||||
path: /validate-actions-summerwind-dev-v1alpha1-runner
|
|
||||||
failurePolicy: Fail
|
|
||||||
name: validate.runner.actions.summerwind.dev
|
|
||||||
rules:
|
|
||||||
- apiGroups:
|
|
||||||
- actions.summerwind.dev
|
|
||||||
apiVersions:
|
|
||||||
- v1alpha1
|
|
||||||
operations:
|
|
||||||
- CREATE
|
|
||||||
- UPDATE
|
|
||||||
resources:
|
|
||||||
- runners
|
|
||||||
sideEffects: None
|
|
||||||
- admissionReviewVersions: null
|
|
||||||
clientConfig:
|
|
||||||
service:
|
|
||||||
name: webhook-service
|
|
||||||
namespace: system
|
|
||||||
path: /validate-actions-summerwind-dev-v1alpha1-runnerdeployment
|
|
||||||
failurePolicy: Fail
|
|
||||||
name: validate.runnerdeployment.actions.summerwind.dev
|
|
||||||
rules:
|
|
||||||
- apiGroups:
|
|
||||||
- actions.summerwind.dev
|
|
||||||
apiVersions:
|
|
||||||
- v1alpha1
|
|
||||||
operations:
|
|
||||||
- CREATE
|
|
||||||
- UPDATE
|
|
||||||
resources:
|
|
||||||
- runnerdeployments
|
|
||||||
sideEffects: null
|
|
||||||
- admissionReviewVersions: null
|
|
||||||
clientConfig:
|
|
||||||
service:
|
|
||||||
name: webhook-service
|
|
||||||
namespace: system
|
|
||||||
path: /validate-actions-summerwind-dev-v1alpha1-runnerreplicaset
|
|
||||||
failurePolicy: Fail
|
|
||||||
name: validate.runnerreplicaset.actions.summerwind.dev
|
|
||||||
rules:
|
|
||||||
- apiGroups:
|
|
||||||
- actions.summerwind.dev
|
|
||||||
apiVersions:
|
|
||||||
- v1alpha1
|
|
||||||
operations:
|
|
||||||
- CREATE
|
|
||||||
- UPDATE
|
|
||||||
resources:
|
|
||||||
- runnerreplicasets
|
|
||||||
sideEffects: None
|
|
||||||
|
|
@ -6,6 +6,66 @@ metadata:
|
||||||
creationTimestamp: null
|
creationTimestamp: null
|
||||||
name: mutating-webhook-configuration
|
name: mutating-webhook-configuration
|
||||||
webhooks:
|
webhooks:
|
||||||
|
- admissionReviewVersions:
|
||||||
|
- v1beta1
|
||||||
|
clientConfig:
|
||||||
|
service:
|
||||||
|
name: webhook-service
|
||||||
|
namespace: system
|
||||||
|
path: /mutate-actions-summerwind-dev-v1alpha1-runner
|
||||||
|
failurePolicy: Fail
|
||||||
|
name: mutate.runner.actions.summerwind.dev
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- actions.summerwind.dev
|
||||||
|
apiVersions:
|
||||||
|
- v1alpha1
|
||||||
|
operations:
|
||||||
|
- CREATE
|
||||||
|
- UPDATE
|
||||||
|
resources:
|
||||||
|
- runners
|
||||||
|
sideEffects: None
|
||||||
|
- admissionReviewVersions:
|
||||||
|
- v1beta1
|
||||||
|
clientConfig:
|
||||||
|
service:
|
||||||
|
name: webhook-service
|
||||||
|
namespace: system
|
||||||
|
path: /mutate-actions-summerwind-dev-v1alpha1-runnerdeployment
|
||||||
|
failurePolicy: Fail
|
||||||
|
name: mutate.runnerdeployment.actions.summerwind.dev
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- actions.summerwind.dev
|
||||||
|
apiVersions:
|
||||||
|
- v1alpha1
|
||||||
|
operations:
|
||||||
|
- CREATE
|
||||||
|
- UPDATE
|
||||||
|
resources:
|
||||||
|
- runnerdeployments
|
||||||
|
sideEffects: None
|
||||||
|
- admissionReviewVersions:
|
||||||
|
- v1beta1
|
||||||
|
clientConfig:
|
||||||
|
service:
|
||||||
|
name: webhook-service
|
||||||
|
namespace: system
|
||||||
|
path: /mutate-actions-summerwind-dev-v1alpha1-runnerreplicaset
|
||||||
|
failurePolicy: Fail
|
||||||
|
name: mutate.runnerreplicaset.actions.summerwind.dev
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- actions.summerwind.dev
|
||||||
|
apiVersions:
|
||||||
|
- v1alpha1
|
||||||
|
operations:
|
||||||
|
- CREATE
|
||||||
|
- UPDATE
|
||||||
|
resources:
|
||||||
|
- runnerreplicasets
|
||||||
|
sideEffects: None
|
||||||
- admissionReviewVersions:
|
- admissionReviewVersions:
|
||||||
- v1beta1
|
- v1beta1
|
||||||
clientConfig:
|
clientConfig:
|
||||||
|
|
@ -25,3 +85,71 @@ webhooks:
|
||||||
resources:
|
resources:
|
||||||
- pods
|
- pods
|
||||||
sideEffects: None
|
sideEffects: None
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: admissionregistration.k8s.io/v1
|
||||||
|
kind: ValidatingWebhookConfiguration
|
||||||
|
metadata:
|
||||||
|
creationTimestamp: null
|
||||||
|
name: validating-webhook-configuration
|
||||||
|
webhooks:
|
||||||
|
- admissionReviewVersions:
|
||||||
|
- v1beta1
|
||||||
|
clientConfig:
|
||||||
|
service:
|
||||||
|
name: webhook-service
|
||||||
|
namespace: system
|
||||||
|
path: /validate-actions-summerwind-dev-v1alpha1-runner
|
||||||
|
failurePolicy: Fail
|
||||||
|
name: validate.runner.actions.summerwind.dev
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- actions.summerwind.dev
|
||||||
|
apiVersions:
|
||||||
|
- v1alpha1
|
||||||
|
operations:
|
||||||
|
- CREATE
|
||||||
|
- UPDATE
|
||||||
|
resources:
|
||||||
|
- runners
|
||||||
|
sideEffects: None
|
||||||
|
- admissionReviewVersions:
|
||||||
|
- v1beta1
|
||||||
|
clientConfig:
|
||||||
|
service:
|
||||||
|
name: webhook-service
|
||||||
|
namespace: system
|
||||||
|
path: /validate-actions-summerwind-dev-v1alpha1-runnerdeployment
|
||||||
|
failurePolicy: Fail
|
||||||
|
name: validate.runnerdeployment.actions.summerwind.dev
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- actions.summerwind.dev
|
||||||
|
apiVersions:
|
||||||
|
- v1alpha1
|
||||||
|
operations:
|
||||||
|
- CREATE
|
||||||
|
- UPDATE
|
||||||
|
resources:
|
||||||
|
- runnerdeployments
|
||||||
|
sideEffects: None
|
||||||
|
- admissionReviewVersions:
|
||||||
|
- v1beta1
|
||||||
|
clientConfig:
|
||||||
|
service:
|
||||||
|
name: webhook-service
|
||||||
|
namespace: system
|
||||||
|
path: /validate-actions-summerwind-dev-v1alpha1-runnerreplicaset
|
||||||
|
failurePolicy: Fail
|
||||||
|
name: validate.runnerreplicaset.actions.summerwind.dev
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- actions.summerwind.dev
|
||||||
|
apiVersions:
|
||||||
|
- v1alpha1
|
||||||
|
operations:
|
||||||
|
- CREATE
|
||||||
|
- UPDATE
|
||||||
|
resources:
|
||||||
|
- runnerreplicasets
|
||||||
|
sideEffects: None
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue