-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 clusterctl error when reading default config file #2983
🐛Fix clusterctl error when reading default config file #2983
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Could the tests for this file be updated to reflect these changes?
/priority critical-urgent |
@fabriziopandini could you retitle the PR to be more explicit about what we're fixing? PR titles go in release notes |
@JoelSpeed test are already verifying those code path, but injected values were hiding the problem @wfernandes opinions? |
@wfernandes @fabriziopandini have we run a manual test to make sure the issue is now fixed? We should follow-up, or get better coverage for this edge case either with some unit tests or in one of the e2e tests |
@vincepri I have, but hopefully @wfernandes can double check |
I'll review this asap. |
@wfernandes @vincepri I managed to get the test coverage for the error conditions this PR is addressing, so we should have a signal in case a regression is introduced |
Reviewing |
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.
I see the error in the checkDefaultConfig. I didn't account for the extra "/" in the config path. Thanks for fixing this! And my bad for introducing this in 🙁
dir, err := ioutil.TempDir("", "clusterctl") | ||
g.Expect(err).NotTo(HaveOccurred()) | ||
defer os.RemoveAll(dir) |
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.
This directory is not needed here since the viperReader
will have no configPaths
for this test case.
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.
thanks for noticing this. now I'm using it so the test is isolated from the user config
@vincepri @fabriziopandini Do we need to backport this fix to the v0.3.4 that was just released? |
We'll need to release v0.3.5 |
b54b500
to
751be4e
Compare
squashed commits and addressed pending comment |
/lgtm |
Is this working ? why I am getting error whether I specify in clusterctl.yaml or export as env variable.. |
What this PR does / why we need it:
This PR fixes #2982 and most specifically
Which issue(s) this PR fixes:
Fixes #2982