-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat and bugfixes: update kb and add edit command to support multigroups #4156
feat and bugfixes: update kb and add edit command to support multigroups #4156
Conversation
@@ -17,7 +17,6 @@ limitations under the License. | |||
package v1alpha1 | |||
|
|||
import ("errors" | |||
"k8s.io/apimachinery/pkg/runtime" | |||
ctrl "sigs.k8s.io/controller-runtime" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change in the scaffold is because of the bugfix create webhook
subcommand for the defaulting webhooks by removing import that is not used. More info: kubernetes-sigs/kubebuilder#1718
f93153f
to
292baf6
Compare
Just double checking: Is this |
292baf6
to
2a65f2a
Compare
2a65f2a
to
23b8f2e
Compare
This comment has been minimized.
This comment has been minimized.
23b8f2e
to
d50d944
Compare
d50d944
to
b9809e4
Compare
changelog/fragments/update-kb-from-36124ae2e027-to-9c02d557f01b.yaml
Outdated
Show resolved
Hide resolved
b9809e4
to
7af343d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found 2 nits, but those can be fixed in a follow on PR if need be. Overall I looks fine to me.
version: 2 | ||
... | ||
``` | ||
Before we start to create the APIs, check if your project has more than one group such as : `foo.example.com/v1` and `crew.example.com/v1`. If you intend to still working on with multiple groups in your project, then to change the layout of your project to support Multi-Group run the command `operator-sdk edit --multigroup=true` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I know it was already like this but I think it should read:
"If you intend to work with multiple groups in your project, then to change the project's layout to support Multi-Group, run the command operator-sdk edit --multigroup=true
.
|
||
```YAML | ||
domain: example.com | ||
layout: go.kubebuilder.io/v2 | ||
multigroup: true | ||
... | ||
``` | ||
For multi-group projects, the API Go type files are created under `apis/<group>/<version>/` and the controllers under `controllers/<group>/`. | ||
For multi-group projects, the API Go type files are created under `apis/<group>/<version>/` and the controllers under `controllers/<group>/` and then, the Dockerfile will be also updated accordingly. For further information see the [Single Group to Multi-Group][multigroup-kubebuilder-doc] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the Dockerfile will be updated accordingly.
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nits
(go/v2) Added the command `òperator-sdk edit` which allows users edit the project layout to support Multi-Group. | ||
More info: https://book.kubebuilder.io/migration/multi-group.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(go/v2) Added the command `òperator-sdk edit` which allows users edit the project layout to support Multi-Group. | |
More info: https://book.kubebuilder.io/migration/multi-group.html | |
(go/v2) Added the command `òperator-sdk edit` which allows users edit the project layout to support [multi-group](https://book.kubebuilder.io/migration/multi-group.html). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also Mulit-Group really should be lower-cased, as it is not a proper noun in this context.
(go/v2) Fix `create webhook` subcommand for the defaulting webhooks by removing import that is not used. | ||
More info: https://github.com/kubernetes-sigs/kubebuilder/pull/1718 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(go/v2) Fix `create webhook` subcommand for the defaulting webhooks by removing import that is not used. | |
More info: https://github.com/kubernetes-sigs/kubebuilder/pull/1718 | |
(go/v2) Removed unused import for defaulting webhooks scaffolded by `create webhook` ([kubebuilder#1718](https://github.com/kubernetes-sigs/kubebuilder/pull/1718)). |
(go/v2) Fix `copyright` info on the license of the generated files when the owner is not informed. | ||
More info: https://github.com/kubernetes-sigs/kubebuilder/pull/1749 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(go/v2) Fix `copyright` info on the license of the generated files when the owner is not informed. | |
More info: https://github.com/kubernetes-sigs/kubebuilder/pull/1749 | |
(go/v2) Allow owner to not be specified in generated licenses ([kubebuilder#1749](https://github.com/kubernetes-sigs/kubebuilder/pull/1749)). |
@@ -61,16 +61,15 @@ Read the [operator scope][operator_scope] documentation on how to run your opera | |||
|
|||
### Multi-Group APIs | |||
|
|||
Before creating an API and controller, consider if your operator's API requires multiple [groups][API-groups]. | |||
If yes then add the line `multigroup: true` in the `PROJECT` file which should look like the following: | |||
Before creating an API and controller, consider if your operator's API requires multiple [groups][API-groups]. Then to change the layout of your project to support Multi-Group run the command `operator-sdk edit --multigroup=true`. It will update the `PROJECT` file which should look like the following: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before creating an API and controller, consider if your operator's API requires multiple [groups][API-groups]. Then to change the layout of your project to support Multi-Group run the command `operator-sdk edit --multigroup=true`. It will update the `PROJECT` file which should look like the following: | |
Before creating an API and controller, consider if your operator requires multiple API [groups][api-groups]. Then to change the layout of your project to support multi-group run the command `operator-sdk edit --multigroup=true`. It will update the `PROJECT` file which should look like the following: |
|
||
```YAML | ||
domain: example.com | ||
layout: go.kubebuilder.io/v2 | ||
multigroup: true | ||
... | ||
``` | ||
For multi-group projects, the API Go type files are created under `apis/<group>/<version>/` and the controllers under `controllers/<group>/`. | ||
For multi-group projects, the API Go type files are created under `apis/<group>/<version>/` and the controllers under `controllers/<group>/` and then, the Dockerfile will be also updated accordingly. For further information see the [Single Group to Multi-Group][multigroup-kubebuilder-doc] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For multi-group projects, the API Go type files are created under `apis/<group>/<version>/` and the controllers under `controllers/<group>/` and then, the Dockerfile will be also updated accordingly. For further information see the [Single Group to Multi-Group][multigroup-kubebuilder-doc] | |
For multi-group projects, the API Go type files are created under `apis/<group>/<version>/` and the controllers under `controllers/<group>/` and then, the Dockerfile will be also updated accordingly. For further information see the [multi-group migration doc][multigroup-kubebuilder-doc] |
7af343d
to
70c9621
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
70c9621
to
905de4e
Compare
New changes are detected. LGTM label has been removed. |
…ups (operator-framework#4156) **Description of the change:** - Update kubebuilder dependency (See: kubernetes-sigs/kubebuilder@36124ae...9c02d55) - Add edit command which allows multigroup support - Align SDK with Kubebuilder and address bug fixes **Motivation for the change:** - Solve tech-debt and keep both projects aligned - Close the issue: operator-framework#3678 and provide the same facility that has in upstream to change the layout to support multigroup - Close the issue: operator-framework#4157 Signed-off-by: reinvantveer <rein.van.t.veer@geodan.nl>
…ups (operator-framework#4156) **Description of the change:** - Update kubebuilder dependency (See: kubernetes-sigs/kubebuilder@36124ae...9c02d55) - Add edit command which allows multigroup support - Align SDK with Kubebuilder and address bug fixes **Motivation for the change:** - Solve tech-debt and keep both projects aligned - Close the issue: operator-framework#3678 and provide the same facility that has in upstream to change the layout to support multigroup - Close the issue: operator-framework#4157 Signed-off-by: rearl <rearl@secureworks.com>
Description of the change:
Motivation for the change:
Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments
(seechangelog/fragments/00-template.yaml
)website/content/en/docs