From b52f02f61637e034bcde6a53320bf432281937a7 Mon Sep 17 00:00:00 2001 From: Edgar Garcia <63310723+edgarulg@users.noreply.github.com> Date: Wed, 17 Jul 2024 16:46:37 -0600 Subject: [PATCH] =?UTF-8?q?Revert=20"fix:=20[ASSMT-476]:=20include=20Spinn?= =?UTF-8?q?aker=20credentialsInfo=20in=20the=20pa=E2=80=A6=20(#130)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipelines.go | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/pipelines.go b/pipelines.go index a30c342..7e7726e 100644 --- a/pipelines.go +++ b/pipelines.go @@ -89,7 +89,6 @@ func migrateSpinnakerPipelines() error { } var jsonBody []byte var pipelines []map[string]interface{} - var credentials []map[string]interface{} var err error if len(migrationReq.PipelineName) > 0 { jsonBody, err = getSinglePipeline(authMethod, migrationReq.PipelineName) @@ -107,11 +106,7 @@ func migrateSpinnakerPipelines() error { if err != nil { return err } - credentials, err = getCredentialsInfo(authMethod) - if err != nil { - return err - } - payload := map[string][]map[string]interface{}{"pipelines": pipelines, "credentials": credentials} + payload := map[string][]map[string]interface{}{"pipelines": pipelines} _, err = createSpinnakerPipelines(payload) return err } @@ -339,22 +334,6 @@ func getAllPipelines(authMethod string, appName string) ([]byte, error) { return GetWithAuth(migrationReq.SpinnakerHost, "applications/"+appName+"/pipelineConfigs", authMethod, migrationReq.Auth64, migrationReq.Cert, migrationReq.Key, migrationReq.AllowInsecureReq) } -func getCredentialsInfo(authMethod string) ([]map[string]interface{}, error) { - jsonBody, err := GetWithAuth(migrationReq.SpinnakerHost, "credentials", authMethod, migrationReq.Auth64, migrationReq.Cert, migrationReq.Key, migrationReq.AllowInsecureReq) - if err != nil { - return nil, err - } - credentials, err := normalizeJsonArray(jsonBody) - if err != nil { - return nil, err - } - filtered := make([]map[string]interface{}, 0) - for _, credential := range credentials { - filtered = append(filtered, map[string]interface{}{"name": credential["name"], "type": credential["type"]}) - } - return filtered, nil -} - // this is because there's no endpoint in gate to fetch pipeline config based on a pipeline id func findPipelineById(authMethod string, appName string, pipelineId string) (map[string]interface{}, error) {