Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDeploymentVersionController ¶
func NewDeploymentVersionController( name string, controlPlaneNamespace string, controllerDeploymentName string, managementClusterDeploymentInformer appsinformersv1.DeploymentInformer, guestClusterOperatorClient v1helpers.OperatorClientWithFinalizers, managementClusterKubeClient kubernetes.Interface, eventRecorder events.Recorder) factory.Controller
Types ¶
type DeploymentVersionController ¶
type DeploymentVersionController struct {
// contains filtered or unexported fields
}
This controller updates versionAnnotation of the Deployment specified by controllerDeploymentName with the current version of the operator, read from the "OPERATOR_IMAGE_VERSION" environment variable. The controller expects this environment variable to be set to a reasonable value. The controller checks whether a rollout of the Deployment with the current version is in progress and updates versionAnnotation only when the deployment has completed. The controller relies on `.status.conditions` with the `Progressing` type to ensure that the deployment has completed, as explained in the Kubernetes docs: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#complete-deployment The controller expects the operator to publish the Deployment with desiredVersionAnnotation equal to the current version of the operator. The lack of this annotation is treated as an old Deployment from some previous version of the operator that did not use this controller. Currently, this controller is supposed to be used only for Deployments residing in HyperShift control planes.
func (*DeploymentVersionController) Sync ¶
func (c *DeploymentVersionController) Sync(ctx context.Context, syncCtx factory.SyncContext) error