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

Ensure that .kube/config is written once microk8s is active #85

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

addyess
Copy link
Member

@addyess addyess commented Sep 25, 2024

Overview

Addresses regression from #82 raised in #84

since sg no longer is running commands, we can't use the shell redirects it used to employ -- one such redirect was for writing the .kube/config out to a file.

Details

  • Created a checkOutput method to more easily capture output from stdout
  • created a microk8sKubeConfig method to capture output from a exec_as_microk8s call and write to a file
  • add an integration test to confirm that kubectl works out of the box

@addyess addyess changed the title Ensure that .kube/config is written out once microk8s is active Ensure that .kube/config is written once microk8s is active Sep 25, 2024
@addyess addyess force-pushed the issues/84/sg-to-sudo-regressoin branch from 860b870 to e4d1ac8 Compare September 25, 2024 16:22
@addyess
Copy link
Member Author

addyess commented Sep 25, 2024

@deusebio would you try this branch in your repo and see if this resolves your issues?

@addyess addyess force-pushed the issues/84/sg-to-sudo-regressoin branch from e4d1ac8 to d7ea0aa Compare September 25, 2024 16:39
@pytest.mark.usefixtures("ops_test")
async def test_kubectl():
# Confirms that kubectl has access to a functional kubeconfig @ $HOME/.kube/config
out = check_output(["kubectl", "get", "pods", "-A"], text=True)
Copy link

Choose a reason for hiding this comment

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

+1

Copy link

@DnPlas DnPlas left a comment

Choose a reason for hiding this comment

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

Thanks @addyess !

For us this was failing in various CIs. Here was failing using @main and here the same operation passed using @issues/84/sg-to-sudo-regressoin.

@addyess addyess merged commit 79bd232 into main Sep 25, 2024
40 of 42 checks passed
@addyess addyess deleted the issues/84/sg-to-sudo-regressoin branch September 25, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants