Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(operator): allow user to modify imagePullPolicy #252

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading