Skip to content

Commit 22d4b48

Browse files
egeguneshors
andauthored
K8SPG-701: Make spec.extensions.image optional (#1002)
Co-authored-by: Viacheslav Sarzhan <[email protected]>
1 parent e47d5e6 commit 22d4b48

File tree

7 files changed

+5
-12
lines changed

7 files changed

+5
-12
lines changed

build/crd/percona/generated/pgv2.percona.com_perconapgclusters.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -8171,8 +8171,6 @@ spec:
81718171
- azure
81728172
type: string
81738173
type: object
8174-
required:
8175-
- image
81768174
type: object
81778175
image:
81788176
description: The image name to use for PostgreSQL containers.

config/crd/bases/pgv2.percona.com_perconapgclusters.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -8577,8 +8577,6 @@ spec:
85778577
- azure
85788578
type: string
85798579
type: object
8580-
required:
8581-
- image
85828580
type: object
85838581
image:
85848582
description: The image name to use for PostgreSQL containers.

deploy/bundle.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -8870,8 +8870,6 @@ spec:
88708870
- azure
88718871
type: string
88728872
type: object
8873-
required:
8874-
- image
88758873
type: object
88768874
image:
88778875
description: The image name to use for PostgreSQL containers.

deploy/crd.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -8870,8 +8870,6 @@ spec:
88708870
- azure
88718871
type: string
88728872
type: object
8873-
required:
8874-
- image
88758873
type: object
88768874
image:
88778875
description: The image name to use for PostgreSQL containers.

deploy/cw-bundle.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -8870,8 +8870,6 @@ spec:
88708870
- azure
88718871
type: string
88728872
type: object
8873-
required:
8874-
- image
88758873
type: object
88768874
image:
88778875
description: The image name to use for PostgreSQL containers.

percona/controller/pgcluster/controller.go

+4
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@ func (r *PGClusterReconciler) reconcileCustomExtensions(ctx context.Context, cr
553553
return nil
554554
}
555555

556+
if len(cr.Spec.Extensions.Image) == 0 && len(cr.Spec.Extensions.Custom) > 0 {
557+
return errors.New("you need to set spec.extensions.image to install custom extensions")
558+
}
559+
556560
extensionKeys := make([]string, 0)
557561
extensionNames := make([]string, 0)
558562

pkg/apis/pgv2.percona.com/v2/perconapgcluster_types.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,7 @@ type BuiltInExtensionsSpec struct {
584584
}
585585

586586
type ExtensionsSpec struct {
587-
// +kubebuilder:validation:Required
588-
Image string `json:"image"`
587+
Image string `json:"image,omitempty"`
589588
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
590589
Storage CustomExtensionsStorageSpec `json:"storage,omitempty"`
591590
BuiltIn BuiltInExtensionsSpec `json:"builtin,omitempty"`

0 commit comments

Comments
 (0)