handlers

package
v0.0.0-...-fb43d1f Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPullSecretData

func GetPullSecretData(apiKey string) (map[string][]byte, error)

Types

type APIKeyManager

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

APIKeyManager is used for maintaining a lazy singleton for the api key

func (*APIKeyManager) GetAPIKey

func (a *APIKeyManager) GetAPIKey(ctx context.Context, account *v1.Account) (string, error)

GetAPIKey will return the api key string

func (*APIKeyManager) GetAPIKeySecret

func (a *APIKeyManager) GetAPIKeySecret(ctx context.Context, account *v1.Account) (*corev1.Secret, error)

GetAPIKeySecret will return the api key Secret object

type ConfigMapHandler

type ConfigMapHandler struct {
	Client     client.Client
	Scheme     *runtime.Scheme
	KubeClient *kubernetes.Clientset
	KeyManager *APIKeyManager
}

ConfigMapHandler is a NimHandler implementation reconciling the config for NIM

func (*ConfigMapHandler) Handle

func (c *ConfigMapHandler) Handle(ctx context.Context, account *v1.Account) HandleResponse

type HandleResponse

type HandleResponse struct {
	Continue bool
	Requeue  bool
	Error    error
}

HandleResponse is used to encapsulate handle responses. Evaluate as follows: If Error != nil, an error occurred - the reconciliation should end with an error which will trigger a requeue. If Requeue == true, the Account status was updated - the reconciliation should end and requeue. If Continue != true, the reconciliation ended and no requeue is required.

type NimHandler

type NimHandler interface {
	// Handle reconciles and returns a response indicating the next reconciliation steps
	Handle(ctx context.Context, account *v1.Account) HandleResponse
}

NimHandler is a contract for NIM handlers

type PullSecretHandler

type PullSecretHandler struct {
	Client     client.Client
	Scheme     *runtime.Scheme
	KubeClient *kubernetes.Clientset
	KeyManager *APIKeyManager
}

PullSecretHandler is a NimHandler implementation reconciling the pull secret for NIM

func (*PullSecretHandler) Handle

func (p *PullSecretHandler) Handle(ctx context.Context, account *v1.Account) HandleResponse

type TemplateHandler

type TemplateHandler struct {
	Client         client.Client
	Scheme         *runtime.Scheme
	TemplateClient *templatev1client.Clientset
}

TemplateHandler is a NimHandler implementation reconciling the template for NIM

func (*TemplateHandler) Handle

func (t *TemplateHandler) Handle(ctx context.Context, account *v1.Account) HandleResponse

type ValidationHandler

type ValidationHandler struct {
	Client     client.Client
	KeyManager *APIKeyManager
}

ValidationHandler is a NimHandler implementation validating the api key

func (*ValidationHandler) Handle

func (v *ValidationHandler) Handle(ctx context.Context, account *v1.Account) HandleResponse

Jump to

Keyboard shortcuts

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