Skip to content

Commit

Permalink
Fix message
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Hickey <[email protected]>
  • Loading branch information
hickeyma committed Mar 6, 2023
1 parent 5e27ca5 commit bf7c0d1
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions pkg/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,15 @@ func ReplaceManifestData(mapMetadata *mapping.Metadata, modifiedManifest string,
return "", errors.Errorf("Failed to get the deprecated or removed Kubernetes version for API: %s", strings.ReplaceAll(deprecatedAPI, "\n", " "))
}

if semver.Compare(apiVersionStr, kubeVersionStr) > 0 {
log.Printf("The following API does not require mapping as the "+
"API is not deprecated or removed in Kubernetes '%s':\n\"%s\"\n", apiVersionStr,
deprecatedAPI)
// skip to next mapping
continue
}

if count := strings.Count(modifiedManifest, deprecatedAPI); count > 0 {
if semver.Compare(apiVersionStr, kubeVersionStr) > 0 {
log.Printf("The following API:\n\"%s\" does not require mapping as the "+
"API is not deprecated or removed in Kubernetes \"%s\"\n", deprecatedAPI, kubeVersionStr)
// skip to next mapping
continue
}
if supportedAPI == "" {
log.Printf("Found %d instances of deprecated or removed Kubernetes API:\n\"%s\"\n", count, deprecatedAPI)
log.Printf("Found %d instances of deprecated or removed Kubernetes API:\n\"%s\"\nNo supported API equivalent\n", count, deprecatedAPI)
modifiedManifest = removeDeprecatedAPIWithoutSuccessor(count, deprecatedAPI, modifiedManifest)
} else {
log.Printf("Found %d instances of deprecated or removed Kubernetes API:\n\"%s\"\nSupported API equivalent:\n\"%s\"\n", count, deprecatedAPI, supportedAPI)
Expand Down

0 comments on commit bf7c0d1

Please sign in to comment.