Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct { Type CredentialsType ServiceAccountJSON []byte ImpersonateConfig *ImpersonateConfig }
func NewADCCredentials ¶
func NewADCCredentials() *Credentials
func NewServiceAccountImpersonate ¶
func NewServiceAccountImpersonate(targetServiceAccount string, delegates []string) *Credentials
func NewServiceAccountJSONCredentials ¶
func NewServiceAccountJSONCredentials(json []byte) *Credentials
func (*Credentials) TokenSource ¶
func (c *Credentials) TokenSource(ctx context.Context) (oauth2.TokenSource, error)
TokenSource create oauth2.TokenSource for Credentials. Note: We can specify scopes needed for spanner-autoscaler but it does increase maintenance cost. We should already use least privileged Google Service Accounts so it use cloudPlatformScope.
type CredentialsType ¶
type CredentialsType int
const ( CredentialsTypeADC CredentialsType = iota CredentialsTypeServiceAccountJSON CredentialsTypeImpersonation )
type ImpersonateConfig ¶
type Syncer ¶
type Syncer interface { // Start starts synchronization of resource status. Start() // Stop stops synchronization of resource status. Stop() // HasCredentials checks whether the existing credentials of the syncer, match the provided one or not HasCredentials(credentials *Credentials) bool UpdateInstance(ctx context.Context, desiredProcessingUnits int) error }
Syncer represents a worker synchronizing a SpannerAutoscaler object status.
func New ¶
func New( ctx context.Context, ctrlClient ctrlclient.Client, namespacedName types.NamespacedName, credentials *Credentials, recorder record.EventRecorder, spannerClient spanner.Client, metricsClient metrics.Client, opts ...Option, ) (Syncer, error)
New returns a new Syncer.
Click to show internal directories.
Click to hide internal directories.