Skip to content

PULL_POLICY does not set the controller or webhook imagePullPolicy #1750

Done

Description

@rohanKanojia

Description

CONTRIBUTING.md and make help describe PULL_POLICY as "Image pull policy for controller". In practice the variable only sets the workspace imagePullPolicy in deploy/default-config.yaml. The operator's own Deployments ignore it:

  • deploy/templates/base/manager_image_patch.yaml hardcodes imagePullPolicy: Always for the controller.
  • pkg/webhook/deployment.go hardcodes corev1.PullAlways for the webhook server.

Because the controller updates the webhook Deployment on every startup (CreateWebhookServerDeployment), a manual patch to the webhook's pull policy is reverted when the controller restarts.

Impact

PULL_POLICY=Never make install (or IfNotPresent) has no effect on the operator pods. Running a locally built image that exists only on the node (minikube, kind, CRC) needs the Deployments patched after install, and the webhook patch doesn't survive a controller restart.

This came up in #1742, where the CI loads the pull request image into minikube.

Proposed fix

  • Use ${PULL_POLICY} in manager_image_patch.yaml.
  • Pass the same policy to the controller as an env var and use it for the webhook Deployment, defaulting to Always.

The default stays Always, so existing installs don't change.

Alternatively, if the current behaviour is intended, correct the description of PULL_POLICY in CONTRIBUTING.md and the Makefile help text.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions