From 6d57cf8eebc58bc65ac96162e4aee26aa500b980 Mon Sep 17 00:00:00 2001 From: Chamal Abeywardhana Date: Mon, 7 Jul 2025 11:34:35 +1000 Subject: [PATCH] Updating the cluster search query to fix the issue raised here https://redhat-internal.slack.com/archives/CCX9DB894/p1751844023449509?thread_ts=1751841330.781889&cid=CCX9DB894 --- cmd/cluster/from_infra_id.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/cluster/from_infra_id.go b/cmd/cluster/from_infra_id.go index a3c70ec4f..0bf799258 100644 --- a/cmd/cluster/from_infra_id.go +++ b/cmd/cluster/from_infra_id.go @@ -3,6 +3,10 @@ package cluster import ( "encoding/json" "fmt" + "os" + "sort" + "strings" + sdk "github.com/openshift-online/ocm-sdk-go" amv1 "github.com/openshift-online/ocm-sdk-go/accountsmgmt/v1" v1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1" @@ -11,9 +15,6 @@ import ( "github.com/spf13/cobra" "gopkg.in/yaml.v2" cmdutil "k8s.io/kubectl/pkg/cmd/util" - "os" - "sort" - "strings" ) type fromInfraIdOptions struct { @@ -72,7 +73,7 @@ func (ops *fromInfraIdOptions) run(cmd *cobra.Command, args []string) error { } clusters, err := utils.ApplyFilters( ocmClient, - []string{fmt.Sprintf("name like '%s%%'", clusterName)}, + []string{fmt.Sprintf("infra_id like '%s%%'", clusterName)}, ) if err != nil { return fmt.Errorf("could not retrieve clusters for %s", infraId)