From 464db634ec8b75fab975ebbbedf0c38431fadbe9 Mon Sep 17 00:00:00 2001 From: DeveloperJim <190177081@qq.com> Date: Mon, 2 Dec 2019 16:42:19 +0800 Subject: [PATCH] fix: client crd update err, issue #269 --- bcs-services/bcs-client/cmd/update/cutomresourcedefinition.go | 4 ++-- .../bcs-client/pkg/scheduler/v4/scheduler_customresource.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bcs-services/bcs-client/cmd/update/cutomresourcedefinition.go b/bcs-services/bcs-client/cmd/update/cutomresourcedefinition.go index ad91501b31..c4ba36cb27 100644 --- a/bcs-services/bcs-client/cmd/update/cutomresourcedefinition.go +++ b/bcs-services/bcs-client/cmd/update/cutomresourcedefinition.go @@ -76,9 +76,9 @@ func updateCustomResource(c *utils.ClientContext) error { } err = scheduler.UpdateCustomResource(c.ClusterID(), version, plural, namespace, name, data) if err != nil { - return fmt.Errorf("failed to create %s: %v", plural, err) + return fmt.Errorf("failed to update %s: %v", plural, err) } - fmt.Printf("success to update %s: %s.\n", plural, name) + fmt.Printf("success to update %s: %s\n", plural, name) return nil } diff --git a/bcs-services/bcs-client/pkg/scheduler/v4/scheduler_customresource.go b/bcs-services/bcs-client/pkg/scheduler/v4/scheduler_customresource.go index b4cc08bdeb..27028b2b30 100644 --- a/bcs-services/bcs-client/pkg/scheduler/v4/scheduler_customresource.go +++ b/bcs-services/bcs-client/pkg/scheduler/v4/scheduler_customresource.go @@ -231,7 +231,7 @@ func (bs *bcsScheduler) UpdateCustomResource(clusterID, apiVersion, plural, name baseURL := fmt.Sprintf(bcsSchedulerCustomResourceURL, bs.bcsAPIAddress) resp, err := bs.requester.DoForResponse( fmt.Sprintf("%s/%s/namespaces/%s/%s/%s", baseURL, apiVersion, namespace, plural, name), - http.MethodPost, + http.MethodPut, data, getClusterIDHeader(clusterID), )