Skip to content

Commit

Permalink
Merge branch 'main' into SI-215-Terraform-Ocean-AKS-Update-the-VNG-an…
Browse files Browse the repository at this point in the history
…d-Create-cluster-and-VNGs-paramter
  • Loading branch information
anuragsharma-123 authored Jan 14, 2025
2 parents 47a3b1e + 8deee94 commit 2793694
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/service/ocean/providers/gcp/create/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ func main() {
Cluster: &gcp.Cluster{
Name: spotinst.String("foo"),
ControllerClusterID: spotinst.String("foo"),
AutoUpdate: &gcp.AutoUpdate{
IsEnabled: spotinst.Bool(true),
},
Scheduling: &gcp.Scheduling{
Tasks: []*gcp.Task{
{
Expand Down
3 changes: 3 additions & 0 deletions examples/service/ocean/spark/cluster/create/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ func main() {
"spark-apps-extra-ns-2",
}),
},
Workspaces: &spark.WorkspacesConfig{
StorageClassOverride: spotinst.String("gp2"),
},
},
},
})
Expand Down
3 changes: 3 additions & 0 deletions examples/service/ocean/spark/cluster/update/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ func main() {
"spark-apps-extra-ns-2",
}),
},
Workspaces: &spark.WorkspacesConfig{
StorageClassOverride: spotinst.String("another-storage-class"),
},
},
},
})
Expand Down
32 changes: 32 additions & 0 deletions service/ocean/providers/gcp/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Cluster struct {
Compute *Compute `json:"compute,omitempty"`
Strategy *Strategy `json:"strategy,omitempty"`
GKE *GKE `json:"gke,omitempty"`
AutoUpdate *AutoUpdate `json:"autoUpdate,omitempty"`

// Read-only fields.
CreatedAt *time.Time `json:"createdAt,omitempty"`
Expand Down Expand Up @@ -349,6 +350,13 @@ type CreateRollOutput struct {
Roll *RollStatus `json:"roll,omitempty"`
}

type AutoUpdate struct {
IsEnabled *bool `json:"isEnabled,omitempty"`

forceSendFields []string
nullFields []string
}

func clusterFromJSON(in []byte) (*Cluster, error) {
b := new(Cluster)
if err := json.Unmarshal(in, b); err != nil {
Expand Down Expand Up @@ -705,6 +713,13 @@ func (o *Cluster) SetScheduling(v *Scheduling) *Cluster {
return o
}

func (o *Cluster) SetAutoUpdate(v *AutoUpdate) *Cluster {
if o.AutoUpdate = v; o.AutoUpdate == nil {
o.nullFields = append(o.nullFields, "AutoUpdate")
}
return o
}

// endregion

// region GKE
Expand Down Expand Up @@ -1599,3 +1614,20 @@ func (o ClusterRoll) MarshalJSON() ([]byte, error) {
}

// endregion

// region AutoUpdate

func (o AutoUpdate) MarshalJSON() ([]byte, error) {
type noMethod AutoUpdate
raw := noMethod(o)
return jsonutil.MarshalJSON(raw, o.forceSendFields, o.nullFields)
}

func (o *AutoUpdate) SetIsEnabled(v *bool) *AutoUpdate {
if o.IsEnabled = v; o.IsEnabled == nil {
o.nullFields = append(o.nullFields, "IsEnabled")
}
return o
}

// endregion
32 changes: 32 additions & 0 deletions service/ocean/spark/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ type Config struct {
Compute *ComputeConfig `json:"compute,omitempty"`
LogCollection *LogCollectionConfig `json:"logCollection,omitempty"`
Spark *SparkConfig `json:"spark,omitempty"`
Workspaces *WorkspacesConfig `json:"workspaces,omitempty"`

forceSendFields []string
nullFields []string
}

type WorkspacesConfig struct {
StorageClassOverride *string `json:"storageClassOverride,omitempty"`

forceSendFields []string
nullFields []string
Expand Down Expand Up @@ -195,6 +203,13 @@ func (c *Config) SetIngress(v *IngressConfig) *Config {
return c
}

func (c *Config) SetWorkspaces(v *WorkspacesConfig) *Config {
if c.Workspaces = v; c.Workspaces == nil {
c.nullFields = append(c.nullFields, "Workspaces")
}
return c
}

func (c *Config) SetWebhook(v *WebhookConfig) *Config {
if c.Webhook = v; c.Webhook == nil {
c.nullFields = append(c.nullFields, "Webhook")
Expand Down Expand Up @@ -445,6 +460,23 @@ func (l *LogCollectionConfig) SetCollectAppLogs(v *bool) *LogCollectionConfig {

// endregion

// region Workspaces

func (w WorkspacesConfig) MarshalJSON() ([]byte, error) {
type noMethod WorkspacesConfig
raw := noMethod(w)
return jsonutil.MarshalJSON(raw, w.forceSendFields, w.nullFields)
}

func (w *WorkspacesConfig) SetStorageClassOverride(v *string) *WorkspacesConfig {
if w.StorageClassOverride = v; w.StorageClassOverride == nil {
w.nullFields = append(w.nullFields, "StorageClassOverride")
}
return w
}

// endregion

// region Spark

func (s SparkConfig) MarshalJSON() ([]byte, error) {
Expand Down
2 changes: 1 addition & 1 deletion spotinst/version.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package spotinst

// SDKVersion is the current version of the SDK.
const SDKVersion = "1.381.0"
const SDKVersion = "1.383.0"

// SDKName is the name of the SDK.
const SDKName = "spotinst-sdk-go"

0 comments on commit 2793694

Please sign in to comment.