diff options
Diffstat (limited to 'app/assets/javascripts/clusters_list/clusters_util.js')
-rw-r--r-- | app/assets/javascripts/clusters_list/clusters_util.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/clusters_list/clusters_util.js b/app/assets/javascripts/clusters_list/clusters_util.js index ee36a295513..25a8426500e 100644 --- a/app/assets/javascripts/clusters_list/clusters_util.js +++ b/app/assets/javascripts/clusters_list/clusters_util.js @@ -1,10 +1,14 @@ -import { ACTIVE_CONNECTION_TIME } from './constants'; +import { ACTIVE_CONNECTION_TIME, NAME_MAX_LENGTH } from './constants'; + +function getTruncatedName(name) { + return name.substring(0, NAME_MAX_LENGTH); +} export function generateAgentRegistrationCommand({ name, token, version, address }) { return `helm repo add gitlab https://charts.gitlab.io helm repo update helm upgrade --install ${name} gitlab/gitlab-agent \\ - --namespace gitlab-agent \\ + --namespace gitlab-agent-${getTruncatedName(name)} \\ --create-namespace \\ --set image.tag=v${version} \\ --set config.token=${token} \\ |