-
Notifications
You must be signed in to change notification settings - Fork 95
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
fix: Correctly set and pick up environment variables #315
Conversation
Signed-off-by: Ang Zhou <[email protected]>
Could you add e2e tests? Can be simply "logout -> in host, ~/.finch/config.json.assertNotContains() -> login -> in host, ~/.finch/config.json.assertContains()", unless you know better ways. Can be directly added in finch repo instead of common-tests because this is finch specific. |
Signed-off-by: Ang Zhou <[email protected]>
Signed-off-by: Ang Zhou <[email protected]>
Signed-off-by: Ang Zhou <[email protected]>
Signed-off-by: Ang Zhou <[email protected]>
Added e2e tests. |
Signed-off-by: Ang Zhou <[email protected]>
Signed-off-by: Ang Zhou <[email protected]>
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.
We should add sudo -E
in the version command as well to keep it consistent with the rest of nerdctl
commands.
Signed-off-by: Ang Zhou <[email protected]>
Good catch, updated |
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.
Looks good. golanci-lint
failed on version_test.go
due to to max line length. We should fix that before merge.
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.
LGTM
Does the test work if you execute it manually on the CI runners by logging in? What if we put a sleep after finch/e2e/vm/finch_config_file_test.go Line 39 in 7b0f62b
|
Signed-off-by: Ang Zhou <[email protected]>
7b0f62b
to
15f8630
Compare
yeah you are right, I printed the images and containers trying to debug, but the issue happens to be fixed.. |
Signed-off-by: Ang Zhou <[email protected]>
# Conflicts: # cmd/finch/main.go
Signed-off-by: Ang Zhou <[email protected]>
c4b5dfe
to
6300a6c
Compare
Signed-off-by: Ang Zhou <[email protected]>
6300a6c
to
99b1918
Compare
Merged due to the e2e failure is a known issue with Rosetta |
🤖 I have created a release *beep* *boop* --- ## [0.5.0](v0.4.1...v0.5.0) (2023-03-29) ### Features * adds support bundles ([#210](#210)) ([cc6be65](cc6be65)) ### Bug Fixes * Correctly set and pick up environment variables ([#315](#315)) ([05227ce](05227ce)) * print debug logs after newline ([#273](#273)) ([8faa7de](8faa7de)) * print debug logs when lima disk command fails ([#270](#270)) ([78a3f50](78a3f50)) ### Experimental * **feat:** enable Virtualization.framework and Rosetta ([#282](#282)) ([fd3bf19](fd3bf19)) ### Build System or External Dependencies * clean up finch-core _output directory in clean target ([#290](#290)) ([4684a95](4684a95)) * **deps:** bump github.com/onsi/ginkgo/v2 from 2.8.4 to 2.9.0 ([#265](#265)) ([7e2d49e](7e2d49e)) * **deps:** bump github.com/onsi/ginkgo/v2 from 2.9.0 to 2.9.1 ([#285](#285)) ([d741a03](d741a03)) * **deps:** Bump github.com/onsi/gomega from 1.27.3 to 1.27.5 ([#312](#312)) ([e078234](e078234)) * **deps:** bump github.com/runfinch/common-tests from 0.6.1 to 0.6.2 ([#300](#300)) ([dd626a0](dd626a0)) * **deps:** bump github.com/spf13/afero from 1.9.4 to 1.9.5 ([#263](#263)) ([a0e277f](a0e277f)) * **deps:** bump golang.org/x/crypto from 0.6.0 to 0.7.0 ([#264](#264)) ([ec1c07f](ec1c07f)) * **deps:** bump golang.org/x/tools from 0.6.0 to 0.7.0 ([#268](#268)) ([8072e39](8072e39)) * **deps:** bump k8s.io/apimachinery from 0.26.2 to 0.26.3 ([#306](#306)) ([fe392cb](fe392cb)) * **deps:** Bump lima version ([#302](#302)) ([0269743](0269743)) * **deps:** Bump submodules ([#281](#281)) ([d4fd1f6](d4fd1f6)) * **deps:** Bump submodules ([#304](#304)) ([b38af9f](b38af9f)) * **deps:** Bump submodules ([#307](#307)) ([1a914ec](1a914ec)) * **deps:** Bump submodules ([#319](#319)) ([e671224](e671224)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Issue #, if available:
Currently the environment variable is set in
/root/.bashrc
so that it is not easily accessible by regular users even by specifyingsudo -E
. Normally we would access the VM by regular user. In order to pick up the environment variables, we need to store the vars in the /home/.linux/.bashrc and added -E to sudo command as sudo itself won't preserve the environment variables.Description of changes:
Added -E to sudo command when we call limactl command.
Update the profile path so that env vars are written in /home/.linux/.bashrc.
Added e2e tests to make sure the content is written correctly into the ~/.finch/.config.json file in host system.
Testing done:
Manual testing and E2E tests
License Acceptance
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.