Documentation
¶
Index ¶
- Constants
- Variables
- func GetConditionType(err error) string
- func GetReason(err error) string
- func GetStatus(err error) operatorv1.ConditionStatus
- func NewAvailabilityHandler(asset *asset.Asset, deploy deploy.Interface) *availabilityHandler
- func NewAvailableError(reason string, err error) error
- func NewCertGenerationHandler(client kubernetes.Interface, recorder events.Recorder, ...) *certGenerationHandler
- func NewCertReadyHandler(client kubernetes.Interface, secretLister listerscorev1.SecretLister, ...) *certReadyHandler
- func NewConfigurationHandler(client kubernetes.Interface, recorder events.Recorder, ...) *configurationHandler
- func NewDaemonSetHandler(client kubernetes.Interface, recorder events.Recorder, asset *asset.Asset, ...) *daemonSetHandler
- func NewDeploymentReadyHandler(deploy deploy.Interface) *deploymentReadyHandler
- func NewInstallReadinessError(reason string, err error) error
- func NewServiceCAConfigMapHandler(client kubernetes.Interface, recorder events.Recorder, ...) *serviceCAConfigMapHandler
- func NewServiceCertSecretHandler(client kubernetes.Interface, secretLister listerscorev1.SecretLister, ...) *serviceCertSecretHandler
- func NewTargetConfigController(operatorClient *operatorclient.RunOnceDurationOverrideClient, ...) factory.Controller
- func NewValidationHandler() *validationHandler
- func NewWebhookConfigurationHandlerHandler(client kubernetes.Interface, recorder events.Recorder, ...) *webhookConfigurationHandler
- type ConditionType
- type Deployer
- type Handler
- type HandlerError
- type ReconcileRequestContext
Constants ¶
const (
ControllerName = "runoncedurationoverride"
)
const (
ServiceCAInjectBundle = "service.beta.openshift.io/inject-cabundle"
)
Variables ¶
var ( // DefaultCertValidFor is the default duration a cert will be valid for. DefaultCertValidFor = time.Hour * 24 * 365 // DefaultCertRotateThreshold is the default threshold preceding the expiration date // the operator will make attempt(s) to rotate the certs. DefaultCertRotateThreshold = time.Hour * 48 Organization = "Red Hat, Inc." )
var ( RunOnceDurationOverrideGVK = schema.GroupVersionKind{ Group: runoncedurationoverridev1.GroupName, Version: runoncedurationoverridev1.GroupVersion, Kind: runoncedurationoverridev1.RunOnceDurationOverrideKind, } )
Functions ¶
func GetConditionType ¶
GetConditionType extracts the condition type from an error
func GetReason ¶
GetReason extracts the reason from an error if it's a HandlerError, otherwise returns a default
func GetStatus ¶
func GetStatus(err error) operatorv1.ConditionStatus
GetStatus extracts the status from an error if it's a HandlerError, otherwise returns True for Degraded
func NewAvailabilityHandler ¶
func NewAvailableError ¶
NewAvailableError creates an error that sets Available=False condition This replaces the old NewAvailableError from internal/condition
func NewCertGenerationHandler ¶
func NewCertGenerationHandler(client kubernetes.Interface, recorder events.Recorder, secretLister listerscorev1.SecretLister, configMapLister listerscorev1.ConfigMapLister, asset *asset.Asset) *certGenerationHandler
func NewCertReadyHandler ¶
func NewCertReadyHandler(client kubernetes.Interface, secretLister listerscorev1.SecretLister, configMapLister listerscorev1.ConfigMapLister) *certReadyHandler
func NewConfigurationHandler ¶
func NewConfigurationHandler(client kubernetes.Interface, recorder events.Recorder, configMapLister listerscorev1.ConfigMapLister, asset *asset.Asset) *configurationHandler
func NewDaemonSetHandler ¶
func NewInstallReadinessError ¶
NewInstallReadinessError creates an error that sets InstallReadinessFailure=True condition This replaces the old NewInstallReadinessError from internal/condition
func NewServiceCAConfigMapHandler ¶
func NewServiceCAConfigMapHandler(client kubernetes.Interface, recorder events.Recorder, configMapLister listerscorev1.ConfigMapLister, asset *asset.Asset) *serviceCAConfigMapHandler
func NewServiceCertSecretHandler ¶
func NewServiceCertSecretHandler(client kubernetes.Interface, secretLister listerscorev1.SecretLister, asset *asset.Asset) *serviceCertSecretHandler
func NewTargetConfigController ¶
func NewTargetConfigController( operatorClient *operatorclient.RunOnceDurationOverrideClient, kubeClient kubernetes.Interface, runtimeContext operatorruntime.OperandContext, informerFactory informers.SharedInformerFactory, operatorInformerFactory operatorinformers.SharedInformerFactory, recorder events.Recorder, ) factory.Controller
func NewValidationHandler ¶
func NewValidationHandler() *validationHandler
func NewWebhookConfigurationHandlerHandler ¶
func NewWebhookConfigurationHandlerHandler(client kubernetes.Interface, recorder events.Recorder, webhookLister admissionregistrationv1.MutatingWebhookConfigurationLister, asset *asset.Asset) *webhookConfigurationHandler
Types ¶
type ConditionType ¶
type ConditionType string
ConditionType represents the type of condition to set
const ( // ConditionTypeInstallReadinessFailure maps to InstallReadinessFailure condition (for install readiness errors) ConditionTypeInstallReadinessFailure ConditionType = "InstallReadinessFailure" // ConditionTypeAvailable maps to Available condition (for availability errors) ConditionTypeAvailable ConditionType = "Available" )
type Handler ¶
type Handler interface {
Handle(context *ReconcileRequestContext, original *runoncedurationoverridev1.RunOnceDurationOverride) (current *runoncedurationoverridev1.RunOnceDurationOverride, result controllerreconciler.Result, handleErr error)
}
Handler is an interface that wraps the Handle method
Handle handles a reconciliation request based on the original RunOnceDurationOverride object.
Handle may change the status block based on the operations it performs, it returns the modified object. It relies on the caller to update the status. Handle will not update the status block of the original object.
If an error happens while handling the the request, handleErr will be set. On an error the request key is expected to be requeued for further retries.
If result is set, the caller is expected to to requeue the request key for further retries. It indicates that no further processing of the request should be done, In this case the caller will abort and no other handler in the chain if any should be invoked.
type HandlerError ¶
type HandlerError struct {
ConditionType ConditionType
Reason string
Status operatorv1.ConditionStatus
Err error
}
HandlerError wraps an error with condition type, reason, and status for status conditions
func (*HandlerError) Error ¶
func (e *HandlerError) Error() string
func (*HandlerError) Unwrap ¶
func (e *HandlerError) Unwrap() error
type ReconcileRequestContext ¶
type ReconcileRequestContext struct {
operatorruntime.OperandContext
// contains filtered or unexported fields
}
func NewReconcileRequestContext ¶
func NewReconcileRequestContext(oc operatorruntime.OperandContext) *ReconcileRequestContext
func (*ReconcileRequestContext) ControllerSetter ¶
func (r *ReconcileRequestContext) ControllerSetter() operatorruntime.SetControllerFunc
func (*ReconcileRequestContext) GetBundle ¶
func (r *ReconcileRequestContext) GetBundle() *cert.Bundle
func (*ReconcileRequestContext) SetBundle ¶
func (r *ReconcileRequestContext) SetBundle(bundle *cert.Bundle)