Skip to content

Commit

Permalink
fix: omitempty on new exposetype, update e2e test golden
Browse files Browse the repository at this point in the history
  • Loading branch information
carlmontanari committed Oct 23, 2024
1 parent aea3fcf commit fed9b73
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apis/v1alpha1/topologyspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ type Expose struct {
// +kubebuilder:validation:Enum=None;ClusterIP;LoadBalancer
// +kubebuilder:default=LoadBalancer
// +optional
ExposeType string `json:"exposeType"`
ExposeType string `json:"exposeType,omitempty"`
}

// Deployment holds configurations relevant to how clabernetes configures deployments that make
Expand Down
1 change: 0 additions & 1 deletion clabverter/test-fixtures/golden/simple/topo01.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ spec:
expose:
disableAutoExpose: false
disableExpose: false
exposeType: ""
imagePull:
insecureRegistries:
- 1.2.3.4
Expand Down
4 changes: 4 additions & 0 deletions e2e/clabverter/clabverter_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ func TestClabverterBasic(t *testing.T) {
}

defer func() {
if *clabernetestesthelper.SkipCleanup {
return
}

err = os.Remove("test-fixtures/10-apply.yaml")
if err != nil {
t.Errorf("failed cleaning up clabverted topology file, err: %s", err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ spec:
expose:
disableAutoExpose: false
disableExpose: false
exposeType: LoadBalancer
imagePull: {}
naming: prefixed
statusProbes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ spec:
expose:
disableAutoExpose: false
disableExpose: false
exposeType: LoadBalancer
imagePull: {}
naming: global
statusProbes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ spec:
expose:
disableAutoExpose: false
disableExpose: false
exposeType: LoadBalancer
imagePull: {}
naming: global
statusProbes:
Expand Down
7 changes: 3 additions & 4 deletions generated/openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1489,12 +1489,11 @@
},
"exposeType": {
"default": "LoadBalancer",
"description": "ExposeType configures the service type(s) related to exposing the topology. This is an enum\nthat has the following valid values:\n- None: expose is *not* disabled, but we just don't create any services related to the pods,\n you may want to do this if you want to tickle the pods by pod name directly for some\n reason while not having extra services floating around.\n- ClusterIp: a clusterip service is created so you can hit that service name for the pods.\n- LoadBalancer: (default) creates a load balancer service so you can access your pods from\n outside the cluster. this is/was the only behavior up to v0.2.4.\n- Both: creates both a load balancer service and a cluster ip service.",
"description": "ExposeType configures the service type(s) related to exposing the topology. This is an enum\nthat has the following valid values:\n- None: expose is *not* disabled, but we just don't create any services related to the pods,\n you may want to do this if you want to tickle the pods by pod name directly for some\n reason while not having extra services floating around.\n- ClusterIP: a clusterip service is created so you can hit that service name for the pods.\n- LoadBalancer: (default) creates a load balancer service so you can access your pods from\n outside the cluster. this is/was the only behavior up to v0.2.4.",
"enum": [
"None",
"ClusterIp",
"LoadBalancer",
"Both"
"ClusterIP",
"LoadBalancer"
],
"type": "string"
}
Expand Down
1 change: 0 additions & 1 deletion generated/openapi/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions ui/clabernetes-openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1489,12 +1489,11 @@
},
"exposeType": {
"default": "LoadBalancer",
"description": "ExposeType configures the service type(s) related to exposing the topology. This is an enum\nthat has the following valid values:\n- None: expose is *not* disabled, but we just don't create any services related to the pods,\n you may want to do this if you want to tickle the pods by pod name directly for some\n reason while not having extra services floating around.\n- ClusterIp: a clusterip service is created so you can hit that service name for the pods.\n- LoadBalancer: (default) creates a load balancer service so you can access your pods from\n outside the cluster. this is/was the only behavior up to v0.2.4.\n- Both: creates both a load balancer service and a cluster ip service.",
"description": "ExposeType configures the service type(s) related to exposing the topology. This is an enum\nthat has the following valid values:\n- None: expose is *not* disabled, but we just don't create any services related to the pods,\n you may want to do this if you want to tickle the pods by pod name directly for some\n reason while not having extra services floating around.\n- ClusterIP: a clusterip service is created so you can hit that service name for the pods.\n- LoadBalancer: (default) creates a load balancer service so you can access your pods from\n outside the cluster. this is/was the only behavior up to v0.2.4.",
"enum": [
"None",
"ClusterIp",
"LoadBalancer",
"Both"
"ClusterIP",
"LoadBalancer"
],
"type": "string"
}
Expand Down

0 comments on commit fed9b73

Please sign in to comment.