Skip to content

Commit

Permalink
feat: allow user to modify imagePullPolicy
Browse files Browse the repository at this point in the history
Signed-off-by: Cyril Corbon <[email protected]>
  • Loading branch information
cyril-corbon committed Oct 21, 2024
1 parent a738101 commit 3e4f942
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions api/v1alpha1/dragonfly_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ type DragonflySpec struct {
// Image is the Dragonfly image to use
Image string `json:"image,omitempty"`

// (Optional) imagePullPolicy to set to Dragonfly, default is Always
// +optional
// +kubebuilder:validation:Optional
// +kubebuilder:default="Always"
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

// (Optional) Dragonfly container args to pass to the container
// Refer to the Dragonfly documentation for the list of supported args
// +optional
Expand Down
2 changes: 1 addition & 1 deletion api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions config/crd/bases/dragonflydb.io_dragonflies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,11 @@ spec:
image:
description: Image is the Dragonfly image to use
type: string
imagePullPolicy:
default: Always
description: (Optional) imagePullPolicy to set to Dragonfly, default
is Always
type: string
labels:
additionalProperties:
type: string
Expand Down
2 changes: 1 addition & 1 deletion internal/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func GetDragonflyResources(ctx context.Context, df *resourcesv1.Dragonfly) ([]cl
SuccessThreshold: 1,
TimeoutSeconds: 5,
},
ImagePullPolicy: corev1.PullAlways,
ImagePullPolicy: df.Spec.ImagePullPolicy,
},
},
},
Expand Down

0 comments on commit 3e4f942

Please sign in to comment.