From 8e041444e93085487498f1e54330ccc5566b2932 Mon Sep 17 00:00:00 2001 From: Ritek Rounak Date: Tue, 27 Aug 2024 19:09:34 +0530 Subject: [PATCH] feat: [ASSMT-551]: Add Skip Details in Migration Summary --- pipelines.go | 8 ++++++++ types.go | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/pipelines.go b/pipelines.go index 7e7726e..2d8a89c 100644 --- a/pipelines.go +++ b/pipelines.go @@ -412,6 +412,14 @@ func createSpinnakerPipelines(pipelines interface{}) (reqId string, err error) { reqId = resource.RequestId log.Infof("The request id is - %s", reqId) } + if resource.SkipDetails != nil && len(resource.SkipDetails) > 0 { + jsonData, err := json.MarshalIndent(resource.SkipDetails, "", " ") + if err != nil { + return "", fmt.Errorf("failed to marshal resource skip details JSON: %v", err) + } + jsonString := string(jsonData) + log.Warnf("Entity not migrated : %s", jsonString) + } reconcilePipeline(resp, queryParams) log.Info("Spinnaker migration completed") return reqId, nil diff --git a/types.go b/types.go index a569c28..aee6330 100644 --- a/types.go +++ b/types.go @@ -175,6 +175,11 @@ type SkipDetail struct { Reason string `json:"reason"` } +type NGSkipDetail struct { + Type string `json:"type"` + Reason string `json:"reason"` +} + type UpgradeError struct { Message string `json:"message"` Entity CurrentGenEntity `json:"entity"` @@ -191,6 +196,7 @@ type Resource struct { Errors []UpgradeError `json:"errors"` Status string `json:"status"` ResponsePayload interface{} `json:"responsePayload"` + SkipDetails []NGSkipDetail `json:"skipDetails"` } type ResponseBody struct {