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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 (config/v3) Track in the project configuration file resources without API #2003

Merged

Conversation

Adirio
Copy link
Contributor

@Adirio Adirio commented Feb 10, 2021

When an API is not scaffolded (kubebuilder create api --resource=false --controller ...) the resources are not being tracked in the config file. Tracking this in config/v3 is doable as we can still know if the API was scaffolded by some of its fields, but as config/v2 doesn't have this additional fields, it can't track this resources. The reason for this is that the pressence of a resource in config/v2 means that the API was scaffolded at webhook validation (they require the API to be scaffolded) and this information won't be obtainable.

This change also detected that we were defining the Path field for those resources that do not have an API which was removed, and it allows to be a bit more intelligent when deploying core-resources.

Fixes #2001
Fixes #2002

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 10, 2021
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Feb 10, 2021
@Adirio Adirio force-pushed the track-resources-without-api branch 2 times, most recently from 2af85b9 to 0358291 Compare February 10, 2021 14:45
@@ -98,7 +98,7 @@ scaffold_test_project() {

$kb create api --group foo.policy --version v1 --kind HealthCheckPolicy --controller=true --resource=true --make=false

$kb create api --group apps --version v1 --kind Pod --controller=true --resource=false --make=false
$kb create api --group apps --version v1 --kind Deployment --controller=true --resource=false --make=false
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pod is not part of the apps group, it is part of the core group: link.

Replaced for Deployment which is part of the apps group: link.

@Adirio Adirio force-pushed the track-resources-without-api branch 4 times, most recently from a63f8c4 to d4371e8 Compare February 10, 2021 18:42
@Adirio Adirio marked this pull request as ready for review February 10, 2021 18:57
@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 Feb 10, 2021
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

It shows great.
Could you please squash the commits for we are able to get it merged?

- Remove path from resources that do not know the path
- Add scaffold to controllers if we do know the path instead of if we scaffold an API
- Track the resources in the config file even if we don't scaffold an API

Signed-off-by: Adrian Orive <adrian.orive.oneca@gmail.com>
@Adirio Adirio changed the title 馃悰 Track resources without API and improve scaffold of controllers without API when the path is known 馃悰 (config/v3) Track in the project configuration file resources without API Feb 11, 2021
Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

Thank you for your contribution 馃

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Adirio, camilamacedo86

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 11, 2021
@k8s-ci-robot k8s-ci-robot merged commit 05abe25 into kubernetes-sigs:master Feb 11, 2021
@Adirio Adirio deleted the track-resources-without-api branch February 11, 2021 12:17
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
3 participants