-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to label managedclusters... #87
Conversation
hack/ocm-minikube.sh
Outdated
@@ -8,6 +8,9 @@ set -x | |||
set -e | |||
trap 'echo exit value: $?;trap - EXIT' EXIT | |||
|
|||
# pre-requisites | |||
which jq |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hatfieldbrian if you prefer a different means to test tool availability do let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer POSIX's command -v
, but which
should work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jFYI, I had fixed this to command -v ...
as shellcheck caught the same.
with their own minikube profile names. This also lines up with the ocm-ramen-samples and cluster names used in that repository. Additionally reduced mirror snapshot time to 2m from 5m to ease testing delays. Signed-off-by: Shyamsundar Ranganathan <[email protected]>
9bfe4f9
to
87d2a2f
Compare
@@ -160,6 +163,8 @@ spoke_add() | |||
# Error from server (InternalError): Internal error occurred: failed calling webhook "managedclustermutators.admission.cluster.open-cluster-management.io": the server is currently unable to handle the request | |||
set -e | |||
date | |||
kubectl --context ${hub_cluster_name} patch managedclusters/${1} -p $(jq -cn --arg clname "$1" '{"metadata":{"labels":{"name":$clname}}}') --type=merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also in the ramen script:
ramen/hack/ocm-minikube-ramen.sh
Line 98 in 2b8b96c
kubectl --context ${hub_cluster_name} label managedclusters/${2} name=${2} --overwrite |
Based on its inclusion here I presume it is an OCM requirement, more so than a ramen one. And if so, I wonder why OCM does not do it. @BenamarMk any thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OCM upstream does not do it yet, although this is how its placement works.
I did not notice it in the ramen deploy part (had not got that far). It is better in the ocm setup as this is an expectation from the OCM setup phase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue tracker to address managedcluster labeling: open-cluster-management-io/multicloud-operators-subscription#16
@@ -160,6 +163,8 @@ spoke_add() | |||
# Error from server (InternalError): Internal error occurred: failed calling webhook "managedclustermutators.admission.cluster.open-cluster-management.io": the server is currently unable to handle the request | |||
set -e | |||
date | |||
kubectl --context ${hub_cluster_name} patch managedclusters/${1} -p $(jq -cn --arg clname "$1" '{"metadata":{"labels":{"name":$clname}}}') --type=merge | |||
date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put the date
commands in to measure how long wait-type commands take.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I approve. It seems approval is not required though since it is already merged :)
with their own minikube profile names.
This also lines up with the ocm-ramen-samples and
cluster names used in that repository.
Additionally reduced mirror snapshot time to 2m
from 5m to ease testing delays.
Signed-off-by: Shyamsundar Ranganathan [email protected]