Skip to content

Commit

Permalink
Fix dispatch_rate and retention_policies state key usage for namespace (
Browse files Browse the repository at this point in the history
streamnative#22)

I stumbled across these minor issues while working on streamnative#23 / streamnative#8

1. A few state keys were not being set correctly in the namespace resource
2. A fix for this warning:
    > conversion from int to string yields a string of one rune,
    > not a string of digits (did you mean fmt.Sprint(x)?)
  • Loading branch information
ypt authored Dec 28, 2020
1 parent d8a1b61 commit 3bd77d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pulsar/resource_pulsar_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,10 @@ func resourcePulsarNamespaceRead(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("ERROR_READ_NAMESPACE: GetRetention: %w", err)
}

_ = d.Set("persistence_policies", schema.NewSet(retentionPoliciesToHash, []interface{}{
_ = d.Set("retention_policies", schema.NewSet(retentionPoliciesToHash, []interface{}{
map[string]interface{}{
"retention_minutes": string(ret.RetentionTimeInMinutes),
"retention_size_in_mb": string(ret.RetentionSizeInMB),
"retention_minutes": fmt.Sprint(ret.RetentionTimeInMinutes),
"retention_size_in_mb": fmt.Sprint(ret.RetentionSizeInMB),
},
}))
}
Expand All @@ -340,7 +340,7 @@ func resourcePulsarNamespaceRead(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("ERROR_READ_NAMESPACE: GetDispatchRate: %w", err)
}

_ = d.Set("persistence_policies", schema.NewSet(dispatchRateToHash, []interface{}{
_ = d.Set("dispatch_rate", schema.NewSet(dispatchRateToHash, []interface{}{
map[string]interface{}{
"dispatch_msg_throttling_rate": dr.DispatchThrottlingRateInMsg,
"rate_period_seconds": dr.RatePeriodInSecond,
Expand Down

0 comments on commit 3bd77d9

Please sign in to comment.