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

✨ Must include Dockerfile in declarative plugin #2318

Conversation

justinsb
Copy link
Contributor

@justinsb justinsb commented Aug 29, 2021

We need to copy the channels directory in the Dockerfile, particularly now that we're running with non-root permissions and it is no longer a one-liner.

Add Dockerfile generation.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 29, 2021
@justinsb justinsb changed the title Must include Dockerfile in declarative plugin ✨ Must include Dockerfile in declarative plugin Aug 29, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: justinsb
To complete the pull request process, please assign camilamacedo86 after the PR has been reviewed.
You can assign the PR to them by writing /assign @camilamacedo86 in a comment when ready.

The full list of commands accepted by this bot can be found 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

@justinsb justinsb force-pushed the dockerfile_must_copy_channels branch 4 times, most recently from 1609065 to 8054b0b Compare August 29, 2021 17:41
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 29, 2021
We need to copy the channels directory in the Dockerfile, particularly
now that we're running with non-root permissions and it is no longer a
one-liner.
@justinsb justinsb force-pushed the dockerfile_must_copy_channels branch from 8054b0b to 2108c36 Compare August 29, 2021 17:43
@justinsb
Copy link
Contributor Author

APIDiff looks to be a false-failure.

@justinsb
Copy link
Contributor Author

justinsb commented Sep 7, 2021

@camilamacedo86 should I try to work around the APIDIff incompatible changes on the Plugin? I don't think this API is user-facing.

@camilamacedo86
Copy link
Member

Hi @justinsb,

Could you please rebase it with the master and run make generate for we are able to check?
I think that the problem here is that this PR is not synced.

Also, feel free to ping me in the slack when it passes it the tests for we are able to move forward.

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.

Hi @justinsb,

The contribution is great 🥇 Just a few nits.

See that, the declarative plugin is used to scaffold apis. See: https://book.kubebuilder.io/plugins/plugins.html#plugins

Example:

kubebuider create api [options] --plugins=go/v3,declarative/v1

So, if it requires changes into the Dockerfile we need to ensure that these changes will be performed on the create API subcommand as well.

Also, we need to add the scaffolds inside of the scaffold dir.

Could you please check it out?

return nil
}

func (p *initSubcommand) Scaffold(fs machinery.Filesystem) error {
Copy link
Member

@camilamacedo86 camilamacedo86 Dec 14, 2021

Choose a reason for hiding this comment

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

The scaffold would need to be the inside of the scaffold dir. (e.g: https://github.com/kubernetes-sigs/kubebuilder/blob/master/pkg/plugins/golang/v3/scaffolds/init.go)

@@ -49,6 +50,9 @@ func (Plugin) Version() plugin.Version { return pluginVersion }
// SupportedProjectVersions returns an array with all project versions supported by the plugin
func (Plugin) SupportedProjectVersions() []config.Version { return supportedProjectVersions }

// GetInitSubcommand will return the subcommand which is responsible for initializing and common scaffolding
func (p Plugin) GetInitSubcommand() plugin.InitSubcommand { return &p.initSubcommand }

// GetCreateAPISubcommand will return the subcommand which is responsible for scaffolding apis
func (p Plugin) GetCreateAPISubcommand() plugin.CreateAPISubcommand { return &p.createAPISubcommand }
Copy link
Member

@camilamacedo86 camilamacedo86 Dec 14, 2021

Choose a reason for hiding this comment

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

The declarative plugin can also be called via `create api --plugin' so its implementation shows not accurate.
Should we not be implementing it in the create API subcommand?
Seems that we would need to replace the dockerfile when we call create api --plugin as well.

@camilamacedo86 camilamacedo86 added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Jan 30, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2022
@k8s-ci-robot
Copy link
Contributor

@justinsb: PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@camilamacedo86
Copy link
Member

We can close this one since we could address this changes in : #2507
c/c @justinsb please feel free to check and let us know if it is missing something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants