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) {