Skip to content

Commit

Permalink
add BestEffort in delete method for Cluster
Browse files Browse the repository at this point in the history
Signed-off-by: marcolan018 <[email protected]>
  • Loading branch information
marcolan018 committed Oct 18, 2023
1 parent 9230abc commit 3c3768a
Show file tree
Hide file tree
Showing 4 changed files with 24,571 additions and 24,534 deletions.
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 3c3768a

Please sign in to comment.