Skip to content

Commit

Permalink
Add more check for serverless
Browse files Browse the repository at this point in the history
  • Loading branch information
tuteng committed Dec 5, 2024
1 parent 8e2edd6 commit f4791cf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cloud/resource_pulsar_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,34 +106,49 @@ func resourcePulsarCluster() *schema.Resource {
Default: "rapid",
Description: descriptions["release_channel"],
ValidateFunc: validateReleaseChannel,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
return d.Get("type") == string(cloudv1alpha1.PulsarInstanceTypeServerless)
},
},
"bookie_replicas": {
Type: schema.TypeInt,
Optional: true,
Default: 3,
Description: descriptions["bookie_replicas"],
ValidateFunc: validateBookieReplicas,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
return d.Get("type") == string(cloudv1alpha1.PulsarInstanceTypeServerless)
},
},
"broker_replicas": {
Type: schema.TypeInt,
Optional: true,
Default: 2,
Description: descriptions["broker_replicas"],
ValidateFunc: validateBrokerReplicas,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
return d.Get("type") == string(cloudv1alpha1.PulsarInstanceTypeServerless)
},
},
"compute_unit": {
Type: schema.TypeFloat,
Optional: true,
Default: 0.5,
Description: descriptions["compute_unit"],
ValidateFunc: validateCUSU,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
return d.Get("type") == string(cloudv1alpha1.PulsarInstanceTypeServerless)
},
},
"storage_unit": {
Type: schema.TypeFloat,
Optional: true,
Default: 0.5,
Description: descriptions["storage_unit"],
ValidateFunc: validateCUSU,
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool {
return d.Get("type") == string(cloudv1alpha1.PulsarInstanceTypeServerless)
},
},
"config": {
Type: schema.TypeList,
Expand Down

0 comments on commit f4791cf

Please sign in to comment.