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

Move JobSet webhook into same webhooks package as pod webhook #460

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

danielvegamyhre
Copy link
Contributor

@danielvegamyhre danielvegamyhre commented Mar 20, 2024

Included in this PR:

  • Refactoring the JobSet webhook (which was previously in the api pkg v1alpha2) into pkg/webhooks with the pod webhook. This decoupling of the JobSet struct itself from the webhook used for JobSet defaulting/validation seemed necessary for a couple reasons:
    • Consistency across the codebase (all webhooks implemented the same way, exist in same location)
    • We may eeded to add a Validator field (from kubectl-validate) to the webhook for Investigate ways to validate Job templates at JobSet validation time #422 so we only create the OpenAPI client for kubectl-validate once, and I don't think the JobSet struct is the proper place for that openapi client based validator.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 20, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danielvegamyhre

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Mar 20, 2024
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 20, 2024
Copy link

netlify bot commented Mar 20, 2024

Deploy Preview for kubernetes-sigs-jobset canceled.

Name Link
🔨 Latest commit d5dbb51
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-jobset/deploys/660af0dee2b1fb0008201bbc

@danielvegamyhre
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 20, 2024
Makefile Outdated
@@ -84,11 +84,11 @@ manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and Cust
rbac:roleName=manager-role output:rbac:artifacts:config=config/components/rbac\
crd:generateEmbeddedObjectMeta=true output:crd:artifacts:config=config/components/crd/bases\
webhook output:webhook:artifacts:config=config/components/webhook\
paths="./..."
paths="{./api/..., ./pkg/...}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I had to change some Makefile rules to target specific paths rather than everything (./...) since it was picking up some javascript dependencies in the site/ directory, now that it is populated.

@danielvegamyhre danielvegamyhre changed the title [WIP] Validate JobSet using kubectl-validate Validate JobSet using kubectl-validate Mar 20, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 20, 2024
@danielvegamyhre
Copy link
Contributor Author

@ahg-g @kannon92 this is ready for review now when you have some time. Changes are outlined in the PR description.

go.mod Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@danielvegamyhre
Copy link
Contributor Author

/hold

until I can talk to @alexzielenski when he is back from kubecon to learn more about kubectl-validate and it's roadmap for improved support for k8s native types

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 22, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 22, 2024
@danielvegamyhre danielvegamyhre changed the title Validate JobSet using kubectl-validate Move JobSet webhook into same webhooks pkg as pod webhook Mar 28, 2024
@danielvegamyhre danielvegamyhre changed the title Move JobSet webhook into same webhooks pkg as pod webhook Move JobSet webhook into same webhooks package as pod webhook Mar 28, 2024
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 28, 2024
@danielvegamyhre
Copy link
Contributor Author

/hold cancel

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Mar 28, 2024
@kannon92
Copy link
Contributor

kannon92 commented Apr 1, 2024

Please rebase.

Otherwise, lgtm.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 1, 2024
@danielvegamyhre
Copy link
Contributor Author

Please rebase.

Otherwise, lgtm.

Finished rebasing

Copy link
Contributor

@kannon92 kannon92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 1, 2024
@k8s-ci-robot k8s-ci-robot merged commit de528b8 into kubernetes-sigs:main Apr 1, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants