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

Local yq is not downloaded or referenced properly in Makefile #1637

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

Baarsgaard
Copy link
Contributor

@Baarsgaard Baarsgaard commented Aug 12, 2024

I was attempting to generate some CRD changes and I was unable to use the Makefile provided yq binary.

> git rev-parse HEAD
26fc2cb328892dda47b2af970882bfd049c06543

> make yq
awk: cmd. line:1: {print tolower()}
awk: cmd. line:1:                ^ 0 is invalid as number of arguments for tolower

> ./bin/yq --version
./bin/yq: 1: Not: not found

# Notice the size of 9 bytes
> ls -al ./bin/
-rwxr-xr-x  1 ste ste  22M Aug 12 20:58 controller-gen
-rwxr-xr-x  1 ste ste  15M Aug 12 20:43 kustomize
-rwxr-xr-x  1 ste ste 9.1M Aug 12 20:45 setup-envtest
-rwxr-xr-x  1 ste ste    9 Aug 12 21:42 yq

And the manifests target did not reference the YQ variable properly and instead relied on PATH

> make manifests
test -s /home/ste/grafana-operator/bin/controller-gen || GOBIN=/home/ste/grafana-operator/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0
test -s /home/ste/grafana-operator/bin/kustomize || { curl -Ss "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash -s -- 5.1.1 /home/ste/grafana-operator/bin; }
/home/ste/grafana-operator/bin/controller-gen rbac:roleName=manager-role webhook paths="./..." crd output:crd:artifacts:config=config/crd/bases
/home/ste/grafana-operator/bin/controller-gen rbac:roleName=manager-role webhook paths="./..." crd output:crd:artifacts:config=deploy/helm/grafana-operator/crds
yq -i '(select(.kind == "Deployment") | .spec.template.spec.containers[0].env[] | select (.name == "RELATED_IMAGE_GRAFANA")).value="docker.io/grafana/grafana:10.4.3"' config/manager/manager.yaml
bash: line 1: yq: command not found
make: *** [Makefile:100: manifests] Error 127

@CLAassistant
Copy link

CLAassistant commented Aug 12, 2024

CLA assistant check
All committers have signed the CLA.

Makefile Show resolved Hide resolved
@Baarsgaard Baarsgaard requested a review from pb82 August 19, 2024 11:50
@theSuess theSuess enabled auto-merge August 22, 2024 13:41
@theSuess theSuess added this pull request to the merge queue Aug 22, 2024
Merged via the queue into grafana:master with commit 89ac76c Aug 22, 2024
14 checks passed
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.

4 participants