controllers

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FgConfigMapName         = "osc-feature-gates"
	ConfidentialFeatureGate = "confidential"
	LayeredImageDeployment  = "layeredImageDeployment"
)
View Source
const (
	AWSProvider     = "aws"
	AzureProvider   = "azure"
	LibvirtProvider = "libvirt"
)
View Source
const (
	ImageCreatedSuccessfully = iota
	ImageDeletedSuccessfully
	RequeueNeeded
	ImageJobRunning
	ImageJobCompleted
	ImageJobFailed
	ImageCreationInProgress
	ImageDeletionInProgress
	UnsupportedPodVMImageProvider
	ImageCreationFailed        = -1
	ImageDeletionFailed        = -1
	CheckingJobStatusFailed    = -1
	ImageCreationStatusUnknown = -2
	ImageDeletionStatusUnknown = -2
)

Return values for ImageCreate and ImageDelete

View Source
const (
	PodVMImageJobCompleted        = "PodVMImageJobCompleted"
	PodVMImageJobFailed           = "PodVMImageJobFailed"
	PodVMImageJobRunning          = "PodVMImageJobRunning"
	PodVMImageJobStatusUnknown    = "PodVMImageJobStatusUnknown"
	PodVMImageUnsupportedProvider = "PodVMImageUnsupportedProvider"
)

Event Constants for the PodVM Image Job

View Source
const (
	OperatorNamespace = "openshift-sandboxed-containers-operator"

	DEFAULT_PEER_PODS = "10"
)
View Source
const (
	// "Working"
	NodeWorking = mcfgconsts.MachineConfigDaemonStateWorking
	// "Done"
	NodeDone = mcfgconsts.MachineConfigDaemonStateDone
	// "Degraded"
	NodeDegraded = mcfgconsts.MachineConfigDaemonStateDegraded
)
View Source
const (
	FeatureGatesCM = "osc-feature-gates"
)
View Source
const (
	LayeredImageDeployCm = "layered-image-deploy-cm"
)

Variables

View Source
var (
	ErrInitializingImageGenerator = errors.New("error initializing ImageGenerator instance")
	ErrUnsupportedCloudProvider   = errors.New("unsupported cloud provider, skipping image creation")
	ErrValidatingPeerPodsConfigs  = errors.New("error validating peer-pods-cm and peer-pods-secret")
	ErrCreatingImageConfigMap     = errors.New("error creating podvm image configMap from file")
	ErrUpdatingImageConfigMap     = errors.New("error updating podvm image configMap")
	ErrCreatingImageJob           = errors.New("error creating image job from yaml file")
	ErrCheckingJobStatus          = errors.New("error checking job status")
	ErrDeletingJob                = errors.New("error deleting job")
)

Custom error types

Functions

func GetScc added in v1.3.2

func ImageCreate added in v1.5.0

func ImageCreate(c client.Client) (int, error)

ImageCreate creates a podvm image for a cloud provider if not present

func ImageDelete added in v1.5.0

func ImageDelete(c client.Client) (int, error)

ImageDelete deletes a podvm image for a cloud provider if present

func InitializeImageGenerator added in v1.6.0

func InitializeImageGenerator(client client.Client) error

func IsEnabled added in v1.7.0

func IsEnabled(fgStatus *FeatureGateStatus, feature string) bool

func IsOpenShift

func IsOpenShift() (bool, error)

IsOpenShift detects if we are running in OpenShift using the discovery client

Types

type ConfigMapEventHandler added in v1.6.0

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

func (*ConfigMapEventHandler) Create added in v1.6.0

func (*ConfigMapEventHandler) Delete added in v1.6.0

func (*ConfigMapEventHandler) Generic added in v1.6.0

func (*ConfigMapEventHandler) Update added in v1.6.0

type FeatureGateState added in v1.6.0

type FeatureGateState int

Create enum to represent the state of the feature gates While today we just have two states, we retain the flexibility in case we want to introduce some additional states.

const (
	Enabled FeatureGateState = iota
	Disabled
)

type FeatureGateStatus added in v1.7.0

type FeatureGateStatus struct {
	FeatureGates map[string]bool
}

type ImageGenerator added in v1.5.0

type ImageGenerator struct {
	CMimageIDKey string
	// contains filtered or unexported fields
}

func GetImageGenerator added in v1.6.0

func GetImageGenerator() *ImageGenerator

GetImageGenerator returns the global ImageGenerator instance

type KataConfigHandler added in v1.6.0

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

func (*KataConfigHandler) Create added in v1.6.0

kataConfig created, create credentialRequest if peerPods enabled

func (*KataConfigHandler) Delete added in v1.6.0

kataConfig deleted, delete credentialRequest if peerPods enabled

func (*KataConfigHandler) Generic added in v1.6.0

func (*KataConfigHandler) Update added in v1.6.0

kataConfig updated, create/delete credentialRequest if peerPods enabled/disabled

type KataConfigOpenShiftReconciler

type KataConfigOpenShiftReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme

	ImgMc *mcfgv1.MachineConfig
	// contains filtered or unexported fields
}

KataConfigOpenShiftReconciler reconciles a KataConfig object

func (*KataConfigOpenShiftReconciler) NewFeatureGateStatus added in v1.7.0

func (r *KataConfigOpenShiftReconciler) NewFeatureGateStatus() (*FeatureGateStatus, error)

This method returns a new FeatureGateStatus object that contains the status of the feature gates defined in the ConfigMap in the namespace Return default values if the ConfigMap is not found. Return values from the ConfigMap if the ConfigMap is not found. Use default values for missing entries in the ConfigMap. Return an error for any other reason, such as an API error.

func (*KataConfigOpenShiftReconciler) Reconcile

func (*KataConfigOpenShiftReconciler) SetupWithManager

func (r *KataConfigOpenShiftReconciler) SetupWithManager(mgr ctrl.Manager) error

type McpEventHandler added in v1.4.0

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

func (*McpEventHandler) Create added in v1.4.0

func (*McpEventHandler) Delete added in v1.4.0

func (*McpEventHandler) Generic added in v1.4.0

func (*McpEventHandler) Update added in v1.4.0

type NodeEventHandler added in v1.4.0

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

func (*NodeEventHandler) Create added in v1.4.0

func (*NodeEventHandler) Delete added in v1.4.0

func (*NodeEventHandler) Generic added in v1.4.0

func (*NodeEventHandler) Update added in v1.4.0

type SecretReconciler added in v1.6.0

type SecretReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

SecretReconciler reconciles a Secret object

func (*SecretReconciler) Reconcile added in v1.6.0

func (r *SecretReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconciles cco-secret secret based on the secretsFilterPredicate and maps the cco-secret created by the cloud-credentials-operator to peer-pods compatible secret KataConfigs are handled by the KataConfigHandler to create/delete credentialRequests from cloud-credentials-operator see: https://github.com/openshift/cloud-credential-operator/tree/master?tab=readme-ov-file#openshift-cloud-credential-operator

func (*SecretReconciler) SetupWithManager added in v1.6.0

func (r *SecretReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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