-
Notifications
You must be signed in to change notification settings - Fork 54
Add plugin for hybrid helm operator #97
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
Add plugin for hybrid helm operator #97
Conversation
Pull Request Test Coverage Report for Build 994610534
💛 - Coveralls |
be5d2a4
to
c465b47
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.
We want main.go
set up such that if you ran create api
from the helm plugin we would begin reconciling those resources, which means on init we want to scaffold out the code responsible for loading the watches and setting up the reconcilers. Once that's in there everything else looks good to me
pkg/plugins/hybrid/v1alpha/scaffolds/internal/templates/main.go
Outdated
Show resolved
Hide resolved
Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com>
Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com>
b1ab944
to
3ffffc2
Compare
pkg/plugins/hybrid/v1alpha/scaffolds/internal/templates/dockerfile.go
Outdated
Show resolved
Hide resolved
# Refer to https://github.com/GoogleContainerTools/distroless for more details | ||
FROM gcr.io/distroless/static:nonroot | ||
WORKDIR / | ||
COPY --from=builder /workspace/manager . |
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 think we also need to copy the helm-charts directory
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.
and generally probably need to be closer to the helm-operator base image though that can be a longer term thing
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.
added the helm chart repository. I have made the entry point to be the manager binary (for now), in a follow up Ill test it out and remove it (as entry point) if not needed.
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
good first pass, needs some followup but this definitely serves as a good POC
* Add hybrid operator plugin * Add testdata for hybrid operator plugin * Fix lint Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com> * add logic to load watches in main.go Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com> * Add dockerfile and build commands Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com> * fix: dockerfile Signed-off-by: varshaprasad96 <varshaprasad96@gmail.com>
This PR adds a new plugin for hybrid helm operator. It has the scaffolding required for
init
command.Usage:
operator-sdk init --plugins=hybrid.helm.sdk.operatorframework.io --project-version="3" --repo=github.com/example/memcached-operator
This scaffolds the following files:
Note: This scaffolding is when
kustomize
andscorecard
plugins are bundled with hybrid operator plugin. Once this is done, we can eithercreate api
using helm or go/v3 plugins.Ex:
Go plugin:
Helm plugin:
The
pkg/plugins/hybrid/v1alpha/testdata
has been manually generated and added for reference in this PR. A testdata generator script needs to be implemented which writes the scaffolding directly from plugin (instead of wiring it with SDK) in a follow up PR.