Skip to content

Commit 05a01eb

Browse files
committed
Add 'name' parameter for OCM cluster search
Some clusters use "display_name" as a longer, more descriptive field. And example of this is `osd-v4stg-aws`, which has: ``` Display Name: SRE long lived cluster in production: osd-v4stg-aws ``` This causes osd-v4stg-aws (or others) to not be found when searching by the human friendly name, as identified by @rendhalver in a [recent pr review](#300 (comment)). This PR adds "name" to the OCM cluster search parameters, which is the parameter used by ocm-cli when it performs the same search. Signed-off-by: Chris Collins <[email protected]>
1 parent 2d9e91d commit 05a01eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/bashrc.d/06-sre-login-libs.bashrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# shellcheck shell=bash
22

33
function cluster_info_env_export(){
4-
SEARCH_STRING="id like '$INITIAL_CLUSTER_LOGIN' or external_id like '$INITIAL_CLUSTER_LOGIN' or display_name like '$INITIAL_CLUSTER_LOGIN'"
4+
SEARCH_STRING="id like '$INITIAL_CLUSTER_LOGIN' or external_id like '$INITIAL_CLUSTER_LOGIN' or name like '$INITIAL_CLUSTER_LOGIN' or display_name like '$INITIAL_CLUSTER_LOGIN'"
55
cluster_details=$(ocm list clusters --parameter=search="(($SEARCH_STRING))" --columns "id, external_id, name" --no-headers)
66
CLUSTER_ID=$(awk '{print $1}' <<< $cluster_details)
77
CLUSTER_UUID=$(awk '{print $2}' <<< $cluster_details)

0 commit comments

Comments
 (0)