remoteclient

package
v0.0.0-...-5cbd3cb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 34 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultAccessTokenSource

func GetDefaultAccessTokenSource(ctx context.Context) (oauth2.TokenSource, error)

GetDefaultAccessTokenSource gets the default gcloud access token, assuming the user has logged in with gcloud (the application-default context). This is intended for local development.

Types

type ProjectCache

type ProjectCache struct {
}

func (*ProjectCache) Init

func (r *ProjectCache) Init(mgr ctrl.Manager) error

Init performs one-off initialization of the object.

func (*ProjectCache) LookupByProjectID

func (r *ProjectCache) LookupByProjectID(ctx context.Context, projectID string, tokenSource oauth2.TokenSource) (*ProjectInfo, error)

type ProjectInfo

type ProjectInfo struct {
	ProjectID     string
	ProjectNumber int64
}

type Reference

type Reference interface {
	GetAPIVersion() string
	GetKind() string
	GetName() string
	GetNamespace() string
}

type RemoteClient

type RemoteClient struct {
	// contains filtered or unexported fields
}

func (*RemoteClient) DynamicClient

func (r *RemoteClient) DynamicClient() (dynamic.Interface, error)

func (*RemoteClient) RESTMapper

func (r *RemoteClient) RESTMapper() (meta.RESTMapper, error)

type RemoteClientGetter

type RemoteClientGetter struct {
	client.Client
	// contains filtered or unexported fields
}

func (*RemoteClientGetter) GetRemoteClient

func (r *RemoteClientGetter) GetRemoteClient(ctx context.Context, clusterRef Reference, defaultNamespace string) (*RemoteClient, error)

func (*RemoteClientGetter) Init

func (r *RemoteClientGetter) Init(mgr ctrl.Manager) error

Init performs one-off initialization of the object.

type WorkloadIdentityHelper

type WorkloadIdentityHelper struct {
	// contains filtered or unexported fields
}

WorkloadIdentityHelper is a helper class that does the exchanges needed for workload identity.

func (*WorkloadIdentityHelper) GetGcloudAccessTokenSource

func (r *WorkloadIdentityHelper) GetGcloudAccessTokenSource(ctx context.Context, kubeServiceAccount types.NamespacedName, gcpServiceAccount string) (oauth2.TokenSource, error)

GetGcloudAccessTokenSource does the exchange to get a token for the specified GCP ServiceAccount.

func (*WorkloadIdentityHelper) Init

func (r *WorkloadIdentityHelper) Init(restConfig *rest.Config) error

Init should be called before using a WorkloadIdentityHelper

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL