Skip to content
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

make: Suppress symlink warnings on getting k8gb $VERSION #499

Closed
wants to merge 1 commit into from

Conversation

somaritane
Copy link
Contributor

This PR suppresses walk.go:74: found symbolic link... message noise during k8gb helm chart $VERSION extraction in Makefile by muting the stderr stream for that command.

NOTE: This change affects only helm show chart chart/k8gb/ command.
Other helm commands used in Makefile are deliberately left intact to not miss possible important helm errors.

Before:

❯ make                        
walk.go:74: found symbolic link in path: /Users/abti021/src/absaoss/k8gb/chart/k8gb/LICENSE resolves to /Users/abti021/src/absaoss/k8gb/LICENSE
walk.go:74: found symbolic link in path: /Users/abti021/src/absaoss/k8gb/chart/k8gb/README.md resolves to /Users/abti021/src/absaoss/k8gb/README.md
walk.go:74: found symbolic link in path: /Users/abti021/src/absaoss/k8gb/chart/k8gb/LICENSE resolves to /Users/abti021/src/absaoss/k8gb/LICENSE
walk.go:74: found symbolic link in path: /Users/abti021/src/absaoss/k8gb/chart/k8gb/README.md resolves to /Users/abti021/src/absaoss/k8gb/README.md
walk.go:74: found symbolic link in path: /Users/abti021/src/absaoss/k8gb/chart/k8gb/LICENSE resolves to /Users/abti021/src/absaoss/k8gb/LICENSE
walk.go:74: found symbolic link in path: /Users/abti021/src/absaoss/k8gb/chart/k8gb/README.md resolves to /Users/abti021/src/absaoss/k8gb/README.md
walk.go:74: found symbolic link in path: /Users/abti021/src/absaoss/k8gb/chart/k8gb/LICENSE resolves to /Users/abti021/src/absaoss/k8gb/LICENSE
walk.go:74: found symbolic link in path: /Users/abti021/src/absaoss/k8gb/chart/k8gb/README.md resolves to /Users/abti021/src/absaoss/k8gb/README.md
demo-failover        Execute failover demo
demo-roundrobin      Execute round-robin demo
...

After:

❯ make                        
demo-failover        Execute failover demo
demo-roundrobin      Execute round-robin demo
...

Signed-off-by: Timofey Ilinykh timofey.ilinykh@absa.africa

Suppress helm "walk.go:74: found symbolic link..." message noise
during k8gb helm chart $VERSION extraction in Makefile by muting
the shell command stderr.

Other helm commands in Makefile are deliberately left intact to not
miss possible helm errors.

Signed-off-by: Timofey Ilinykh <timofey.ilinykh@absa.africa>
@@ -58,7 +58,7 @@ NO_VALUE ?= no_value
# VARIABLES
###############################
PWD ?= $(shell pwd)
VERSION ?= $(shell helm show chart chart/k8gb/|awk '/appVersion:/ {print $$2}')
VERSION ?= $(shell helm show chart chart/k8gb/ 2> /dev/null | awk '/appVersion:/ {print $$2}')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if stderr contains a valid error? it will be invisible right?

Copy link
Contributor Author

@somaritane somaritane May 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ytsarev I've tried to minimize the silencing impact only to this command, but yes, errors will be suppressed.
Regarding possible valid errors for this command, I see issues like helm not installed, chart code missing, appVersion missing in the chart, malformed helm command. In all cases, except missing appVersion, the errors are produced, but the execution proceeds with the empty $(VERSION) variable. In the case of missing appVersion, no errors produced at all.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
VERSION ?= $(shell helm show chart chart/k8gb/ 2> /dev/null | awk '/appVersion:/ {print $$2}')
VERSION ?= $(shell helm show chart chart/k8gb/ 2>&1 |grep -v 'found symbolic link in path' | awk '/appVersion:/ {print $$2}')

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ytsarev , since awk is "interested" in awkVersion: only, it will suppress the rest of stdout, including the redirected stderr with possible errors.

@ytsarev
Copy link
Member

ytsarev commented May 21, 2021

@somaritane which version of helm do you use?
Mine looks silent

 make
demo-failover        Execute failover demo
demo-roundrobin      Execute round-robin demo
deploy-candidate     Deploy test k8gb version together with CRs and test apps on top of existing clusters
deploy-full-local-setup Deploy full local multicluster setup (k3d >= 4.2.0)
deploy-gslb-cr       Apply Gslb Custom Resources
deploy-gslb-operator Deploy k8gb operator
deploy-test-apps     Deploy testing workloads
destroy-full-local-setup Destroy full local multicluster setup
dns-tools            Run temporary dnstools pod for debugging DNS issues
help                 Show this help
upgrade-candidate    Upgrade k8gb to the test version on existing clusters
helm version
version.BuildInfo{Version:"v3.3.4", GitCommit:"a61ce5633af99708171414353ed49547cf05013d", GitTreeState:"dirty", GoVersion:"go1.15.2"}

@somaritane
Copy link
Contributor Author

@somaritane which version of helm do you use?
Mine looks silent

@ytsarev mine is v3.5.4 I can downgrade and check.

@somaritane
Copy link
Contributor Author

@somaritane which version of helm do you use?
Mine looks silent

@ytsarev mine is v3.5.4 I can downgrade and check.

v3.3.4 version acts the same for me

Copy link
Member

@ytsarev ytsarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested the safer suppression method above

@somaritane
Copy link
Contributor Author

somaritane commented May 21, 2021

After carefully checking helm issues:

README replacement is already tracked by separate issue #359, same should be done with LICENSE.

I'm going to close the PR.

@somaritane somaritane closed this May 21, 2021
@somaritane somaritane deleted the suppress-symlink-walk-messages branch October 14, 2021 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants