Skip to content

Commit

Permalink
chore(cmx): remove postgres cluster addon (#481)
Browse files Browse the repository at this point in the history
Signed-off-by: Kyle Squizzato <[email protected]>
  • Loading branch information
squizzi authored Dec 13, 2024
1 parent c3913a2 commit 296a36d
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 221 deletions.
8 changes: 1 addition & 7 deletions cli/cmd/cluster_addon.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ You can use various subcommands to create, list, remove, or check the status of
# Remove an add-on from a cluster
replicated cluster addon rm CLUSTER_ID --id ADDON_ID
# Create a Postgres database add-on for a cluster
replicated cluster addon create postgres CLUSTER_ID --version 13 --disk 100 --instance-type db.t3.micro
# Create an object store bucket add-on for a cluster
replicated cluster addon create object-store CLUSTER_ID --bucket-prefix mybucket
# List add-ons with JSON output
replicated cluster addon ls CLUSTER_ID --output json
# Create a Postgres add-on and wait for it to be ready
replicated cluster addon create postgres CLUSTER_ID --version 13 --wait 5m`,
replicated cluster addon ls CLUSTER_ID --output json`,
}
parent.AddCommand(cmd)

Expand Down
8 changes: 1 addition & 7 deletions cli/cmd/cluster_addon_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,9 @@ func (r *runners) InitClusterAddonCreate(parent *cobra.Command) *cobra.Command {
Use: "create",
Short: "Create cluster add-ons.",
Long: `Create new add-ons for a cluster. This command allows you to add functionality or services to a cluster by provisioning the required add-ons.`,
Example: ` # Create a Postgres database add-on for a cluster
replicated cluster addon create postgres CLUSTER_ID --version 13 --disk 100 --instance-type db.t3.micro
# Create an object store bucket add-on for a cluster
Example: ` # Create an object store bucket add-on for a cluster
replicated cluster addon create object-store CLUSTER_ID --bucket-prefix mybucket
# Create a Postgres add-on and wait for it to be ready
replicated cluster addon create postgres CLUSTER_ID --version 13 --wait 5m
# Perform a dry run for creating an object store add-on
replicated cluster addon create object-store CLUSTER_ID --bucket-prefix mybucket --dry-run`,
}
Expand Down
124 changes: 0 additions & 124 deletions cli/cmd/cluster_addon_create_postgres.go

This file was deleted.

1 change: 0 additions & 1 deletion cli/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ func Execute(rootCmd *cobra.Command, stdin io.Reader, stdout io.Writer, stderr i
runCmds.InitClusterAddonRm(clusterAddonCmd)
clusterAddonCreateCmd := runCmds.InitClusterAddonCreate(clusterAddonCmd)
runCmds.InitClusterAddonCreateObjectStore(clusterAddonCreateCmd)
runCmds.InitClusterAddonCreatePostgres(clusterAddonCreateCmd)

clusterPortCmd := runCmds.InitClusterPort(clusterCmd)
runCmds.InitClusterPortLs(clusterPortCmd)
Expand Down
10 changes: 0 additions & 10 deletions cli/print/cluster_addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ func addonData(addon *types.ClusterAddon) string {
switch {
case addon.ObjectStore != nil:
return addonObjectStoreData(*addon.ObjectStore)
case addon.Postgres != nil:
return addonPostgresData(*addon.Postgres)
default:
return ""
}
Expand All @@ -95,11 +93,3 @@ func addonObjectStoreData(data types.ClusterAddonObjectStore) string {
}
return string(b)
}

func addonPostgresData(data types.ClusterAddonPostgres) string {
b, err := json.Marshal(data)
if err != nil {
log.Printf("failed to marshal postgres data: %v", err)
}
return string(b)
}
61 changes: 0 additions & 61 deletions pkg/kotsclient/cluster_addon_postgres_create.go

This file was deleted.

11 changes: 0 additions & 11 deletions pkg/types/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ type ClusterAddon struct {
CreatedAt time.Time `json:"created_at"`

ObjectStore *ClusterAddonObjectStore `json:"object_store,omitempty"`
Postgres *ClusterAddonPostgres `json:"postgres,omitempty"`
}

type ClusterAddonObjectStore struct {
Expand All @@ -112,20 +111,10 @@ type ClusterAddonObjectStore struct {
ServiceAccountNameReadOnly string `json:"service_account_name_read_only,omitempty"`
}

type ClusterAddonPostgres struct {
Version string `json:"version"`
DiskGiB int64 `json:"disk_gib"`
InstanceType string `json:"instance_type"`

URI string `json:"uri,omitempty"`
}

func (addon *ClusterAddon) TypeName() string {
switch {
case addon.ObjectStore != nil:
return "Object Store"
case addon.Postgres != nil:
return "Postgres"
default:
return "Unknown"
}
Expand Down

0 comments on commit 296a36d

Please sign in to comment.