Skip to content

Commit

Permalink
[ksm] fix clustername for invalid RFC1123 cases (#10262)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nam Nguyen authored Oct 28, 2021
1 parent a3eb033 commit 14c9c7a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ def _create_kubernetes_state_prometheus_instance(self, instance):
ksm_instance['label_to_hostname'] = 'node'
clustername = get_clustername()
if clustername != "":
# some cluster names are not valid RFC1123, but as we use them as a hostAlias we want them to be valid.
clustername = clustername.replace("_", "-")
ksm_instance['label_to_hostname_suffix'] = "-" + clustername

if 'labels_mapper' in ksm_instance and not isinstance(ksm_instance['labels_mapper'], dict):
Expand Down

0 comments on commit 14c9c7a

Please sign in to comment.