Skip to content

Commit

Permalink
Merge pull request #853 from marcolan018/ocm-3604
Browse files Browse the repository at this point in the history
add BestEffort in delete method for Cluster
  • Loading branch information
gdbranco authored Oct 18, 2023
2 parents 9230abc + 1683135 commit 4cbe9ce
Show file tree
Hide file tree
Showing 6 changed files with 24,576 additions and 24,535 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This document describes the relevant changes between releases of the OCM API
SDK.

## 0.1.375
- Update model version v0.0.327
- Add `BestEffort` to method `Delete` in `Cluster`

## 0.1.374
- Update model version v0.0.326
- Add `BackplaneURL` to `Environment` type
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export PATH := $(LOCAL_BIN_PATH):$(PATH)
export CGO_ENABLED=0

# Details of the model to use:
model_version:=v0.0.326
model_version:=v0.0.327
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
Expand Down
12 changes: 12 additions & 0 deletions clustersmgmt/v1/cluster_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ type ClusterDeleteRequest struct {
path string
query url.Values
header http.Header
bestEffort *bool
deprovision *bool
dryRun *bool
}
Expand All @@ -539,6 +540,14 @@ func (r *ClusterDeleteRequest) Impersonate(user string) *ClusterDeleteRequest {
return r
}

// BestEffort sets the value of the 'best_effort' parameter.
//
// BestEffort flag is used to check if the cluster deletion should be best-effort mode or not.
func (r *ClusterDeleteRequest) BestEffort(value bool) *ClusterDeleteRequest {
r.bestEffort = &value
return r
}

// Deprovision sets the value of the 'deprovision' parameter.
//
// If false it will only delete from OCM but not the actual cluster resources.
Expand Down Expand Up @@ -567,6 +576,9 @@ func (r *ClusterDeleteRequest) Send() (result *ClusterDeleteResponse, err error)
// SendContext sends this request, waits for the response, and returns it.
func (r *ClusterDeleteRequest) SendContext(ctx context.Context) (result *ClusterDeleteResponse, err error) {
query := helpers.CopyQuery(r.query)
if r.bestEffort != nil {
helpers.AddValue(&query, "best_effort", *r.bestEffort)
}
if r.deprovision != nil {
helpers.AddValue(&query, "deprovision", *r.deprovision)
}
Expand Down
Loading

0 comments on commit 4cbe9ce

Please sign in to comment.