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

Make credentials file take precedence over environment. #2991

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

kron4eg
Copy link
Member

@kron4eg kron4eg commented Jan 2, 2024

What this PR does / why we need it:
This PR aligns what docs says with the we already have: credentials file take precedence over environment. In addition it's also:

  • added unit-tests

Supersedes #2881

Which issue(s) this PR fixes:
Fixes #2798

What type of PR is this?
/kind bug

Special notes for your reviewer:

Does this PR introduce a user-facing change? Then add your Release Note here:

[ACTION REQUIRED] Credentials defined in the credentials file now have precedence over credentials defined via environment variables. This change is made to match the behavior that's already documented in the KubeOne docs. If you use both the credentials file and the environment variables, we recommend double-checking your credentials file to make sure the credentials are up to date, as those credentials will be applied on the next `kubeone apply` run

Documentation:

NONE

Marking this as none, because the docs ALREADY says it's like this.

@kron4eg kron4eg requested a review from xmudrii January 2, 2024 16:15
@kubermatic-bot kubermatic-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. docs/none Denotes a PR that doesn't need documentation (changes). dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 2, 2024
@kron4eg kron4eg marked this pull request as draft January 3, 2024 09:06
@kubermatic-bot kubermatic-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 3, 2024
@kubermatic-bot kubermatic-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 4, 2024
@kron4eg
Copy link
Member Author

kron4eg commented Jan 4, 2024

/test pull-kubeone-e2e-aws-default-install-containerd-external-v1.28.3

To unblock unit-tests.

Signed-off-by: Artiom Diomin <artiom@kubermatic.com>
@kron4eg
Copy link
Member Author

kron4eg commented Jan 4, 2024

/test pull-kubeone-e2e-aws-default-install-containerd-external-v1.28.3

@kron4eg kron4eg marked this pull request as ready for review January 4, 2024 11:56
@kubermatic-bot kubermatic-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 4, 2024
@xmudrii
Copy link
Member

xmudrii commented Jan 4, 2024

I'd make the release note action required because this is a kind of breaking change. What do you think about something like this:

[ACTION REQUIRED] Credentials defined in the credentials file now have precedence over credentials defined via environment variables. This change is made to match the behavior that's already documented in the KubeOne docs. If you use both the credentials file and the environment variables, we recommend double-checking your credentials file to make sure the credentials are up to date, as those credentials will be applied on the next `kubeone apply` run

Otherwise, this change LGTM!

@kron4eg
Copy link
Member Author

kron4eg commented Jan 4, 2024

I'd make the release note action required because this is a kind of breaking change. What do you think about something like this:

[ACTION REQUIRED] Credentials defined in the credentials file now have precedence over credentials defined via environment variables. This change is made to match the behavior that's already documented in the KubeOne docs. If you use both the credentials file and the environment variables, we recommend double-checking your credentials file to make sure the credentials are up to date, as those credentials will be applied on the next `kubeone apply` run

Otherwise, this change LGTM!

Funny thing is our docs states that credentials file will prevail :D

https://docs.kubermatic.com/kubeone/v1.7/guides/credentials/#credentials-file

It has the priority over the environment variables, so you can use it if you want to use different credentials or if you don’t want to export credentials as environment variables.

EDIT:
But of course despite of this, it's quite a change and we need to tell people about it!

@kubermatic-bot kubermatic-bot added release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jan 4, 2024
Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 4, 2024
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: f685d1f5af2a4f91deaf62ff0acec58a44f66c64

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xmudrii

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 4, 2024
@kubermatic-bot kubermatic-bot merged commit 755e37e into kubermatic:main Jan 4, 2024
14 checks passed
@kubermatic-bot kubermatic-bot added this to the KubeOne 1.8 milestone Jan 4, 2024
@kron4eg kron4eg deleted the credsfile_over_env branch January 4, 2024 13:05
@xmudrii xmudrii added the backport-not-eligible Denotes a PR or issue that cannot be backported to earlier release branches. label Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. backport-not-eligible Denotes a PR or issue that cannot be backported to earlier release branches. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. docs/none Denotes a PR that doesn't need documentation (changes). kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Credentials file should take precedence over environment variables
3 participants