Skip to content

Commit 41025f3

Browse files
varmax2511srishtipmishra
authored andcommitted
Drop before merge - breaking change for SDK retry logic, management_agent
update
1 parent 9289745 commit 41025f3

File tree

8 files changed

+572
-18
lines changed

8 files changed

+572
-18
lines changed

oci/management_agent_management_agents_data_source.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ func ManagementAgentManagementAgentsDataSource() *schema.Resource {
2727
Type: schema.TypeString,
2828
Optional: true,
2929
},
30-
"platform_type": {
30+
/*"platform_type": {
3131
Type: schema.TypeString,
3232
Optional: true,
3333
},
3434
"plugin_name": {
3535
Type: schema.TypeString,
3636
Optional: true,
37-
},
37+
},*/
3838
"state": {
3939
Type: schema.TypeString,
4040
Optional: true,
4141
},
42-
"version": {
42+
/*"version": {
4343
Type: schema.TypeString,
4444
Optional: true,
45-
},
45+
},*/
4646
"management_agents": {
4747
Type: schema.TypeList,
4848
Computed: true,
@@ -83,23 +83,23 @@ func (s *ManagementAgentManagementAgentsDataSourceCrud) Get() error {
8383
request.DisplayName = &tmp
8484
}
8585

86-
if platformType, ok := s.D.GetOkExists("platform_type"); ok {
86+
/*if platformType, ok := s.D.GetOkExists("platform_type"); ok {
8787
request.PlatformType = oci_management_agent.ListManagementAgentsPlatformTypeEnum(platformType.(string))
8888
}
8989
9090
if pluginName, ok := s.D.GetOkExists("plugin_name"); ok {
9191
tmp := pluginName.(string)
9292
request.PluginName = &tmp
93-
}
93+
}*/
9494

9595
if state, ok := s.D.GetOkExists("state"); ok {
9696
request.LifecycleState = oci_management_agent.ListManagementAgentsLifecycleStateEnum(state.(string))
9797
}
9898

99-
if version, ok := s.D.GetOkExists("version"); ok {
99+
/*if version, ok := s.D.GetOkExists("version"); ok {
100100
tmp := version.(string)
101101
request.Version = &tmp
102-
}
102+
}*/
103103

104104
request.RequestMetadata.RetryPolicy = getRetryPolicy(false, "management_agent")
105105

oci/retry.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,15 +247,13 @@ func getRetryPolicy(disableNotFoundRetries bool, service string, optionals ...in
247247

248248
func getDefaultRetryPolicy(disableNotFoundRetries bool, service string, optionals ...interface{}) *oci_common.RetryPolicy {
249249
startTime := time.Now()
250-
retryPolicy := &oci_common.RetryPolicy{
251-
MaximumNumberAttempts: 0,
252-
ShouldRetryOperation: func(response oci_common.OCIOperationResponse) bool {
253-
return shouldRetry(response, disableNotFoundRetries, service, startTime, optionals...)
254-
},
255-
NextDuration: func(response oci_common.OCIOperationResponse) time.Duration {
256-
return getRetryBackoffDuration(response, disableNotFoundRetries, service, startTime, optionals...)
257-
},
250+
maximumNumberAttempts := 0
251+
shouldRetryOperation := func(response oci_common.OCIOperationResponse) bool {
252+
return shouldRetry(response, disableNotFoundRetries, service, startTime, optionals...)
258253
}
259-
260-
return retryPolicy
254+
nexDuration := func(response oci_common.OCIOperationResponse) time.Duration {
255+
return getRetryBackoffDuration(response, disableNotFoundRetries, service, startTime, optionals...)
256+
}
257+
retryPolicy := oci_common.NewRetryPolicy(uint(maximumNumberAttempts), shouldRetryOperation, nexDuration)
258+
return &retryPolicy
261259
}

vendor/github.com/sony/gobreaker/.travis.yml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/sony/gobreaker/LICENSE

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/sony/gobreaker/README.md

Lines changed: 128 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/sony/gobreaker/go.mod

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/sony/gobreaker/go.sum

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)