Skip to content

Commit 3b02012

Browse files
Jonathan S. Katzjkatz
authored andcommitted
Remove PrimaryHost attribute from pgcluster CRD
This is no longer used.
1 parent 05ae8a4 commit 3b02012

File tree

7 files changed

+26
-35
lines changed

7 files changed

+26
-35
lines changed

examples/create-by-resource/fromcrd.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@
8181
},
8282
"policies": "",
8383
"port": "5432",
84-
"primaryhost": "fromcrd",
8584
"primarysecretname": "fromcrd-primaryuser-secret",
8685
"replicas": "0",
8786
"rootsecretname": "fromcrd-postgres-secret",

internal/apiserver/clusterservice/clusterimpl.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,6 @@ func getClusterParams(request *msgs.CreateClusterRequest, name string, userLabel
13111311
spec.PGBadgerPort = apiserver.Pgo.Cluster.PGBadgerPort
13121312
spec.ExporterPort = apiserver.Pgo.Cluster.ExporterPort
13131313
spec.SecretFrom = ""
1314-
spec.PrimaryHost = name
13151314
if request.Policies == "" {
13161315
spec.Policies = apiserver.Pgo.Cluster.Policies
13171316
log.Debugf("Pgo.Cluster.Policies %s", apiserver.Pgo.Cluster.Policies)

internal/operator/backrest/restore.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ func createRestoredDeployment(restclient *rest.RESTClient, cluster *crv1.Pgclust
342342
IsInit: true,
343343
Replicas: "1",
344344
ClusterName: cluster.Spec.Name,
345-
PrimaryHost: restoreToName,
346345
Port: cluster.Spec.Port,
347346
CCPImagePrefix: util.GetValueOrDefault(cluster.Spec.CCPImagePrefix, operator.Pgo.Cluster.CCPImagePrefix),
348347
CCPImage: cluster.Spec.CCPImage,

internal/operator/cluster/clone.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,6 @@ func createCluster(clientset kubernetes.Interface, client *rest.RESTClient, task
801801
PodAntiAffinity: sourcePgcluster.Spec.PodAntiAffinity,
802802
Policies: sourcePgcluster.Spec.Policies,
803803
Port: sourcePgcluster.Spec.Port,
804-
PrimaryHost: sourcePgcluster.Spec.PrimaryHost,
805804
PrimaryStorage: sourcePgcluster.Spec.PrimaryStorage,
806805
PrimarySecretName: fmt.Sprintf("%s%s", targetClusterName, crv1.PrimarySecretSuffix),
807806
// Replicas is set to "0" because we want to ensure that no replicas are

internal/operator/cluster/clusterlogic.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ func getClusterDeploymentFields(clientset kubernetes.Interface, client *rest.RES
299299
IsInit: true,
300300
Replicas: "0",
301301
ClusterName: cl.Spec.Name,
302-
PrimaryHost: cl.Annotations[config.ANNOTATION_CURRENT_PRIMARY],
303302
Port: cl.Spec.Port,
304303
CCPImagePrefix: util.GetValueOrDefault(cl.Spec.CCPImagePrefix, operator.Pgo.Cluster.CCPImagePrefix),
305304
CCPImage: cl.Spec.CCPImage,
@@ -456,7 +455,6 @@ func scaleReplicaCreateDeployment(clientset kubernetes.Interface, client *rest.R
456455
CCPImageTag: imageTag,
457456
CCPImage: image,
458457
PVCName: dataVolume.InlineVolumeSource(),
459-
PrimaryHost: cluster.Spec.PrimaryHost,
460458
Database: cluster.Spec.Database,
461459
DataPathOverride: replica.Spec.Name,
462460
ArchiveMode: archiveMode,

internal/operator/clusterutilities.go

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -138,35 +138,33 @@ type BootstrapJobTemplateFields struct {
138138

139139
// DeploymentTemplateFields ...
140140
type DeploymentTemplateFields struct {
141-
Name string
142-
ClusterName string
143-
Port string
144-
CCPImagePrefix string
145-
CCPImageTag string
146-
CCPImage string
147-
Database string
148-
DeploymentLabels string
149-
PodLabels string
150-
DataPathOverride string
151-
ArchiveMode string
152-
PVCName string
153-
RootSecretName string
154-
UserSecretName string
155-
PrimarySecretName string
156-
SecurityContext string
157-
ContainerResources string
158-
NodeSelector string
159-
ConfVolume string
160-
CollectAddon string
161-
CollectVolume string
162-
BadgerAddon string
163-
PgbackrestEnvVars string
164-
PgbackrestS3EnvVars string
165-
PgmonitorEnvVars string
166-
ScopeLabel string
167-
//next 2 are for the replica deployment only
141+
Name string
142+
ClusterName string
143+
Port string
144+
CCPImagePrefix string
145+
CCPImageTag string
146+
CCPImage string
147+
Database string
148+
DeploymentLabels string
149+
PodLabels string
150+
DataPathOverride string
151+
ArchiveMode string
152+
PVCName string
153+
RootSecretName string
154+
UserSecretName string
155+
PrimarySecretName string
156+
SecurityContext string
157+
ContainerResources string
158+
NodeSelector string
159+
ConfVolume string
160+
CollectAddon string
161+
CollectVolume string
162+
BadgerAddon string
163+
PgbackrestEnvVars string
164+
PgbackrestS3EnvVars string
165+
PgmonitorEnvVars string
166+
ScopeLabel string
168167
Replicas string
169-
PrimaryHost string
170168
IsInit bool
171169
EnableCrunchyadm bool
172170
ReplicaReinitOnStartFail bool

pkg/apis/crunchydata.com/v1/cluster.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ type PgclusterSpec struct {
9494
// PgBouncer contains all of the settings to properly maintain a pgBouncer
9595
// implementation
9696
PgBouncer PgBouncerSpec `json:"pgBouncer"`
97-
PrimaryHost string `json:"primaryhost"`
9897
User string `json:"user"`
9998
Database string `json:"database"`
10099
Replicas string `json:"replicas"`

0 commit comments

Comments
 (0)