Skip to content

Commit

Permalink
fix: handle chmod err
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavan Sokke Nagaraj committed Aug 10, 2023
1 parent fb39d1f commit ad7ddc7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/cmd/cluster_prepare.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ func (r *runners) prepareCluster(_ *cobra.Command, args []string) error {
if _, err := kubeconfigFile.Write([]byte(kubeconfig)); err != nil {
return errors.Wrap(err, "write kubeconfig file")
}
kubeconfigFile.Chmod(0644)
if err := kubeconfigFile.Chmod(0644); err != nil {
return errors.Wrap(err, "chmod kubeconfig file")
}

kubeconfigFlag := flag.String("kubeconfig", kubeconfigFile.Name(), "kubeconfig file")
restKubeConfig, err := clientcmd.BuildConfigFromFlags("", *kubeconfigFlag)
Expand Down

0 comments on commit ad7ddc7

Please sign in to comment.