Skip to content

Commit

Permalink
inject client into actuator config
Browse files Browse the repository at this point in the history
  • Loading branch information
phyrog committed Sep 24, 2024
1 parent 8bc6907 commit 0ec1859
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/controller/lifecycle/actuator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (

"github.com/gardener/gardener/extensions/pkg/controller/extension"
extensionsv1alpha1 "github.com/gardener/gardener/pkg/apis/extensions/v1alpha1"
gardenclient "github.com/gardener/gardener/pkg/client/kubernetes"
"github.com/gardener/gardener/pkg/extensions"
"github.com/liquid-reply/gardener-extension-shoot-kubecost/pkg/constants"

Expand Down Expand Up @@ -105,3 +106,14 @@ func getKubeCostApiKey(secretData map[string][]byte) (string, error) {
func createShootResourceKubeCostInstall(apiKey string) (map[string][]byte, error) {
return nil, nil
}

func (a *actuator) InjectClient(client client.Client) error {
a.client = client
clientInterface, err := gardenclient.NewClientFromSecret(context.Background(), a.client, "garden", "gardenlet-kubeconfig")
if err != nil {
return err
}
clientInterface.Start(context.Background())
a.clientGardenlet = clientInterface.Client()
return nil
}

0 comments on commit 0ec1859

Please sign in to comment.