Skip to content

Commit fa3d1c8

Browse files
Modify logic to respect client region (#157)
Co-authored-by: Haardik Dharma <[email protected]>
1 parent 5690db9 commit fa3d1c8

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

kfcluster.go

+11-10
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,26 @@ type KfCluster struct {
1313
ID string `json:"id"`
1414
Name string `json:"name"`
1515
NetworkID string `json:"network_id"`
16-
FirewallID string `json:"firewall_id"`
17-
Size string `json:"size"`
18-
KubeflowReady string `json:"kubeflow_ready"`
19-
DashboardURL string `json:"dashboard_url"`
20-
CreatedAt time.Time `json:"created_at"`
16+
FirewallID string `json:"firewall_id,omitempty"`
17+
Size string `json:"size,omitempty"`
18+
KubeflowReady string `json:"kubeflow_ready,omitempty"`
19+
DashboardURL string `json:"dashboard_url,omitempty"`
20+
CreatedAt time.Time `json:"created_at,omitempty"`
2121
}
2222

2323
// CreateKfClusterReq is the request for creating a KfCluster.
2424
type CreateKfClusterReq struct {
2525
Name string `json:"name" validate:"required"`
2626
NetworkID string `json:"network_id" validate:"required"`
27-
FirewallID string `json:"firewall_id"`
28-
Size string `json:"size"`
29-
Region string `json:"region"`
27+
FirewallID string `json:"firewall_id,omitempty"`
28+
Size string `json:"size,omitempty"`
29+
Region string `json:"region,omitempty"`
3030
}
3131

3232
// UpdateKfClusterReq is the request for updating a KfCluster.
3333
type UpdateKfClusterReq struct {
34-
Name string `json:"name"`
35-
Region string `json:"region"`
34+
Name string `json:"name,omitempty"`
35+
Region string `json:"region,omitempty"`
3636
// Size string `json:"size"`
3737
}
3838

@@ -110,6 +110,7 @@ func (c *Client) FindKfCluster(search string) (*KfCluster, error) {
110110

111111
// CreateKfCluster creates a new kubeflow cluster
112112
func (c *Client) CreateKfCluster(req CreateKfClusterReq) (*KfCluster, error) {
113+
req.Region = c.Region
113114
body, err := c.SendPostRequest("/v2/kfclusters", req)
114115
if err != nil {
115116
return nil, decodeError(err)

0 commit comments

Comments
 (0)