-
Notifications
You must be signed in to change notification settings - Fork 43
Generic controller #75
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
Generic controller #75
Conversation
Hi @somtochiama. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
eeb9e5a
to
703f80a
Compare
/ok-to-test |
generic/main.go
Outdated
func init() { | ||
_ = clientgoscheme.AddToScheme(scheme) | ||
|
||
_ = addonsv1alpha1.AddToScheme(scheme) // <-------- |
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: We can remove the <---
marker :-)
os.Exit(1) | ||
} | ||
|
||
for i := range genericList.Items { |
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 think we should have a TODO to say "add a watch on Generic, respond to changes" or something like that
Channel string | ||
} | ||
|
||
// +kubebuilder:rbac:groups=addons.x-k8s.io,resources=generics,verbs=get;list;watch;create;update;patch;delete |
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 actually don't think we need these rbac permissions. I guess we want get/list/watch on generics, but you could also move than to main.go.
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.
Is there any difference, moving it to main.go
return err | ||
} | ||
|
||
// Watch for changes to Generic |
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 think this should say "Watch for changes to the objectKind" or something like that
This is looking really good! We do need the tools to generate the RBAC & the manifests, but then this is going to be a really nice experience for users! |
Can you please add a |
generic/Dockerfile
Outdated
FROM gcr.io/distroless/static:nonroot | ||
WORKDIR / | ||
COPY --from=builder /workspace/manager . | ||
COPY addons/ addons/ |
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.
Error. The line COPY addons/ addons/
should be changed to COPY channels/ channels/
otherwise docker build will fail. @somtochiama
I got this error when I run the generic controller under a kind cluster using the command
Why should we do then deploy first a Generic CRD before to start the controler ? |
The generic controller is different because it is used as a general controller for other simple addons that don't require any extra configuration. |
I will definitely do so |
Maybe then review the message logged to make it more explicit about root cause of the error and what is it needed to be done to avoid it. As the controller will crash, then we must find a way to make it healthy if a Generic CR has been deployed ... |
I changed the message and added a REAME.md for the tools. Please review whenever you can! Thanks |
This is really cool and it sounds like people want to start trying it out, so let's merge it and iterate with further improvements! /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: justinsb, SomtochiAma 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 |
No description provided.