[ansible/helm] remove operator-sdk binary from ansible/helm base images#3331
Conversation
88eef98 to
242d85a
Compare
bc17fa7 to
a2c9ac6
Compare
a2c9ac6 to
0520d6f
Compare
3946f9f to
2e59955
Compare
This PR intends to create an independent binary using exec-entrypoint command for ansible operators.
2e59955 to
8825cd0
Compare
| The `operator-sdk` command no longer supports `exec-entrypoint` subcommand for ansible and helm operators. The entrypoints | ||
| for ansible/helm base images are from separate binaries present inside `cmd/` folder. |
There was a problem hiding this comment.
Regards
The entrypoints for ansible/helm base images are from separate binaries present inside
cmd/folder.
Note that, the fragment is used to generate the CHANGELOG and migration guide and the cmd folder does not exist in the user's projects.
Following a suggestion.
| The `operator-sdk` command no longer supports `exec-entrypoint` subcommand for ansible and helm operators. The entrypoints | |
| for ansible/helm base images are from separate binaries present inside `cmd/` folder. | |
| **(Valid just for Ansible/Helm-based Operators).** The subcommand `operator-sdk exec-entrypoint` was removed. |
I understand that the end goal of this change is for we provide the Helm/Ansible binaries which will allow us to run the projects. (which would be a follow up to have the makefile targets and etc) Example:
$ go build -o helm-operator ./cmd/helm-operator/main.go
# will allow we run a helm-operator with
$ helm-operator run
{"level":"info","ts":1594191796.834888,"logger":"setup","msg":"version information","go":"go1.13.12","GOOS":"darwin","GOARCH":"amd64","helm-operator":"0.0.0+git"}
{"level":"info","ts":1594191796.8350248,"logger":"setup","msg":"watching all namespaces"}
{"level":"info","ts":1594191797.146786,"logger":"controller-runtime.metrics","msg":"metrics server is starting to listen","addr":":8080"}
{"level":"error","ts":1594191797.146928,"logger":"setup","msg":"unable to load watches.yaml","path":"./watches.yaml","error":"open ./watches.yaml: no such file or directory"}
Usually, when we remove some command we would provide the info/steps for the users does the same in the new way. However, in this case, I do not think that at this moment would make sense we add info such as:
To runs as Ansible/Helm-based operator from inside of a Pod in a cluster use SDK source code and
go run cmd/<ansible|helm>-operator/main.goinstead of it.
Because it would be replaced in the future by the binaries.
camilamacedo86
left a comment
There was a problem hiding this comment.
Just a few nits
- See my comment regards the fragment description. https://github.com/operator-framework/operator-sdk/pull/3331/files#r451307372
- Also, could you please provide a better/more accurate information in the first comment of this PR for we are able to track it? Could you please register the required follow-ups and the end goals (motivation) of this change? Note that when we merge the PR we can add the description field to be the commit description as well which allows us have this info when we check the commit. E.g
Following my suggestion:
Description of the change:
- Remove the subcommand
operator-sdk exec-entrypointwhich is just valid for Ansible/Helm-based Operators.- Add the main.go to run the operators in
cmd/<helm|ansible>-operator/main.go- Build
cmd/<helm|ansible>-operator/main.goin Ansible/Helm the base dir imagesNote that, the script
buid-<ansible|helm>-image.shbuilds the binary from/hack/image/ansible/baseimage/baseimage.go. The Dockerfile scaffolding is modified to copy this binary. The entrypoint script can now run the generatedbase-imagebinary instead ofexec-entrypointcommand.Motivation for the change:
Removeexec-entrypointcommand and hence also remove operator-sdk binary from ansible/helm base image. Its intention is to provide helm/ansible binaries instead which can be used to run the operators projects locally in order to replace theoperator-sdk run localcommand. It will be done in follow-ups. E.g:
$ go build -o helm-operator ./cmd/helm-operator/main.go
# will allow we run a helm-operator with
$ helm-operator run
{"level":"info","ts":1594191796.834888,"logger":"setup","msg":"version information","go":"go1.13.12","GOOS":"darwin","GOARCH":"amd64","helm-operator":"0.0.0+git"}
{"level":"info","ts":1594191796.8350248,"logger":"setup","msg":"watching all namespaces"}
{"level":"info","ts":1594191797.146786,"logger":"controller-runtime.metrics","msg":"metrics server is starting to listen","addr":":8080"}
{"level":"error","ts":1594191797.146928,"logger":"setup","msg":"unable to load watches.yaml","path":"./watches.yaml","error":"open ./watches.yaml: no such file or directory"}
Then, for me, it is /lgtm /approve after address the above suggestions.
joelanford
left a comment
There was a problem hiding this comment.
LGTM after removing the changelog fragment. (sorry for the back-and-forth!)
0184457 to
2a30cce
Compare

Description of the change:
Remove the subcommand operator-sdk exec-entrypoint which is only valid for Ansible/Helm-based Operators.
Add the main.go to run the operators in cmd/<helm|ansible>-operator/main.go
Build cmd/<helm|ansible>-operator/main.go for Ansible/Helm base images.
Note that, the script buid-<ansible|helm>-image.sh builds the binary from cmd/ansible|helm-operator/main.go. The Dockerfile scaffolding now copies this binary instead of SDK's binary. The entrypoint script can now run the generated base-image binary instead of exec-entrypoint command.
Motivation for the change:
Remove exec-entrypoint command and hence also remove operator-sdk binary from ansible/helm base image. Its intention is to provide helm/ansible binaries which can be used to run the operator projects locally in order to replace the operator-sdk run local command. It will be done in follow-ups. E.g:
Checklist
If the pull request includes user-facing changes, extra documentation is required:
changelog/fragments(seechangelog/fragments/00-template.yaml)website/content/en/docs