kubernetes

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2025 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// SecretTypeGitRepository is the type for git repository secrets
	SecretTypeGitRepository = "kubernetes.io/git-repository"

	// AnnotationManagedBy indicates the secret is managed by this controller
	AnnotationManagedBy = "flux-extension-controller.nrfcloud.com/managed-by"

	// AnnotationTokenExpiry stores the token expiration time
	AnnotationTokenExpiry = "flux-extension-controller.nrfcloud.com/token-expiry"

	// AnnotationRepositoryURL stores the repository URL
	AnnotationRepositoryURL = "flux-extension-controller.nrfcloud.com/repository-url"
)

Variables

View Source
var (
	// ErrSecretNotManagedByController indicates a secret exists but is not managed by this controller
	ErrSecretNotManagedByController = errors.New("secret exists but is not managed by flux-extension-controller")
)

Functions

This section is empty.

Types

type SecretManager

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

SecretManager handles Kubernetes secret operations for Git repositories

func NewSecretManager

func NewSecretManager(client client.Client) *SecretManager

NewSecretManager creates a new secret manager

func (*SecretManager) CreateOrUpdateSecret

func (sm *SecretManager) CreateOrUpdateSecret(
	ctx context.Context,
	namespace, name string,
	token *github.InstallationToken,
	repositoryURL string,
	owner metav1.Object,
) error

CreateOrUpdateSecret creates or updates a Git repository secret with the GitHub token

func (*SecretManager) GetSecret

func (sm *SecretManager) GetSecret(ctx context.Context, namespace, name string) (*corev1.Secret, error)

GetSecret retrieves a secret by name and namespace

func (*SecretManager) GetTokenExpiry

func (sm *SecretManager) GetTokenExpiry(secret *corev1.Secret) (time.Time, error)

GetTokenExpiry returns the token expiration time from secret annotations

func (*SecretManager) IsSecretManagedByController

func (sm *SecretManager) IsSecretManagedByController(secret *corev1.Secret) bool

IsSecretManagedByController checks if a secret is managed by this controller

func (*SecretManager) NeedsTokenRefresh

func (sm *SecretManager) NeedsTokenRefresh(secret *corev1.Secret, refreshThreshold time.Duration) (bool, error)

NeedsTokenRefresh checks if the secret's token needs to be refreshed

func (*SecretManager) ValidateSecretOwnership

func (sm *SecretManager) ValidateSecretOwnership(ctx context.Context, namespace, name string, repositoryURL string) error

ValidateSecretOwnership checks if a secret can be managed by this controller

Jump to

Keyboard shortcuts

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