Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Read whether a cluster is Jetpack-managed or not from the kubeconfig#10

Merged
LucilleH merged 2 commits intomainfrom
rodrigo/kc-jetpack-managed
Nov 7, 2022
Merged

Read whether a cluster is Jetpack-managed or not from the kubeconfig#10
LucilleH merged 2 commits intomainfrom
rodrigo/kc-jetpack-managed

Conversation

@ipince
Copy link
Copy Markdown
Contributor

@ipince ipince commented Nov 7, 2022

Summary

Determine whether a cluster in a kubeconfig is Jetpack-managed or not by reading its exec command in the kubeconfig. This is just a good enough/temporary solution. In the future, we should be writing this information somewhere or exposing some API that can provide this information.

How was it tested?

Tested by printing out some extra information in launchpad init and ran it against my existing kubeconfig
Screen Shot 2022-11-07 at 5 30 04 PM

Is this change backwards-compatible?

Yes

@ipince ipince requested a review from LucilleH November 7, 2022 22:23
return &kubeConfigCluster{
kubeContextName: kubeContextName,
local: isLocal,
jetpackManaged: isJetpackManaged,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we need to update the IsJetpackManaged()? It looks at c.managed field instead

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

hm?

It looks at:

func (c *kubeConfigCluster) IsJetpackManaged() bool {
	return c.jetpackManaged
}

But relatedly, IsRemoteUnmanaged() should change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

^ done

@LucilleH LucilleH merged commit daf2752 into main Nov 7, 2022
@LucilleH LucilleH deleted the rodrigo/kc-jetpack-managed branch November 7, 2022 23:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants