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

patch command for kube-webhook-certgen overrides existing objectSelector #19

Closed
medyagh opened this issue Jul 15, 2020 · 2 comments
Closed

Comments

@medyagh
Copy link

medyagh commented Jul 15, 2020

First of all thank you for this great tool !

while reviewing this minikube PR, kubernetes/minikube#8682

I noticed

apiVersion: batch/v1
kind: Job
metadata:
  name: gcp-auth-certs-patch
  namespace: gcp-auth
spec:
  template:
    metadata:
      name: gcp-auth-certs-patch
    spec:
      serviceAccountName: minikube-gcp-auth-certs
      containers:
        - name: patch
          image: jettech/kube-webhook-certgen:v1.2.2
          imagePullPolicy: IfNotPresent
          args:
            - patch
            - --secret-name=gcp-auth-certs
            - --namespace=gcp-auth
            - --patch-validating=false
            - --webhook-name=gcp-auth-webhook-cfg
      restartPolicy: OnFailure

will replace the object selector in

apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
  name: gcp-auth-webhook-cfg
  labels:
    app: gcp-auth
webhooks:
- name: gcp-auth-mutate.k8s.io
  objectSelector:
    matchExpressions:
      - key: gcp-auth-skip-secret
        operator: NotIn
        values: ["true"]
  sideEffects: None
  admissionReviewVersions: ["v1","v1beta1"]
  clientConfig:
    service:
      name: gcp-auth
      namespace: gcp-auth
      path: "/mutate"
  rules:
  - operations: ["CREATE", "UPDATE"]

could this be fixed easily ? maybe by bumping a api version ?

@vsliouniaev
Copy link
Contributor

Could you please check if v1.3.0 works for you?

@sharifelgamal
Copy link

1.3.0 works, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants