Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDeploymentController ¶
func NewDeploymentController( name string, manifest []byte, recorder events.Recorder, operatorClient v1helpers.OperatorClientWithFinalizers, kubeClient kubernetes.Interface, deployInformer appsinformersv1.DeploymentInformer, optionalInformers []factory.Informer, optionalManifestHooks []ManifestHookFunc, optionalDeploymentHooks ...DeploymentHookFunc, ) factory.Controller
Types ¶
type DeploymentController ¶
type DeploymentController struct {
// contains filtered or unexported fields
}
DeploymentController is a generic controller that manages a deployment.
This controller supports removable operands, as configured in pkg/operator/management.
This controller produces the following conditions: <name>Available: indicates that the deployment controller was successfully deployed and at least one Deployment replica is available. <name>Progressing: indicates that the Deployment is in progress. <name>Degraded: produced when the sync() method returns an error.
func (*DeploymentController) Name ¶
func (c *DeploymentController) Name() string
type DeploymentHookFunc ¶
type DeploymentHookFunc func(*opv1.OperatorSpec, *appsv1.Deployment) error
DeploymentHookFunc is a hook function to modify the Deployment.
func WithImageHook ¶
func WithImageHook() DeploymentHookFunc
WithImageHook sets the image associated with the deployment with the value provided for CLI_IMAGE env variable.
func WithReplicasHook ¶
func WithReplicasHook(nodeLister corev1listers.NodeLister) DeploymentHookFunc
WithReplicasHook sets the deployment.Spec.Replicas field according to the number of available nodes. The number of nodes is determined by the node selector specified in the field deployment.Spec.Templates.NodeSelector.
type ManifestHookFunc ¶
type ManifestHookFunc func(*opv1.OperatorSpec, []byte) ([]byte, error)
ManifestHookFunc is a hook function to modify the manifest in raw format. The hook must not modify the original manifest!