Skip to content

Commit

Permalink
rpk yaml: omitempty on empty CloudCluster's
Browse files Browse the repository at this point in the history
This makes the yaml look a bit nicer. Also updates the yaml sha,
sticking with v3 since v3 is introduced in this PR.
  • Loading branch information
twmb committed Mar 15, 2024
1 parent 967ccf9 commit eb31bb0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 38 deletions.
36 changes: 0 additions & 36 deletions src/go/rpk/pkg/config/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,12 +741,6 @@ profiles:
description: Default rpk profile
prompt: ""
from_cloud: false
cloud_cluster:
namespace: ""
cluster_id: ""
cluster_name: ""
auth_org_id: ""
auth_kind: ""
kafka_api:
brokers:
- 127.0.0.1:9092
Expand Down Expand Up @@ -839,12 +833,6 @@ profiles:
description: Default rpk profile
prompt: ""
from_cloud: false
cloud_cluster:
namespace: ""
cluster_id: ""
cluster_name: ""
auth_org_id: ""
auth_kind: ""
kafka_api:
brokers:
- 0.0.0.3:9092
Expand Down Expand Up @@ -887,12 +875,6 @@ profiles:
description: descriptosphere
prompt: ""
from_cloud: false
cloud_cluster:
namespace: ""
cluster_id: ""
cluster_name: ""
auth_org_id: ""
auth_kind: ""
kafka_api:
brokers:
- 0.0.0.3
Expand Down Expand Up @@ -950,12 +932,6 @@ profiles:
description: descriptosphere
prompt: ""
from_cloud: false
cloud_cluster:
namespace: ""
cluster_id: ""
cluster_name: ""
auth_org_id: ""
auth_kind: ""
kafka_api:
brokers:
- 0.0.0.3:9092
Expand Down Expand Up @@ -1017,12 +993,6 @@ profiles:
description: descriptosphere
prompt: ""
from_cloud: false
cloud_cluster:
namespace: ""
cluster_id: ""
cluster_name: ""
auth_org_id: ""
auth_kind: ""
kafka_api:
brokers:
- 128.0.0.4
Expand Down Expand Up @@ -1073,12 +1043,6 @@ profiles:
description: descriptosphere
prompt: ""
from_cloud: false
cloud_cluster:
namespace: ""
cluster_id: ""
cluster_name: ""
auth_org_id: ""
auth_kind: ""
kafka_api:
brokers:
- 128.0.0.4:9092
Expand Down
2 changes: 1 addition & 1 deletion src/go/rpk/pkg/config/rpk_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ type (
Description string `json:"description" yaml:"description"`
Prompt string `json:"prompt" yaml:"prompt"`
FromCloud bool `json:"from_cloud" yaml:"from_cloud"`
CloudCluster RpkCloudCluster `json:"cloud_cluster" yaml:"cloud_cluster"`
CloudCluster RpkCloudCluster `json:"cloud_cluster,omitempty" yaml:"cloud_cluster,omitempty"`
KafkaAPI RpkKafkaAPI `json:"kafka_api" yaml:"kafka_api"`
AdminAPI RpkAdminAPI `json:"admin_api" yaml:"admin_api"`
SR RpkSchemaRegistryAPI `json:"schema_registry" yaml:"schema_registry"`
Expand Down
2 changes: 1 addition & 1 deletion src/go/rpk/pkg/config/rpk_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestRpkYamlVersion(t *testing.T) {
shastr := hex.EncodeToString(sha[:])

const (
v3sha = "36be33e2fc1063d4522310f61e33f6c75bd597532e8d810066525616e9e8d845" // 24-04-14
v3sha = "cc2faa9790df9307d1fbf3e532128152d473e31a951152d2e2514a915269f880" // 24-04-14
)

if shastr != v3sha {
Expand Down

0 comments on commit eb31bb0

Please sign in to comment.