diff --git a/ibu-imager/clusterinfo/clusterinfo.go b/ibu-imager/clusterinfo/clusterinfo.go index 797d9fd43..f87bd71a8 100644 --- a/ibu-imager/clusterinfo/clusterinfo.go +++ b/ibu-imager/clusterinfo/clusterinfo.go @@ -6,14 +6,14 @@ import ( // ClusterInfo struct that describe current cluster critical info type ClusterInfo struct { - Version string `json:"version,omitempty"` - Domain string `json:"domain,omitempty"` - ClusterName string `json:"cluster_name,omitempty"` - ClusterID string `json:"cluster_id,omitempty"` - MasterIP string `json:"master_ip,omitempty"` - ReleaseRegistry string `json:"release_registry,omitempty"` - Hostname string `json:"hostname,omitempty"` - MirrorRegistry bool `json:"mirror_registry,omitempty"` + Version string `json:"version,omitempty"` + Domain string `json:"domain,omitempty"` + ClusterName string `json:"cluster_name,omitempty"` + ClusterID string `json:"cluster_id,omitempty"` + MasterIP string `json:"master_ip,omitempty"` + ReleaseRegistry string `json:"release_registry,omitempty"` + Hostname string `json:"hostname,omitempty"` + MirrorRegistryConfigured bool `json:"mirror_registry_configured,omitempty"` } type installConfigMetadata struct { diff --git a/utils/client_helper.go b/utils/client_helper.go index e2d432bd5..60a29675f 100644 --- a/utils/client_helper.go +++ b/utils/client_helper.go @@ -118,14 +118,14 @@ func CreateClusterInfo(ctx context.Context, client runtimeclient.Client) (*clust } return &clusterinfo.ClusterInfo{ - ClusterName: installConfig.Metadata.Name, - Domain: installConfig.BaseDomain, - Version: clusterVersion.Status.Desired.Version, - ClusterID: string(clusterVersion.Spec.ClusterID), - MasterIP: ip, - ReleaseRegistry: releaseRegistry, - Hostname: hostname, - MirrorRegistry: len(mirrorRegistrySources) > 0, + ClusterName: installConfig.Metadata.Name, + Domain: installConfig.BaseDomain, + Version: clusterVersion.Status.Desired.Version, + ClusterID: string(clusterVersion.Spec.ClusterID), + MasterIP: ip, + ReleaseRegistry: releaseRegistry, + Hostname: hostname, + MirrorRegistryConfigured: len(mirrorRegistrySources) > 0, }, nil } @@ -230,12 +230,12 @@ func ShouldOverrideSeedRegistry(ctx context.Context, client runtimeclient.Client if err != nil { return false, err } - isMirrorRegistryConfigured := len(mirroredRegistries) == 0 + isMirrorRegistryConfigured := len(mirroredRegistries) > 0 // if snoa doesn't have mirror registry but seed have we should try to override registry - if !isMirrorRegistryConfigured && seedInfo.MirrorRegistry { + if !isMirrorRegistryConfigured && seedInfo.MirrorRegistryConfigured { return true, err } - return funk.ContainsString(mirroredRegistries, seedInfo.ReleaseRegistry), nil + return !funk.ContainsString(mirroredRegistries, seedInfo.ReleaseRegistry), nil }