dextarget

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppTarget

type AppTarget struct {
	*v1alpha1.App
}

AppTarget wraps a Giant Swarm App CR to implement the DexTarget interface

func NewAppTarget

func NewAppTarget(app *v1alpha1.App) *AppTarget

NewAppTarget creates a new AppTarget wrapper

func (*AppTarget) AddSecretConfig

func (a *AppTarget) AddSecretConfig(secretName, secretNamespace string) error

func (*AppTarget) AttachSecretConfig added in v0.16.2

func (a *AppTarget) AttachSecretConfig(ctx context.Context, c client.Client) (bool, error)

func (*AppTarget) GetClusterLabel

func (a *AppTarget) GetClusterLabel() string

func (*AppTarget) GetClusterValuesConfigMapRef

func (a *AppTarget) GetClusterValuesConfigMapRef() (name, namespace string)

func (*AppTarget) GetNamespacedName

func (a *AppTarget) GetNamespacedName() types.NamespacedName

func (*AppTarget) GetObject

func (a *AppTarget) GetObject() client.Object

func (*AppTarget) GetOrganizationLabel

func (a *AppTarget) GetOrganizationLabel() string

func (*AppTarget) GetTargetType

func (a *AppTarget) GetTargetType() string

func (*AppTarget) HasClusterValuesConfig

func (a *AppTarget) HasClusterValuesConfig() bool

func (*AppTarget) HasSecretConfig

func (a *AppTarget) HasSecretConfig(secretName string) bool

func (*AppTarget) IsBeingDeleted

func (a *AppTarget) IsBeingDeleted() bool

func (*AppTarget) ManagesSecretConfig added in v0.16.2

func (a *AppTarget) ManagesSecretConfig() bool

ManagesSecretConfig returns true — for App CRs dex-operator injects the secret reference into spec.extraConfigs directly.

func (*AppTarget) RemoveSecretConfig

func (a *AppTarget) RemoveSecretConfig(secretName, secretNamespace string) error

func (*AppTarget) UserConnectorOwners added in v0.20.0

func (a *AppTarget) UserConnectorOwners(ctx context.Context, c client.Client) ([]string, error)

type DexTarget

type DexTarget interface {
	client.Object

	// GetNamespacedName returns the namespaced name of the target
	GetNamespacedName() types.NamespacedName

	// GetClusterLabel returns the cluster label value if present
	GetClusterLabel() string

	// GetOrganizationLabel returns the organization label value if present
	GetOrganizationLabel() string

	// UserConnectorOwners returns the owners that have connectors set under
	// oidc.<owner>.connectors in the user config of the target
	UserConnectorOwners(ctx context.Context, client client.Client) ([]string, error)

	// HasClusterValuesConfig returns true if the target has a cluster values configmap reference
	HasClusterValuesConfig() bool

	// GetClusterValuesConfigMapRef returns the name and namespace of the cluster values configmap
	GetClusterValuesConfigMapRef() (name, namespace string)

	// HasSecretConfig returns true if the dex secret config is already present
	HasSecretConfig(secretName string) bool

	// AddSecretConfig adds the dex secret config reference to the target
	// For App CR: adds to .spec.extraConfigs with priority
	// For HelmRelease: does nothing
	AddSecretConfig(secretName, secretNamespace string) error

	// RemoveSecretConfig removes the dex secret config reference from the target
	RemoveSecretConfig(secretName, secretNamespace string) error

	// IsBeingDeleted returns true if the target is being deleted
	IsBeingDeleted() bool

	// GetTargetType returns the type of the target ("App" or "HelmRelease")
	GetTargetType() string

	// GetObject returns the underlying Kubernetes object for use with client.Update
	// This is needed because the wrapper types don't have GVK registered in the scheme
	GetObject() client.Object

	// AttachSecretConfig persists the secret config reference added by AddSecretConfig
	// to the target. For App CRs this performs a client Update; for HelmReleases it does nothing.
	// Returns true if the target was actually modified.
	AttachSecretConfig(ctx context.Context, c client.Client) (bool, error)

	// ManagesSecretConfig returns true if dex-operator should inject and manage
	// the dex config secret reference directly on this target.
	// True for App CRs. False for HelmReleases: Flux owns spec.valuesFrom, so
	// the manifest has to reference the secret.
	ManagesSecretConfig() bool
}

DexTarget is an interface that abstracts the common functionality between Giant Swarm App CRs and Flux HelmReleases for dex-operator configuration injection.

type HelmReleaseTarget

type HelmReleaseTarget struct {
	*helmv2.HelmRelease
}

HelmReleaseTarget wraps a Flux HelmRelease to implement the DexTarget interface

func NewHelmReleaseTarget

func NewHelmReleaseTarget(hr *helmv2.HelmRelease) *HelmReleaseTarget

NewHelmReleaseTarget creates a new HelmReleaseTarget wrapper

func (*HelmReleaseTarget) AddSecretConfig

func (h *HelmReleaseTarget) AddSecretConfig(secretName, secretNamespace string) error

AddSecretConfig does nothing: dex-operator never changes spec.valuesFrom on a HelmRelease. The manifest has to reference the secret.

func (*HelmReleaseTarget) AttachSecretConfig added in v0.16.2

func (h *HelmReleaseTarget) AttachSecretConfig(ctx context.Context, c client.Client) (bool, error)

AttachSecretConfig does nothing, see AddSecretConfig.

func (*HelmReleaseTarget) GetClusterLabel

func (h *HelmReleaseTarget) GetClusterLabel() string

func (*HelmReleaseTarget) GetClusterValuesConfigMapRef

func (h *HelmReleaseTarget) GetClusterValuesConfigMapRef() (name, namespace string)

func (*HelmReleaseTarget) GetNamespacedName

func (h *HelmReleaseTarget) GetNamespacedName() types.NamespacedName

func (*HelmReleaseTarget) GetObject

func (h *HelmReleaseTarget) GetObject() client.Object

func (*HelmReleaseTarget) GetOrganizationLabel

func (h *HelmReleaseTarget) GetOrganizationLabel() string

func (*HelmReleaseTarget) GetTargetType

func (h *HelmReleaseTarget) GetTargetType() string

func (*HelmReleaseTarget) HasClusterValuesConfig

func (h *HelmReleaseTarget) HasClusterValuesConfig() bool

func (*HelmReleaseTarget) HasSecretConfig

func (h *HelmReleaseTarget) HasSecretConfig(secretName string) bool

HasSecretConfig returns true if the dex config secret is referenced in valuesFrom.

func (*HelmReleaseTarget) IsBeingDeleted

func (h *HelmReleaseTarget) IsBeingDeleted() bool

func (*HelmReleaseTarget) ManagesSecretConfig added in v0.16.2

func (h *HelmReleaseTarget) ManagesSecretConfig() bool

ManagesSecretConfig returns false: Flux owns spec.valuesFrom.

func (*HelmReleaseTarget) RemoveSecretConfig

func (h *HelmReleaseTarget) RemoveSecretConfig(secretName, secretNamespace string) error

RemoveSecretConfig does nothing, see AddSecretConfig.

func (*HelmReleaseTarget) UserConnectorOwners added in v0.20.0

func (h *HelmReleaseTarget) UserConnectorOwners(ctx context.Context, c client.Client) ([]string, error)

Jump to

Keyboard shortcuts

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