Repository: vmware-tanzu/tanzu-framework (language: go)

Issue:
Add custom compatibility image path to isolated-cluster plugin
**Bug description**

@Vandy-P Please add why we require this change.

**Affected product area (please put an X in all that apply)**

- ( ) APIs
- ( ) Addons
- (x) CLI
- ( ) Docs
- ( ) IAM
- ( ) Installation
- ( ) Plugin
- ( ) Security
- ( ) Test and Release
- ( ) User Experience
- ( ) Developer Experience

**Expected behavior**

**Steps to reproduce the bug**

**Version** (include the SHA if the version is not obvious)

**Environment where the bug was observed (cloud, OS, etc)**

**Relevant Debug Output (Logs, manifests, etc)**



Discussion / hints:

Fix patch:
diff --git a/cmd/cli/plugin/isolated-cluster/imagepullop/publishimagestotar.go b/cmd/cli/plugin/isolated-cluster/imagepullop/publishimagestotar.go
index cb32ba7290..2fd5a7fc32 100644
--- a/cmd/cli/plugin/isolated-cluster/imagepullop/publishimagestotar.go
+++ b/cmd/cli/plugin/isolated-cluster/imagepullop/publishimagestotar.go
@@ -26,12 +26,13 @@ import (
 const outputDir = "tmp"
 
 type PublishImagesToTarOptions struct {
-	TkgImageRepo  string
-	TkgVersion    string
-	PkgClient     imgpkginterface.ImgpkgClient
-	ImageDetails  map[string]string
-	CaCertificate string
-	Insecure      bool
+	TkgImageRepo                string
+	TkgVersion                  string
+	PkgClient                   imgpkginterface.ImgpkgClient
+	ImageDetails                map[string]string
+	CaCertificate               string
+	Insecure                    bool
+	TkgCustomCompatibilityImage string
 }
 
 var pullImage = &PublishImagesToTarOptions{}
@@ -60,6 +61,7 @@ func init() {
 	_ = PublishImagestotarCmd.MarkFlagRequired("tkg-version")
 	PublishImagestotarCmd.Flags().BoolVarP(&pullImage.Insecure, "insecure", "", false, "Trusts the server certificate without validating it (optional)")
 	PublishImagestotarCmd.Flags().StringVarP(&pullImage.CaCertificate, "ca-certificate", "", "", "The private repository’s CA certificate  (optional)")
+	PublishImagestotarCmd.Flags().StringVarP(&pullImage.TkgCustomCompatibilityImage, "tkg-custom-compatibility-image-path", "", "", "TKG compatibility image path in special case(optional)")
 	pullImage.ImageDetails = map[string]string{}
 }
 
@@ -70,9 +72,12 @@ func (p *PublishImagesToTarOptions) DownloadTkgCompatibilityImage() error {
 
 	tkgCompatibilityRelativeImagePath := "tkg-compatibility"
 
-	if !imgpkginterface.IsTKGRTMVersion(p.TkgVersion) {
+	if p.TkgCustomCompatibilityImage != "" {
+		tkgCompatibilityRelativeImagePath = p.TkgCustomCompatibilityImage
+	} else if !imgpkginterface.IsTKGRTMVersion(p.TkgVersion) {
 		tkgCompatibilityRelativeImagePath = path.Join(p.TkgVersion, tkgCompatibilityRelativeImagePath)
 	}
+
 	tkgCompatibilityImagePath := path.Join(p.TkgImageRepo, tkgCompatibilityRelativeImagePath)
 	imageTags := p.PkgClient.GetImageTagList(tkgCompatibilityImagePath)
 	if len(imageTags) == 0 {


Test patch: