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

dev: make command errors #770

Closed
somaritane opened this issue Nov 25, 2021 · 3 comments · Fixed by #772
Closed

dev: make command errors #770

somaritane opened this issue Nov 25, 2021 · 3 comments · Fixed by #772
Labels
bug Something isn't working

Comments

@somaritane
Copy link
Contributor

When kube config context is empty or pointing to another cluster or cluster without k8gb installed, make commands are failing:

 ❯ make                                
The connection to the server localhost:8080 was refused - did you specify the right host or port?
...
❯ make                                           
Error from server (NotFound): namespaces "k8gb" not found

This happens during the evaluation of the K8GB_COREDNS_IP make var:

k8gb/Makefile

Line 38 in 367e007

K8GB_COREDNS_IP ?= $(shell kubectl get svc k8gb-coredns -n k8gb -o custom-columns='IP:spec.clusterIP' --no-headers)

Also make demo command fails in any case:

make demo
/bin/sh: K8GB_COREDNS_IP: command not found

Most probably a regression by #764

@somaritane somaritane added the bug Something isn't working label Nov 25, 2021
@k0da
Copy link
Collaborator

k0da commented Nov 25, 2021

This is weird and shouldn't happen:

FILES := $(shell ...)  # expand now; FILES is now the result of $(shell ...)

FILES = $(shell ...)   # expand later: FILES holds the syntax $(shell ...)

@k0da
Copy link
Collaborator

k0da commented Nov 25, 2021

 make -version
GNU Make 4.3
Built for x86_64-apple-darwin20.1.0
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

☸ cto-bcp-nonprod-270 in k8gb on  edge [$?] via 🐹 v1.17.1
13:11:25 ❯ make
check                     Check project integrity
demo                      Execute end-to-end demo
deploy-full-local-setup   Deploy full local multicluster setup (k3d >= 4.2.0)
deploy-gslb-operator      Deploy k8gb operator
deploy-test-apps          Deploy Podinfo (example app) and Apply Gslb Custom Resources
deploy-test-version       Upgrade k8gb to the test version on existing clusters
destroy-full-local-setup  Destroy full local multicluster setup
dns-tools                 Run temporary dnstools pod for debugging DNS issues
help                      Show this help

@somaritane
Copy link
Contributor Author

somaritane commented Nov 25, 2021

@k0da just tried to repro the issue:

Try to create .env file and run make again.
When .env file is included and its vars are exported, then the error happens with K8GB_COREDNS_IP resolution.
If the export is omitted:
https://github.com/k8gb-io/k8gb/blob/master/Makefile#L21
Then these variables are not available to subshells.

k0da added a commit to k0da/k8gb that referenced this issue Nov 25, 2021
kubectl context is not yet established during initialization. Revert
K8GB_COREDNS_IP to command to be executed rather than commands result.

Fixes k8gb-io#770

Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
@k0da k0da closed this as completed in #772 Nov 25, 2021
k0da added a commit that referenced this issue Nov 25, 2021
kubectl context is not yet established during initialization. Revert
K8GB_COREDNS_IP to command to be executed rather than commands result.

Fixes #770

Signed-off-by: Dinar Valeev <dinar.valeev@absa.africa>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants