diff --git a/hack/install-git-server.sh b/hack/install-git-server.sh index 7c0bd02654..be3f56b963 100755 --- a/hack/install-git-server.sh +++ b/hack/install-git-server.sh @@ -17,31 +17,79 @@ set -o nounset set -o pipefail git_server() { - echo "Creating Git Server Knative service..." - cat << EOF | kubectl apply -f - -apiVersion: serving.knative.dev/v1 -kind: Service + echo "Creating Git Server" + + local name="func-git" + + local namespace + namespace="$(kubectl config view --minify --output 'jsonpath={..namespace}')" + namespace="${namespace:-"default"}" + + + local ingress_class="contour-external" + local cluster_domain="localtest.me" + if kubectl api-versions | grep -q openshift.io; then + cluster_domain="$(kubectl get ingresses.config/cluster -o jsonpath='{.spec.domain}')" + ingress_class="openshift-default" + fi + + + local -r func_git_host="${name}.${namespace}.${cluster_domain}" + + kubectl apply -f - <