Skip to content

Commit f29f737

Browse files
Jonathan S. Katzjkatz
authored andcommitted
Remove SecretFrom from the pgcluster Spec
This is only used as part of one of the API operations. Future work can explore doing something closer to the intended action, e.g. creating a new PostgreSQL cluster from an old one from a custom resource workflow.
1 parent 3b02012 commit f29f737

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

internal/apiserver/clusterservice/clusterimpl.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,6 @@ func getClusterParams(request *msgs.CreateClusterRequest, name string, userLabel
13101310
spec.Port = apiserver.Pgo.Cluster.Port
13111311
spec.PGBadgerPort = apiserver.Pgo.Cluster.PGBadgerPort
13121312
spec.ExporterPort = apiserver.Pgo.Cluster.ExporterPort
1313-
spec.SecretFrom = ""
13141313
if request.Policies == "" {
13151314
spec.Policies = apiserver.Pgo.Cluster.Policies
13161315
log.Debugf("Pgo.Cluster.Policies %s", apiserver.Pgo.Cluster.Policies)
@@ -1371,11 +1370,6 @@ func getClusterParams(request *msgs.CreateClusterRequest, name string, userLabel
13711370
spec.TLS.TLSSecret = request.TLSSecret
13721371
spec.TLS.ReplicationTLSSecret = request.ReplicationTLSSecret
13731372

1374-
//pass along command line flags for a restore
1375-
if request.SecretFrom != "" {
1376-
spec.SecretFrom = request.SecretFrom
1377-
}
1378-
13791373
spec.CustomConfig = request.CustomConfig
13801374
spec.SyncReplication = request.SyncReplication
13811375

internal/operator/cluster/clone.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -805,14 +805,10 @@ func createCluster(clientset kubernetes.Interface, client *rest.RESTClient, task
805805
PrimarySecretName: fmt.Sprintf("%s%s", targetClusterName, crv1.PrimarySecretSuffix),
806806
// Replicas is set to "0" because we want to ensure that no replicas are
807807
// provisioned with the clone
808-
Replicas: "0",
809-
ReplicaStorage: sourcePgcluster.Spec.ReplicaStorage,
810-
Resources: sourcePgcluster.Spec.Resources,
811-
RootSecretName: fmt.Sprintf("%s%s", targetClusterName, crv1.RootSecretSuffix),
812-
// SecretFrom needs to be set as the "sourcePgcluster.Spec.ClusterName"
813-
// as this will indicate we got our secrets from the original cluster
814-
// ...this does NOT copy over the secrets as I thought it would.
815-
SecretFrom: sourcePgcluster.Spec.ClusterName,
808+
Replicas: "0",
809+
ReplicaStorage: sourcePgcluster.Spec.ReplicaStorage,
810+
Resources: sourcePgcluster.Spec.Resources,
811+
RootSecretName: fmt.Sprintf("%s%s", targetClusterName, crv1.RootSecretSuffix),
816812
SyncReplication: sourcePgcluster.Spec.SyncReplication,
817813
User: sourcePgcluster.Spec.User,
818814
UserSecretName: fmt.Sprintf("%s-%s%s", targetClusterName, sourcePgcluster.Spec.User, crv1.UserSecretSuffix),

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ type PgclusterSpec struct {
9797
User string `json:"user"`
9898
Database string `json:"database"`
9999
Replicas string `json:"replicas"`
100-
SecretFrom string `json:"secretfrom"`
101100
UserSecretName string `json:"usersecretname"`
102101
RootSecretName string `json:"rootsecretname"`
103102
PrimarySecretName string `json:"primarysecretname"`

0 commit comments

Comments
 (0)