-
Notifications
You must be signed in to change notification settings - Fork 14
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
Makefile: Export BPFMAN_AGENT_IMG and BPFMAN_OPERATOR_IMG #70
base: main
Are you sure you want to change the base?
Makefile: Export BPFMAN_AGENT_IMG and BPFMAN_OPERATOR_IMG #70
Conversation
Ensure BPFMAN_AGENT_IMG and BPFMAN_OPERATOR_IMG are exported so that they are available to child processes invoked by make. The Makefile provides helpful default values for these variables if not specified. However, without exporting them, you must either specify the values on the make invocation line or export them from your shell. This change resolves issues where integration tests fail due to these variables being missing from the environment. Signed-off-by: Andrew McDermott <[email protected]>
1bf4aea
to
97119e5
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #70 +/- ##
==========================================
- Coverage 27.39% 27.36% -0.03%
==========================================
Files 81 81
Lines 6968 6975 +7
==========================================
Hits 1909 1909
- Misses 4873 4880 +7
Partials 186 186
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
so with this change instead of passing the IMG to make intg-test u can assign the IMG 1st then do the make intg ? I think its kind of common practice with operator sdk setup to set the env var when invoking the make? |
However, the current setup makes the easy path seem difficult: $ git clone /path/to/repo
$ make integration-test This doesn't work out of the box. Is there any value in defaulting these variables in the Makefile if they don't get propagated to the binaries that depend on them? You can still manually export the values in your shell: $ export BPFMAN_AGENT_IMG=some-other-registry.com/bpfman/bpfman-agent:some-hash
$ make integration-test Or specify them when invoking $ make BPFMAN_AGENT_IMG=some-other-registry.com/bpfman/bpfman-agent:some-hash integration-test These two methods will override the default values specified in the Makefile. However, for a newcomer, running |
maybe also worth exporting |
% ag BPFMAN_IMG
Makefile
50:BPFMAN_IMG ?= quay.io/bpfman/bpfman:$(IMAGE_TAG)
290: $(SED) -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
303: $(SED) -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
338: $(OCI_BIN) push ${BPFMAN_IMG}
402: $(SED) -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
427: $(SED) -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \ Given that |
Should both options, as noted in this comment, be added to the top-level README.md or the output of make help? I'm not sure where the information should best sit |
readme should be sufficient Thank you!! |
Actually, this still doesn't work out of the box. You need to make the following change if you just clone the repo and expect % git diff
diff --git a/config/test/kustomization.yaml b/config/test/kustomization.yaml
index 5f52dab..51631c1 100644
--- a/config/test/kustomization.yaml
+++ b/config/test/kustomization.yaml
@@ -46,4 +46,4 @@ resources:
images:
- name: quay.io/bpfman/bpfman-operator
newName: quay.io/bpfman/bpfman-operator
- newTag: int-test
+ newTag: latest
diff --git a/config/test/patch.yaml b/config/test/patch.yaml
index 709b3cd..240b1ae 100644
--- a/config/test/patch.yaml
+++ b/config/test/patch.yaml
@@ -4,7 +4,7 @@ metadata:
name: config
namespace: kube-system
data:
- bpfman.agent.image: quay.io/bpfman/bpfman-agent:int-test
+ bpfman.agent.image: quay.io/bpfman/bpfman-agent:latest
bpfman.image: quay.io/bpfman/bpfman:latest
bpfman.log.level: bpfman=debug
bpfman.agent.log.level: debug |
/hold Let's figure out how int-test is supposed to work. |
…/ocp-bpfman chore(deps): update ocp-bpfman to 7c2f023
Ensure BPFMAN_AGENT_IMG and BPFMAN_OPERATOR_IMG are exported so that they are available to child processes invoked by make. The Makefile provides helpful default values for these variables if not specified. However, without exporting them, you must either specify the values on the make invocation line or export them from your shell. This change resolves issues where integration tests fail due to these variables being missing from the environment.
Without these values being exported, we observe the following:
And when they are exported, we observe the following: