Documentation ¶
Index ¶
- Constants
- Variables
- func GetScc() *secv1.SecurityContextConstraints
- func ImageCreate(c client.Client) (int, error)
- func ImageDelete(c client.Client) (int, error)
- func InitializeImageGenerator(client client.Client) error
- func IsEnabled(fgStatus *FeatureGateStatus, feature string) bool
- func IsOpenShift() (bool, error)
- type ConfigMapEventHandler
- func (ch *ConfigMapEventHandler) Create(ctx context.Context, event event.CreateEvent, ...)
- func (ch *ConfigMapEventHandler) Delete(ctx context.Context, event event.DeleteEvent, ...)
- func (ch *ConfigMapEventHandler) Generic(ctx context.Context, event event.GenericEvent, ...)
- func (ch *ConfigMapEventHandler) Update(ctx context.Context, event event.UpdateEvent, ...)
- type FeatureGateState
- type FeatureGateStatus
- type ImageGenerator
- type KataConfigHandler
- func (kh *KataConfigHandler) Create(ctx context.Context, event event.CreateEvent, ...)
- func (kh *KataConfigHandler) Delete(ctx context.Context, event event.DeleteEvent, ...)
- func (kh *KataConfigHandler) Generic(context.Context, event.GenericEvent, workqueue.RateLimitingInterface)
- func (kh *KataConfigHandler) Update(ctx context.Context, event event.UpdateEvent, ...)
- type KataConfigOpenShiftReconciler
- type McpEventHandler
- func (eh *McpEventHandler) Create(ctx context.Context, event event.CreateEvent, ...)
- func (eh *McpEventHandler) Delete(ctx context.Context, event event.DeleteEvent, ...)
- func (eh *McpEventHandler) Generic(ctx context.Context, event event.GenericEvent, ...)
- func (eh *McpEventHandler) Update(ctx context.Context, event event.UpdateEvent, ...)
- type NodeEventHandler
- func (eh *NodeEventHandler) Create(ctx context.Context, event event.CreateEvent, ...)
- func (eh *NodeEventHandler) Delete(ctx context.Context, event event.DeleteEvent, ...)
- func (eh *NodeEventHandler) Generic(ctx context.Context, event event.GenericEvent, ...)
- func (eh *NodeEventHandler) Update(ctx context.Context, event event.UpdateEvent, ...)
- type SecretReconciler
Constants ¶
const ( FgConfigMapName = "osc-feature-gates" ConfidentialFeatureGate = "confidential" LayeredImageDeployment = "layeredImageDeployment" )
const ( AWSProvider = "aws" AzureProvider = "azure" LibvirtProvider = "libvirt" )
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
const ( PodVMImageJobCompleted = "PodVMImageJobCompleted" PodVMImageJobFailed = "PodVMImageJobFailed" PodVMImageJobRunning = "PodVMImageJobRunning" PodVMImageJobStatusUnknown = "PodVMImageJobStatusUnknown" PodVMImageUnsupportedProvider = "PodVMImageUnsupportedProvider" )
Event Constants for the PodVM Image Job
const ( OperatorNamespace = "openshift-sandboxed-containers-operator" DEFAULT_PEER_PODS = "10" )
const ( // "Working" NodeWorking = mcfgconsts.MachineConfigDaemonStateWorking // "Done" NodeDone = mcfgconsts.MachineConfigDaemonStateDone // "Degraded" NodeDegraded = mcfgconsts.MachineConfigDaemonStateDegraded )
const (
FeatureGatesCM = "osc-feature-gates"
)
const (
LayeredImageDeployCm = "layered-image-deploy-cm"
)
Variables ¶
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
var DefaultFeatureGates = map[string]bool{ ConfidentialFeatureGate: false, LayeredImageDeployment: false, }
Functions ¶
func GetScc ¶ added in v1.3.2
func GetScc() *secv1.SecurityContextConstraints
func ImageCreate ¶ added in v1.5.0
ImageCreate creates a podvm image for a cloud provider if not present
func ImageDelete ¶ added in v1.5.0
ImageDelete deletes a podvm image for a cloud provider if present
func InitializeImageGenerator ¶ added in v1.6.0
func IsEnabled ¶ added in v1.7.0
func IsEnabled(fgStatus *FeatureGateStatus, feature string) bool
func IsOpenShift ¶
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 (ch *ConfigMapEventHandler) Create(ctx context.Context, event event.CreateEvent, queue workqueue.RateLimitingInterface)
func (*ConfigMapEventHandler) Delete ¶ added in v1.6.0
func (ch *ConfigMapEventHandler) Delete(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface)
func (*ConfigMapEventHandler) Generic ¶ added in v1.6.0
func (ch *ConfigMapEventHandler) Generic(ctx context.Context, event event.GenericEvent, queue workqueue.RateLimitingInterface)
func (*ConfigMapEventHandler) Update ¶ added in v1.6.0
func (ch *ConfigMapEventHandler) Update(ctx context.Context, event event.UpdateEvent, queue workqueue.RateLimitingInterface)
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 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
func (kh *KataConfigHandler) Create(ctx context.Context, event event.CreateEvent, queue workqueue.RateLimitingInterface)
kataConfig created, create credentialRequest if peerPods enabled
func (*KataConfigHandler) Delete ¶ added in v1.6.0
func (kh *KataConfigHandler) Delete(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface)
kataConfig deleted, delete credentialRequest if peerPods enabled
func (*KataConfigHandler) Generic ¶ added in v1.6.0
func (kh *KataConfigHandler) Generic(context.Context, event.GenericEvent, workqueue.RateLimitingInterface)
func (*KataConfigHandler) Update ¶ added in v1.6.0
func (kh *KataConfigHandler) Update(ctx context.Context, event event.UpdateEvent, queue workqueue.RateLimitingInterface)
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) 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 (eh *McpEventHandler) Create(ctx context.Context, event event.CreateEvent, queue workqueue.RateLimitingInterface)
func (*McpEventHandler) Delete ¶ added in v1.4.0
func (eh *McpEventHandler) Delete(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface)
func (*McpEventHandler) Generic ¶ added in v1.4.0
func (eh *McpEventHandler) Generic(ctx context.Context, event event.GenericEvent, queue workqueue.RateLimitingInterface)
func (*McpEventHandler) Update ¶ added in v1.4.0
func (eh *McpEventHandler) Update(ctx context.Context, event event.UpdateEvent, queue workqueue.RateLimitingInterface)
type NodeEventHandler ¶ added in v1.4.0
type NodeEventHandler struct {
// contains filtered or unexported fields
}
func (*NodeEventHandler) Create ¶ added in v1.4.0
func (eh *NodeEventHandler) Create(ctx context.Context, event event.CreateEvent, queue workqueue.RateLimitingInterface)
func (*NodeEventHandler) Delete ¶ added in v1.4.0
func (eh *NodeEventHandler) Delete(ctx context.Context, event event.DeleteEvent, queue workqueue.RateLimitingInterface)
func (*NodeEventHandler) Generic ¶ added in v1.4.0
func (eh *NodeEventHandler) Generic(ctx context.Context, event event.GenericEvent, queue workqueue.RateLimitingInterface)
func (*NodeEventHandler) Update ¶ added in v1.4.0
func (eh *NodeEventHandler) Update(ctx context.Context, event event.UpdateEvent, queue workqueue.RateLimitingInterface)
type SecretReconciler ¶ added in v1.6.0
SecretReconciler reconciles a Secret object
func (*SecretReconciler) Reconcile ¶ added in v1.6.0
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.