Skip to content

Commit

Permalink
Issue 197: add imagePullSecrets support (#277)
Browse files Browse the repository at this point in the history
Signed-off-by: Juri Malinovski <[email protected]>
Co-authored-by: Juri Malinovski <[email protected]>
  • Loading branch information
jurim76 and Juri Malinovski authored Jan 8, 2025
1 parent b07f733 commit 7d94acf
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api/v1alpha1/dragonfly_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ type DragonflySpec struct {
// +kubebuilder:default:="Always"
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`

// (Optional) imagePullSecrets to set to Dragonfly
// +optional
// +kubebuilder:validation:Optional
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`

// (Optional) Dragonfly container args to pass to the container
// Refer to the Dragonfly documentation for the list of supported args
// +optional
Expand Down
38 changes: 38 additions & 0 deletions config/crd/bases/dragonflydb.io_dragonflies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,25 @@ spec:
description: (Optional) imagePullPolicy to set to Dragonfly, default
is Always
type: string
imagePullSecrets:
description: List of Secret resource containing access credentials to the registry. Required if the docker registry is private.
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
type: array
initContainers:
description: (Optional) Dragonfly pod init containers
items:
Expand Down Expand Up @@ -1434,6 +1453,25 @@ spec:
Cannot be updated.
More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
type: string
imagePullSecrets:
description: List of Secret resource containing access credentials to the registry. Required if the docker registry is private.
items:
description: |-
LocalObjectReference contains enough information to let you locate the
referenced object inside the same namespace.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
type: string
type: object
x-kubernetes-map-type: atomic
type: array
lifecycle:
description: |-
Actions that the management system should take in response to container lifecycle events.
Expand Down
1 change: 1 addition & 0 deletions internal/resources/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func GetDragonflyResources(ctx context.Context, df *resourcesv1.Dragonfly) ([]cl
},
},
Spec: corev1.PodSpec{
ImagePullSecrets: df.Spec.ImagePullSecrets,
Containers: []corev1.Container{
{
Name: "dragonfly",
Expand Down

0 comments on commit 7d94acf

Please sign in to comment.