Skip to content

Commit

Permalink
Fix for dynamic kubeconfig creation
Browse files Browse the repository at this point in the history
  • Loading branch information
akgalwas committed Sep 26, 2023
1 parent dd63eb8 commit 7dc6932
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package main
import (
"flag"
"fmt"
"github.com/gardener/gardener/pkg/apis/core/v1beta1"

Check failure on line 22 in cmd/main.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default (gci)
"github.com/pkg/errors"
"os"
"time"

Check failure on line 26 in cmd/main.go

View workflow job for this annotation

GitHub Actions / lint

File is not `gci`-ed with --skip-generated -s standard -s default (gci)
Expand Down Expand Up @@ -152,6 +154,12 @@ func setupKubernetesKubeconfigProvider(kubeconfigPath string, namespace string,
shootClient := gardenerClientSet.Shoots(namespace)
dynamicKubeconfigAPI := gardenerClient.SubResource("adminkubeconfig")

err = v1beta1.AddToScheme(gardenerClient.Scheme())

if err != nil {
errors.Wrap(err, "Failed ")

Check failure on line 160 in cmd/main.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `errors.Wrap` is not checked (errcheck)
}

return gardener.NewKubeconfigProvider(shootClient,
dynamicKubeconfigAPI,
namespace,
Expand Down

0 comments on commit 7dc6932

Please sign in to comment.