mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
This relaxes the branch name restriction from 20 characters to 45. This is achieved by constructing the preview name based on the first 10 characters of the branch name and then the first 10 characters of the hashed value of the branch name. All places that (to my knowledge) rely on the preview name has been updated. Fixes https://github.com/gitpod-io/ops/issues/1252
10 lines
346 B
Bash
Executable File
10 lines
346 B
Bash
Executable File
#!/bin/bash
|
|
|
|
source ./dev/preview/util/preview-name-from-branch.sh
|
|
|
|
currentContext=$(kubectl config current-context 2>&1) || error "cannot set kubectl namespace: no current context"
|
|
namespace="staging-$(preview-name-from-branch)"
|
|
|
|
echo "Setting kubectl namespace: $namespace"
|
|
kubectl config set-context "$currentContext" --namespace "$namespace"
|