Skip to content

Commit d1bbde9

Browse files
committed
Changed old gitlab-on-prem instance references
1 parent a50a349 commit d1bbde9

File tree

10 files changed

+40
-47
lines changed

10 files changed

+40
-47
lines changed

.github/actions/setup-ssh/action.yaml

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,7 @@ runs:
1818
touch ~/.ssh/known_hosts
1919
ssh-keygen -R github.com
2020
ssh-keygen -R gitlab.com
21-
cat > ~/.ssh/known_hosts <<- EOM
22-
# github.com:22 SSH-2.0-babeld-a73e1397
23-
github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==
24-
# github.com:22 SSH-2.0-babeld-a73e1397
25-
github.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=
26-
# github.com:22 SSH-2.0-babeld-a73e1397
27-
github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl
28-
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
29-
gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9
30-
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
31-
gitlab.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY=
32-
# gitlab.com:22 SSH-2.0-OpenSSH_7.9p1 Debian-10+deb10u2
33-
gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf
34-
gitlab.git.dev.wkp.weave.works ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBeP3Ucl8fV9dQK3cuN8A8z1t5ah9Xwq/oVGG/MOyiE4DyCP/m+XIBJ07dW7rl5cCpGivmzURslQuSQWLM7oSMVddzKMeMA+A2Xqf+c5jEpCDx08TarBInInqjgO3Yt9NmptQ0JsQgNYLugclQVcuk832/2Ge7M9kw8Dp9SeYsIG/8oBl8DeSXp7AR21zsnH0uKRil7a8I6Nmo8wC3s8iAj1KP/dYTn0S7M+8ZYM0ubrUyKULqAWMAH2KXG4fs2Z3yaK4yWugCre8KTSF2YJYsnNkfNy2NHyb/nGgIDLP3Or0ER5mRPqUgu1vgvXIk0nVKmYfGnWvByg5e2sn4QjE/
35-
gitlab.git.dev.wkp.weave.works ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBB7Mqp5balgSUzdzgveNGarJatOw6elpMtKzawdtY+ugxWFNLskxoEydYqZFHDaS8D/bH1XvZYUemRZBd7vntbk=
36-
gitlab.git.dev.wkp.weave.works ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPUuEL+yd8UwVnrP2PLSNslqfOt7o6WGDdEcD2f8SwRB
37-
EOM
21+
ssh-keygen -R gitlab.git.dev.weave.works
22+
23+
# Append fresh new keys
24+
ssh-keyscan github.com gitlab.com gitlab.git.dev.weave.works >> ~/.ssh/known_hosts

.github/workflows/acceptance-test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ env:
146146
UI_NODEPORT: 30080
147147
NATS_NODEPORT: 31490
148148
MANAGEMENT_CLUSTER_CNAME: weave.gitops.enterprise.com
149+
UPGRADE_MANAGEMENT_CLUSTER_CNAME: weave.gitops.upgrade.enterprise.com
149150
MANAGEMENT_CLUSTER_KIND: ${{ inputs.management-cluster-kind }}
150151
GITOPS_BIN_PATH: ${{ inputs.gitops-bin-path }}
151152
ACCEPTANCE_TESTS_DATABASE_TYPE: ${{ inputs.database-type }}
@@ -275,7 +276,7 @@ jobs:
275276
git config --global user.name $USERNAME
276277
git config --global url.ssh://[email protected]/.insteadOf https://github.com/
277278
git config --global [email protected]:.insteadOf https://gitlab.com/
278-
git config --global [email protected].wkp.weave.works:.insteadOf https://gitlab.git.dev.wkp.weave.works/
279+
git config --global [email protected]:.insteadOf https://gitlab.git.dev.weave.works/
279280
- name: Download totp-cli from GH
280281
run: |
281282
wget https://github.com/yitsushi/totp-cli/releases/download/v1.1.17/totp-cli-v1.1.17-${{ inputs.os-name }}-amd64.tar.gz
@@ -291,7 +292,6 @@ jobs:
291292
chmod +x /tmp/gitops-${{ inputs.runs-on }}
292293
ls -la /tmp/gitops-${{ inputs.runs-on }}
293294
sudo mv /tmp/gitops-${{ inputs.runs-on }} ${{ env.GITOPS_BIN_PATH }}
294-
ls -la ${{ env.GITOPS_BIN_PATH }}
295295
gitops version
296296
- name: Setup selenium server
297297
if: ${{ runner.os == 'Linux' }}

.github/workflows/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
focus-or-skip: "-ginkgo.focus='@git'"
124124
kubectl-version: "v1.22.0"
125125
git-provider: gitlab
126-
git-provider_hostname: gitlab.git.dev.wkp.weave.works
126+
git-provider_hostname: gitlab.git.dev.weave.works
127127
cluster_resource_set: true
128128
management-cluster-kind: kind
129129
gitops-bin-path: /usr/local/bin/gitops

.github/workflows/nightly.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
focus-or-skip: "-ginkgo.skip='@gce|@eks|@capd|@upgrade'"
7070
kubectl-version: "v1.22.0"
7171
git-provider: gitlab
72-
git-provider_hostname: gitlab.git.dev.wkp.weave.works
72+
git-provider_hostname: gitlab.git.dev.weave.works
7373
cluster_resource_set: false
7474
management-cluster-kind: gke
7575
gitops-bin-path: /usr/local/bin/gitops

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ jobs:
119119
GITHUB_ORG: ${{ secrets.WGE_GITHUB_ORG }}
120120
GITHUB_USER: ${{ secrets.WGE_GITHUB_USER }}
121121
GITLAB_TOKEN: ${{ secrets.WGE_ON_PREM_GITLAB_TOKEN }}
122-
GIT_PROVIDER_HOSTNAME: gitlab.git.dev.wkp.weave.works
122+
GIT_PROVIDER_HOSTNAME: gitlab.git.dev.weave.works
123123
steps:
124124
- id: cache-paths
125125
run: |
@@ -297,7 +297,7 @@ jobs:
297297
focus-or-skip: "-ginkgo.focus='@smoke'"
298298
kubectl-version: "v1.22.0"
299299
git-provider: gitlab
300-
git-provider_hostname: gitlab.git.dev.wkp.weave.works
300+
git-provider_hostname: gitlab.git.dev.weave.works
301301
cluster_resource_set: true
302302
management-cluster-kind: kind
303303
gitops-bin-path: /usr/local/bin/gitops

docs/acceptance_testing.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Configure git with the following global settings. It will elevates the manual in
3939
git config --global user.name <your user name>
4040
git config --global url.ssh://[email protected]/.insteadOf https://github.com/
4141
git config --global [email protected]:.insteadOf https://gitlab.com/
42-
git config --global [email protected].wkp.weave.works:.insteadOf https://gitlab.git.dev.wkp.weave.works/
42+
git config --global [email protected]:.insteadOf https://gitlab.git.dev.weave.works/
4343

4444

4545
<font size="5">**Git provider(s) key fingerprints**</font>
@@ -50,10 +50,10 @@ Add git providers i.e. (GitHub, gitlab and gitlab-on-prm) key fingerprints to th
5050
# Clean up potentially old keys
5151
ssh-keygen -R github.com
5252
ssh-keygen -R gitlab.com
53-
ssh-keygen -R gitlab.git.dev.wkp.weave.works
53+
ssh-keygen -R gitlab.git.dev.weave.works
5454
5555
# Append fresh new keys
56-
ssh-keyscan gitlab.git.dev.wkp.weave.works github.com gitlab.com >> ~/.ssh/known_hosts
56+
ssh-keyscan gitlab.git.dev.weave.works github.com gitlab.com >> ~/.ssh/known_hosts
5757
```
5858

5959
<font size="5">**Environment variables**</font>
@@ -101,17 +101,17 @@ export GITLAB_CLIENT_SECRET=<gitlab oath app secret>
101101
**Gitlab on-prem**
102102
```
103103
export GIT_PROVIDER=gitlab
104-
export GIT_PROVIDER_HOSTNAME=gitlab.git.dev.wkp.weave.works
104+
export GIT_PROVIDER_HOSTNAME=gitlab.git.dev.weave.works
105105
export GITHUB_ORG=<gitlab group name>
106106
export GITHUB_TOKEN=<gitlab account token>
107107
export GITHUB_USER=<gitlab account user name>
108108
export GITHUB_PASSWORD=<gitlab account password>
109109
export GITLAB_CLIENT_ID=<gitlab oath app id>
110110
export GITLAB_CLIENT_SECRET=<gitlab oath app secret>
111-
export GITOPS_GIT_HOST_TYPES="gitlab.git.dev.wkp.weave.works=gitlab"
112-
export GITLAB_HOSTNAME=“gitlab.git.dev.wkp.weave.works"
111+
export GITOPS_GIT_HOST_TYPES="gitlab.git.dev.weave.works=gitlab"
112+
export GITLAB_HOSTNAME=“gitlab.git.dev.weave.works"
113113
```
114-
You can use any gitlab on-prem instance to run tests. However, `gitlab.git.dev.wkp.weave.works` instance is already setup and ready to use for development and testing purposes.
114+
You can use any gitlab on-prem instance to run tests. However, `gitlab.git.dev.weave.works` instance is already setup and ready to use for development and testing purposes.
115115
You must configure the gitlab oath application with redirect url as below. It is required for automated gitlab authentication flows (applicabel to both gilab sas and gitlab on-prem).
116116
http://weave.gitops.enterprise.com:30080/oauth/gitlab
117117

test/acceptance/test/cli_add_delete.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ func DescribeCliAddDelete(gitopsTestRunner GitopsTestRunner) {
400400
cmd := fmt.Sprintf(`%s add cluster --from-template cluster-template-development-observability-0 --set CLUSTER_NAME=%s --set NAMESPACE=%s --set KUBERNETES_VERSION=%s --set CONTROL_PLANE_MACHINE_COUNT=1 --set WORKER_MACHINE_COUNT=1 `, gitops_bin_path, clusterName, namespace, k8version) +
401401
fmt.Sprintf(`--profile 'name=podinfo,version=6.0.1' --branch "%s" --title "%s" --url %s --commit-message "%s" --description "%s" --endpoint %s %s`, prBranch, prTitle, git_repository_url, prCommit, prDescription, capi_endpoint_url, insecureFlag)
402402
By(fmt.Sprintf("And I run '%s'", cmd), func() {
403-
stdOut, stdErr = runCommandAndReturnStringOutput(cmd)
403+
stdOut, stdErr = runCommandAndReturnStringOutput(cmd, ASSERTION_30SECONDS_TIME_OUT)
404404
})
405405

406406
By("Then I should see pull request created to management cluster", func() {

test/acceptance/test/cli_upgrade.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ func DescribeCliUpgrade(gitopsTestRunner GitopsTestRunner) {
173173
serviceType, _ := runCommandAndReturnStringOutput(fmt.Sprintf(`kubectl get service weave-gitops-enterprise-nginx-ingress-controller -n %s -o jsonpath="{.spec.type}"`, GITOPS_DEFAULT_NAMESPACE))
174174
// serviceType, _ := runCommandAndReturnStringOutput(fmt.Sprintf(`kubectl get service clusters-service -n %s -o jsonpath="{.spec.type}"`, GITOPS_DEFAULT_NAMESPACE))
175175
if serviceType == "NodePort" {
176-
capi_endpoint_url = fmt.Sprintf(`http://%s:%s`, GetEnv("MANAGEMENT_CLUSTER_CNAME", "localhost"), UI_NODEPORT)
177-
test_ui_url = fmt.Sprintf(`http://%s:%s`, GetEnv("MANAGEMENT_CLUSTER_CNAME", "localhost"), UI_NODEPORT)
176+
capi_endpoint_url = fmt.Sprintf(`http://%s:%s`, GetEnv("UPGRADE_MANAGEMENT_CLUSTER_CNAME", "localhost"), UI_NODEPORT)
177+
test_ui_url = fmt.Sprintf(`http://%s:%s`, GetEnv("UPGRADE_MANAGEMENT_CLUSTER_CNAME", "localhost"), UI_NODEPORT)
178178
} else {
179179
commandToRun := fmt.Sprintf("kubectl port-forward --namespace %s svc/clusters-service 8000:80", GITOPS_DEFAULT_NAMESPACE)
180180

test/acceptance/test/ui_templates.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,9 +1215,9 @@ func DescribeTemplates(gitopsTestRunner GitopsTestRunner) {
12151215

12161216
Expect(webDriver.Refresh()).ShouldNot(HaveOccurred())
12171217
if beFound {
1218-
Eventually(checkOutput, ASSERTION_DEFAULT_TIME_OUT, POLL_INTERVAL_5SECONDS).Should(BeTrue())
1218+
Eventually(checkOutput, ASSERTION_30SECONDS_TIME_OUT, POLL_INTERVAL_5SECONDS).Should(BeTrue())
12191219
} else {
1220-
Eventually(checkOutput, ASSERTION_DEFAULT_TIME_OUT, POLL_INTERVAL_5SECONDS).Should(BeFalse())
1220+
Eventually(checkOutput, ASSERTION_30SECONDS_TIME_OUT, POLL_INTERVAL_5SECONDS).Should(BeFalse())
12211221
}
12221222

12231223
}

test/utils/scripts/wego-enterprise.sh

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ function setup {
1717
exit 1
1818
fi
1919

20+
if [ "$(uname -s)" == "Linux" ]; then
21+
LOCALHOST_IP=$(ifconfig eth0 | grep -i MASK | awk '{print $2}' | cut -f2 -d:)
22+
elif [ "$(uname -s)" == "Darwin" ]; then
23+
LOCALHOST_IP=$(ifconfig en0 | grep -i MASK | awk '{print $2}' | cut -f2 -d:)
24+
fi
25+
2026
if [ "$MANAGEMENT_CLUSTER_KIND" == "eks" ] || [ "$MANAGEMENT_CLUSTER_KIND" == "gke" ]; then
2127
WORKER_NAME=$(kubectl get node --selector='!node-role.kubernetes.io/master' -o name | head -n 1 | cut -d '/' -f2-)
2228
WORKER_NODE_EXTERNAL_IP=$(kubectl get nodes -o jsonpath="{.items[?(@.metadata.name=='${WORKER_NAME}')].status.addresses[?(@.type=='ExternalIP')].address}")
@@ -30,19 +36,17 @@ function setup {
3036
gcloud compute firewall-rules create nats-node-port --allow tcp:${NATS_NODEPORT}
3137
gcloud compute firewall-rules create ui-node-port --allow tcp:${UI_NODEPORT}
3238
fi
33-
elif [ -z ${WORKER_NODE_EXTERNAL_IP} ]; then
34-
# MANAGEMENT_CLUSTER_KIND is a KIND cluster
35-
if [ "$(uname -s)" == "Linux" ]; then
36-
WORKER_NODE_EXTERNAL_IP=$(ifconfig eth0 | grep -i MASK | awk '{print $2}' | cut -f2 -d:)
37-
elif [ "$(uname -s)" == "Darwin" ]; then
38-
WORKER_NODE_EXTERNAL_IP=$(ifconfig en0 | grep -i MASK | awk '{print $2}' | cut -f2 -d:)
39+
elif [ -z ${WORKER_NODE_EXTERNAL_IP} ]; then
40+
# MANAGEMENT_CLUSTER_KIND is a KIND cluster
41+
WORKER_NODE_EXTERNAL_IP=${LOCALHOST_IP}
3942
fi
40-
fi
4143

42-
# Sets enterprise CNAME host entry in the hosts file
44+
# Set enterprise cluster CNAME host entry in the hosts file
4345
hostEntry=$(cat /etc/hosts | grep "${WORKER_NODE_EXTERNAL_IP} ${MANAGEMENT_CLUSTER_CNAME}")
44-
if [ -z $hostEntry ]; then
46+
upgradeHostEntry=$(cat /etc/hosts | grep "${LOCALHOST_IP} ${UPGRADE_MANAGEMENT_CLUSTER_CNAME}")
47+
if [ -z "${hostEntry}" ] || [ -z "${upgradeHostEntry}" ]; then
4548
echo "${WORKER_NODE_EXTERNAL_IP} ${MANAGEMENT_CLUSTER_CNAME}" | sudo tee -a /etc/hosts
49+
echo "${LOCALHOST_IP} ${UPGRADE_MANAGEMENT_CLUSTER_CNAME}" | sudo tee -a /etc/hosts
4650
fi
4751

4852
kubectl create namespace prom
@@ -91,9 +95,8 @@ function setup {
9195

9296
# Install weave gitops core controllers
9397
$GITOPS_BIN_PATH install --config-repo ${GIT_REPOSITORY_URL} ${gitopsArgs[@]} --auto-merge
94-
95-
kubectl apply -f ${args[1]}/test/utils/scripts/entitlement-secret.yaml
96-
kubectl apply -f ${args[1]}/test/utils/data/gitlab-on-prem-ssh-config.yaml
98+
99+
kubectl apply -f ${args[1]}/test/utils/scripts/entitlement-secret.yaml
97100

98101
# Choosing weave-gitops-enterprise chart version to install
99102
if [ -z ${ENTERPRISE_CHART_VERSION} ]; then
@@ -132,6 +135,9 @@ function setup {
132135
helmArgs+=( --set "config.extraVolumes[0].configMap.name=ssh-config" )
133136
helmArgs+=( --set "config.extraVolumeMounts[0].name=ssh-config" )
134137
helmArgs+=( --set "config.extraVolumeMounts[0].mountPath=/root/.ssh" )
138+
139+
ssh-keyscan ${GIT_PROVIDER_HOSTNAME} > known_hosts
140+
kubectl create configmap ssh-config --namespace wego-system --from-file=./known_hosts
135141
fi
136142

137143
helm install my-mccp wkpv3/mccp --version "${CHART_VERSION}" --namespace wego-system ${helmArgs[@]}

0 commit comments

Comments
 (0)