Closed jfwm2 closed 3 years ago
@sud82 I believe you have more complete build instructions to add to the documentation. Could you add it to this ticket please?
Hi @jfwm2, You have to use the operator-sdk build command to build the operator. Please try the given commands and let me know if you face any issues.
operator-sdk build --image-build-args '--build-arg OPERATOR_VERSION=\<anyversion>' \<operator-docker-path> docker push \<operator-docker-path>
e.g. operator-sdk build --image-build-args '--build-arg OPERATOR_VERSION=v0.0.1' aerospike/aerospike-kubernetes-operator:v0.0.1 docker push aerospike/aerospike-kubernetes-operator:v0.0.1
Thanks for your answer @sud82!
I tried the command you provided (using operator-sdk v0.19.4, since the build command is deprecated afterwards) and I got the result below. Basically the underlying "go build" command issued by the operator-sdk fails as previously.
root@3084d7f58070:/aerospike-kubernetes-operator# operator-sdk-v0.19.4-x86_64-linux-gnu build --image-build-args '--build-arg OPERATOR_VERSION=v0.0.1' aerospike/aerospike-kubernetes-operator:v0.0.1
[Deprecation Notice] Operator SDK has a new CLI and project layout that is aligned with Kubebuilder.
See `operator-sdk init -h` and the following doc on how to scaffold a new project:
https://v0-19-x.sdk.operatorframework.io/docs/golang/quickstart/
To migrate existing projects to the new layout see:
https://sdk.operatorframework.io/docs/building-operators/golang/project_migration_guide/
go: github.com/operator-framework/operator-sdk@v0.12.1-0.20191113210304-dc4b52186933 requires
github.com/operator-framework/operator-registry@v1.1.1 requires
bitbucket.org/ww/goautoneg@v0.0.0-20120707110453-75cd24fc2f2c: reading https://api.bitbucket.org/2.0/repositories/ww/goautoneg?fields=scm: 404 Not Found
FATA[0000] Failed to build operator binary: failed to exec []string{"go", "build", "-o", "/aerospike-kubernetes-operator/build/_output/bin/aerospike-kubernetes-operator", "-gcflags", "all=-trimpath=/", "-asmflags", "all=-trimpath=/", "github.com/aerospike/aerospike-kubernetes-operator/cmd/manager"}: exit status 1
If you would like to reproduce, I used the latest ubuntu image for this test. I wonder how you proceed for releases. Do you have a go.mod file different from the one on the repository?
Thanks Jean-Francois
Hi @jfwm2, bitbucket.org/ww/goautoneg is a 3rd party dependency, which has been deleted by its owner. We have it locally and that's how we build it before release. We can check if we can share that dependency with you based on its license. Another option can be that you wait for the operator-sdk upgrade, which will be coming in the next three to four weeks.
Hello @sud82, that would be great if you could provide the missing dependency! Also, maybe you could use vendoring (on a separate branch if not master) so we could have a consistent set of dependency.
@sud82 https://github.com/adjust/goautoneg does this work as a replacement?
Thanks @arrowplum!! It works for me :)
$ go mod edit -replace bitbucket.org/ww/goautoneg=github.com/adjust/goautoneg@d788f35a0315672bc90f50a6145d1252a230ee0d && go mod download
$ go build -o build/_output/bin/aerospike-kubernetes-operator github.com/aerospike/aerospike-kubernetes-operator/cmd/manager
$ ls -l build/_output/bin/aerospike-kubernetes-operator
-rwxr-xr-x 1 jf.webermarx 1945998319 43714688 May 27 06:34 build/_output/bin/aerospike-kubernetes-operator
@jfwm2 thank you for verifying and providing the pull request! Please close once that gets merged @sud82
Closing since pull request is merged. Thanks again @jfwm2
Hello
By internal security policy we are required to use approved base images for our containers; therefore we must build the aerospike operator.
Unfortunately, we are having issues building it; besides the obvious "go build" (see below) we also tried to modify/regenerate module dependencies, as well as, using several versions of operator-sdk but it did not work :(.
Could you please give us some pointers?
Thanks Jean-Francois Weber-Marx jf.webermarx@criteo.com