@@ -99,7 +99,7 @@ func (r *runners) kubeconfigCluster(_ *cobra.Command, args []string) error {
9999 }
100100
101101 if cluster .Status != types .ClusterStatusRunning {
102- return errors .Errorf ("cluster %s is not running, please check the cluster status " , clusterID )
102+ return errors .Errorf ("cluster %s is not running, current status is %s " , clusterID , cluster . Status )
103103 }
104104
105105 kubeconfig , err := r .kotsAPI .GetClusterKubeconfig (clusterID )
@@ -121,11 +121,11 @@ func (r *runners) kubeconfigCluster(_ *cobra.Command, args []string) error {
121121 if r .args .kubeconfigPath != "" {
122122 dir := filepath .Dir (r .args .kubeconfigPath )
123123 if _ , err := os .Stat (dir ); os .IsNotExist (err ) {
124- if err := os .MkdirAll (dir , 0755 ); err != nil {
124+ if err := os .MkdirAll (dir , 0o755 ); err != nil {
125125 return errors .Wrap (err , "create kubeconfig dir" )
126126 }
127127 }
128- if err := os .WriteFile (r .args .kubeconfigPath , kubeconfig , 0644 ); err != nil {
128+ if err := os .WriteFile (r .args .kubeconfigPath , kubeconfig , 0o644 ); err != nil {
129129 return errors .Wrap (err , "write kubeconfig" )
130130 }
131131
@@ -144,7 +144,7 @@ func (r *runners) kubeconfigCluster(_ *cobra.Command, args []string) error {
144144 if _ , err := tmpFile .Write (kubeconfig ); err != nil {
145145 return errors .Wrap (err , "write kubeconfig file" )
146146 }
147- if err := tmpFile .Chmod (0600 ); err != nil {
147+ if err := tmpFile .Chmod (0o600 ); err != nil {
148148 return errors .Wrap (err , "chmod kubeconfig file" )
149149 }
150150
0 commit comments