Skip to content

Commit

Permalink
Set default image for backup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya Bumarskov committed Nov 23, 2021
1 parent 03f06d0 commit a98381d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 1 addition & 3 deletions deploy/crds/zookeeper.pravega.io_zookeeperbackups_crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ spec:
description: Data Storage Class name
type: string
image:
description: ContainerImage defines the fields needed for a Docker
repository image. The format here matches the predominant format
used in Helm charts.
description: Image for backup procedure
properties:
pullPolicy:
description: PullPolicy describes a policy for if/when to pull
Expand Down
8 changes: 8 additions & 0 deletions pkg/apis/zookeeper/v1beta1/zookeeperbackup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type ZookeeperBackupSpec struct {
// +kubebuilder:validation:Required
DataStorageClass string `json:"dataStorageClass,omitempty"`

// Image for backup procedure
Image ContainerImage `json:"image,omitempty"`
}

Expand All @@ -48,6 +49,13 @@ func (s *ZookeeperBackupSpec) withDefaults() (changed bool) {
s.DataCapacity = "1Gi"
changed = true
}
if s.Image.Repository == "" {
s.Image.Repository = "pravega/zkbackup"
s.Image.Tag = "0.1"
}
if s.Image.Tag == "" {
s.Image.Tag = "latest"
}
return changed
}

Expand Down

0 comments on commit a98381d

Please sign in to comment.