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

multus: revise kube config/client loading #12611

Merged
merged 1 commit into from
Jul 28, 2023

Conversation

BlaineEXE
Copy link
Member

@BlaineEXE BlaineEXE commented Jul 27, 2023

The previous client loader routine assumed KUBECONFIG would be set in CLI environments. Instead, now take this approach:

  1. If KUBECONFIG is set, that is the de-facto override that informs the tool it is being run in a CLI environment.
  2. Otherwise, try creating a client from the default kube config file.
  3. If that fails, assume the tool is running in a Kubernetes Pod.

This will continue supporting dev/test environments so that building the rook container is not necessary for development. It also allows support for highly opinionated environments (like deployed by OpenShift CSVs) where it's not possible to install the Rook operator without also deploying a CephCluster.

Description of your changes:

Which issue is resolved by this Pull Request:
Resolves #12603

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: If this is only a documentation change, add the label skip-ci on the PR.
  • Reviewed the developer guide on Submitting a Pull Request
  • Pending release notes updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

Copy link
Member

@travisn travisn left a comment

Choose a reason for hiding this comment

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

just a small suggestion

cmd/rook/rook/rook.go Show resolved Hide resolved
@BlaineEXE BlaineEXE requested a review from travisn July 27, 2023 21:06
cmd/rook/rook/rook.go Show resolved Hide resolved
@BlaineEXE BlaineEXE force-pushed the multus-revise-client-loading branch from 23b9346 to 2fe7ee7 Compare July 27, 2023 21:31
The previous client loader routine assumed KUBECONFIG would be set in
CLI environments. Instead, now take this approach:

1. If KUBECONFIG is set, that is the de-facto override that informs the
   tool it is being run in a CLI environment.
2. Otherwise, try creating a client from the default kube config file.
3. If that fails, assume the tool is running in a Kubernetes Pod.

This will continue supporting dev/test environments so that building the
rook container is not necessary for development. It also allows support
for highly opinionated environments (like deployed by OpenShift CSVs)
where it's not possible to install the Rook operator without also
deploying a CephCluster.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
@BlaineEXE BlaineEXE force-pushed the multus-revise-client-loading branch from 2fe7ee7 to cc9514a Compare July 28, 2023 15:50
@BlaineEXE BlaineEXE merged commit 1cf2079 into rook:master Jul 28, 2023
39 of 50 checks passed
@BlaineEXE BlaineEXE deleted the multus-revise-client-loading branch July 28, 2023 17:25
BlaineEXE added a commit that referenced this pull request Jul 28, 2023
multus: revise kube config/client loading (backport #12611)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

multus: validation tool doesn't support all CLI environments
2 participants