-
Notifications
You must be signed in to change notification settings - Fork 591
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
feat: add version command #3379
Conversation
49131ff
to
db71ccf
Compare
db71ccf
to
db85ae2
Compare
Codecov ReportBase: 74.1% // Head: 74.1% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #3379 +/- ##
=====================================
Coverage 74.1% 74.1%
=====================================
Files 110 110
Lines 13268 13285 +17
=====================================
+ Hits 9837 9851 +14
- Misses 2804 2813 +9
+ Partials 627 621 -6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
What should be the local smoke test to confirm new make
functionality? Checking out and trying to build results in some error:
11:59:25-0800 esenin $ make build
make[1]: Entering directory '/tmp/kubernetes-ingress-controller'
(cd third_party && go mod tidy && \
GOBIN=/tmp/kubernetes-ingress-controller/bin go generate -tags=third_party ./controller-gen.go )
make[1]: Leaving directory '/tmp/kubernetes-ingress-controller'
/tmp/kubernetes-ingress-controller/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go generate /tmp/kubernetes-ingress-controller/internal/cmd
make[1]: Entering directory '/tmp/kubernetes-ingress-controller'
(cd third_party && go mod tidy && \
GOBIN=/tmp/kubernetes-ingress-controller/bin go generate -tags=third_party ./client-gen.go )
make[1]: Leaving directory '/tmp/kubernetes-ingress-controller'
/tmp/kubernetes-ingress-controller/bin/client-gen \
--go-header-file ./hack/boilerplate.go.txt \
--logtostderr \
--clientset-name clientset \
--input-base github.com/kong/kubernetes-ingress-controller/v2/pkg/apis/ \
--input configuration/v1,configuration/v1beta1,configuration/v1alpha1 \
--input-dirs github.com/kong/kubernetes-ingress-controller/pkg/apis/configuration/v1alpha1/,github.com/kong/kubernetes-ingress-controller/pkg/apis/configuration/v1beta1/,github.com/kong/kubernetes-ingress-controller/pkg/apis/configuration/v1/ \
--output-base pkg/ \
--output-package github.com/kong/kubernetes-ingress-controller/v2/pkg/ \
--trim-path-prefix pkg/github.com/kong/kubernetes-ingress-controller/v2/
CRDS_STANDARD_URL=make[1]: Entering directory '/tmp/kubernetes-ingress-controller' github.com/kubernetes-sigs/gateway-api/config/crd/?ref=v0.5.1 make[1]: Leaving directory '/tmp/kubernetes-ingress-controller'\
CRDS_EXPERIMENTAL_URL=make[1]: Entering directory '/tmp/kubernetes-ingress-controller' github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v0.5.1 make[1]: Leaving directory '/tmp/kubernetes-ingress-controller' \
RAW_REPO_URL=make[1]: Entering directory '/tmp/kubernetes-ingress-controller' https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v0.5.1 make[1]: Leaving directory '/tmp/kubernetes-ingress-controller' \
INPUT=/tmp/kubernetes-ingress-controller/test/internal/cmd/generate-gateway-api-urls/gateway_consts.tmpl \
OUTPUT=/tmp/kubernetes-ingress-controller/test/consts/zz_generated_gateway.go \
go generate -tags=generate_gateway_api_urls ./test/internal/cmd/generate-gateway-api-urls
/bin/sh: line 1: Entering: command not found
make: *** [Makefile:561: generate.gateway-api-urls] Error 127
line indications suggest something around some of the generator targets, but those seem fine when run independently:
12:02:11-0800 esenin $ make print-gateway-api-crds-url
github.com/kubernetes-sigs/gateway-api/config/crd/experimental?ref=v0.5.1
12:02:22-0800 esenin $ make print-gateway-api-raw-repo-url
https://raw.githubusercontent.com/kubernetes-sigs/gateway-api/v0.5.
something is making sh
unhappy though I have no idea what, and -x
and shellcheck aren't properly screaming as to what exactly the problem is.
@rainest weird 🤔 Works on my machine ™️ How about |
some sort of make default that you have and I don't? added a commit that should make it consistent.
|
What this PR does / why we need it:
This is a bit more than the commit message would say it is but when I was going through the
Makefile
I discovered that thebuild
target uses incorrect paths to set theldflags
, i.e.should be
Hence this PR also contains that change and propagates usage of unified
Makefile
targets for building inDockerfile
.Additionally in order to actually test that the binary contains the desired version information that we'd like it to I added
version
command so that the binary can be run for the sole reason to check the version information and get it in the following form:As a cleanup exercises this PR also reformats some of the flags descriptions so that they align properly when binary usage information is printed out.
PR Readiness Checklist:
Complete these before marking the PR as
ready to review
:CHANGELOG.md
release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR