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

fix: ensure kubeconfig exists #146

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

abuchanan-airbyte
Copy link
Collaborator

I'm trying to fix errors like the following, which I see quite often:

unable to initialize local command: error communicating with kubernetes: could not create rest config: stat /home/some-user-name/.airbyte/abctl/abctl.kubeconfig: no such file or directory

I can reproduce this locally if I

  1. abctl local install
  2. rm ~/.airbyte/abctl/abctl.kubeconfig
  3. abctl local install

Maybe people are removing the .airbyte/abctl directory, thinking that will reset some things, or maybe they're moving the kubeconfig file somewhere for easy reference. Anyway, it's easy to make sure it always exists.

@abuchanan-airbyte abuchanan-airbyte requested a review from a team as a code owner November 8, 2024 16:23
if err := os.MkdirAll(filepath.Dir(p.Kubeconfig), 0766); err != nil {
return nil, fmt.Errorf("unable to create directory %s: %v", p.Kubeconfig, err)
}

kindProvider := cluster.NewProvider(cluster.ProviderWithLogger(&kindLogger{pterm: pterm.Debug}))
kindProvider.ExportKubeConfig(p.ClusterName, p.Kubeconfig, false)
Copy link
Member

Choose a reason for hiding this comment

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

This method returns an error, should we do something with it?

Copy link
Member

@colesnodgrass colesnodgrass left a comment

Choose a reason for hiding this comment

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

Add the ExportKubeConfig error to the debug log and then 👍🏻

@abuchanan-airbyte abuchanan-airbyte merged commit 4016828 into main Nov 8, 2024
2 checks passed
@abuchanan-airbyte abuchanan-airbyte deleted the abuch/ensure-kubeconfig-exists branch November 8, 2024 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants