-
Notifications
You must be signed in to change notification settings - Fork 190
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
log submariner component's version on startup #2552
Conversation
🤖 Created branch: z_pr2552/cyclinder/version |
Thanks for all your comments! @nirs All comments have been addressed, But It's failed to image build, I'm not familiar with build code, it seems now submariner doesn't support go build with cyclinder submariner ( version) ♥ 15:00 make bin/%/submariner-route-agent
docker network create -d bridge kind
Error response from daemon: network with name kind already exists
make: [bin/%/submariner-route-agent] Error 1 (ignored)
./.dapper -- make bin/%/submariner-route-agent
[+] Building 0.2s (8/8) FINISHED
=> [internal] load build definition from Dockerfile.dapper 0.0s
=> => transferring dockerfile: 44B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for quay.io/submariner/shipyard-dapper-base:devel 0.0s
=> [1/4] FROM quay.io/submariner/shipyard-dapper-base:devel 0.0s
=> CACHED [2/4] WORKDIR /go/src/github.com/submariner-io/submariner 0.0s
=> CACHED [3/4] RUN git config --global --add safe.directory /go/src/github.com/submariner-io/submariner 0.0s
=> CACHED [4/4] RUN git config --global --add safe.directory /go/src/github.com/submariner-io/submariner/ovn-kubernetes 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:73287c580d965569832571e6ff0b32c86237c0954bb5ea21ba25b282cf2e5db8 0.0s
=> => naming to docker.io/library/submariner:version 0.0s
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
Checking if Makefile.dapper is up to date
Checking if Dockerfile.dapper is up to date
GOARCH=bin/%/ \
LDFLAGS=-X github.com/submariner-io/submariner/pkg/version/version.gitCommitHash=a28429ee67f72047ce4e92efad8ec4eab5eed78f -X github.com/submariner-io/submariner/pkg/version/version.gitCommitDate=2023-06-24T14:52:48+08:00 \
/opt/shipyard/scripts/compile.sh bin/%/submariner-route-agent ./pkg/routeagent_driver
/bin/bash: line 1: github.com/submariner-io/submariner/pkg/version/version.gitCommitHash=a28429ee67f72047ce4e92efad8ec4eab5eed78f: No such file or directory
make: *** [Makefile:73: bin/%/submariner-route-agent] Error 127
make: *** [bin/%/submariner-route-agent] Error 2
cyclinder submariner ( version) ♥ 15:00 LDFLAGS1="-X github.com/submariner-io/submariner/pkg/version/version.gitCommitHash=GIT_COMMIT_HASH -X github.com/submariner-io/submariner/pkg/version/version.gitCommitDate=GIT_COMMIT_DATE"
cyclinder submariner ( version) ♥ 15:00 CGO_ENABLED=0 GOOS=linux ARCH=amd64 go build -trimpath -ldflags "-s -w ${LDFLAGS1}" -o router ./pkg/routeagent_driver
cyclinder submariner ( version) ♥ 15:00 ls router
router
cyclinder submariner ( version) ♥ 15:00 I would be very grateful if you could help me. |
Because LDFLAGS= value was not quoted, we tried to execute:
|
88c6fe2
to
1896043
Compare
Thanks again for your comments. I believe the CI can pass this time. |
d18da3d
to
fbe6add
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.
Looks good except the change in default version and unneeded export in the makefile.
6bcf626
to
40941be
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.
Strange that LDFLAGS =-X github.com/submariner-io/submariner/pkg/version.Version=
works but it will be easy to change such details later if needed.
Oh,I think it's nit here, it should be version rather than Version. |
fb4e6f8
to
780b180
Compare
c7e90c8
to
7963f19
Compare
Thanks all @nirs @tpantelis |
Signed-off-by: cyclinder <[email protected]>
🤖 Closed branches: [z_pr2552/cyclinder/version] |
Backported to 0.15: #2615 |
#2548