Giter Site home page Giter Site logo

Comments (4)

davidxia avatar davidxia commented on July 23, 2024 2

Closing as it's not a bug. These lines are setting the K8s Service's namespace not that of the Mutating|ValidatingWebhookConfiguration.

These lines

namespace:
- kind: MutatingWebhookConfiguration
group: admissionregistration.k8s.io
path: webhooks/clientConfig/service/namespace
create: true
- kind: ValidatingWebhookConfiguration
group: admissionregistration.k8s.io
path: webhooks/clientConfig/service/namespace
create: true
are needed to update the Mutating|ValidatingWebhookConfiguration's webhooks/0/clientConfig/service/namespace value
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: mutating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-crew-testproject-org-v1-admiral
with that from here (Not sure why the path in kustomizeconfig.yaml doesn't have an array index path segment.)

Without these lines, the namespace value will always be system.

from kubebuilder.

davidxia avatar davidxia commented on July 23, 2024

created this issue at the request of kubernetes-sigs/controller-tools#999 (comment) despite the issue template saying to create issues in controller-tools 🤷‍♂️

from kubebuilder.

camilamacedo86 avatar camilamacedo86 commented on July 23, 2024

It is not related to controller-tools at all.
Since the scaffold was implemented in Kubebuilder it has the namespaces transforms.
See: a3e6e25

However, it seems that is a bug and the code is unnecessary.
To fix it is required to:

  • 1 : Change the kubebuilder template:
    const kustomizeConfigWebhookTemplate = `# the following config is for teaching kustomize where to look at when substituting nameReference.
    # It requires kustomize v2.1.0 or newer to work properly.
    nameReference:
    - kind: Service
    version: v1
    fieldSpecs:
    - kind: MutatingWebhookConfiguration
    group: admissionregistration.k8s.io
    path: webhooks/clientConfig/service/name
    - kind: ValidatingWebhookConfiguration
    group: admissionregistration.k8s.io
    path: webhooks/clientConfig/service/name
    namespace:
    - kind: MutatingWebhookConfiguration
    group: admissionregistration.k8s.io
    path: webhooks/clientConfig/service/namespace
    create: true
    - kind: ValidatingWebhookConfiguration
    group: admissionregistration.k8s.io
    path: webhooks/clientConfig/service/namespace
    create: true
    `
  • 2 - Run make generate to ensure that all samples and docs will properly updated

Please, feel free to open PR with the change.

from kubebuilder.

davidxia avatar davidxia commented on July 23, 2024

@camilamacedo86 thanks, I'll attempt!

from kubebuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.