Skip to content

Commit b2c7af7

Browse files
authored
ci: switch to upstream ado org for e2e (#137)
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
1 parent 27c7d31 commit b2c7af7

9 files changed

+51
-39
lines changed

.pipelines/nightly.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ schedules:
88
include:
99
- master
1010

11-
pool:
12-
vmImage: ubuntu-latest
11+
pool: staging-pool
1312

1413
jobs:
1514
- template: templates/unit-tests-template.yml

.pipelines/pr.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ pr:
1111
exclude:
1212
- docs/*
1313

14-
pool:
15-
vmImage: ubuntu-latest
14+
pool: staging-pool
1615

1716
jobs:
1817
- template: templates/unit-tests-template.yml

.pipelines/templates/e2e-kind-template.yml

+11-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,18 @@ jobs:
1010
- name: REGISTRY_PORT
1111
value: 5000
1212
- name: KUBERNETES_VERSION
13-
value: v1.21.1
13+
value: v1.23.5
1414
- name: KIND_CLUSTER_NAME
1515
value: kms
1616
- name: KIND_NETWORK
1717
value: kind
18+
# contains the following environment variables:
19+
# - AZURE_CLIENT_ID
20+
# - AZURE_CLIENT_SECRET
21+
# - AZURE_TENANT_ID
22+
# - KEYVAULT_NAME
23+
# - KEY_NAME
24+
# - KEY_VERSION
1825
- group: kubernetes-kms
1926

2027
steps:
@@ -26,16 +33,16 @@ jobs:
2633
displayName: "Install e2e test prerequisites"
2734

2835
- script: |
29-
REGISTRY_NAME=$(REGISTRY_NAME) REGISTRY_PORT=$(REGISTRY_PORT) KUBERNETES_VERSION=$(KUBERNETES_VERSION) KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME) KIND_NETWORK=$(KIND_NETWORK) make e2e-setup-kind
36+
make e2e-setup-kind
3037
displayName: "Setup kind cluster with azure kms plugin"
3138
env:
3239
REGISTRY_NAME: $(REGISTRY_NAME)
3340
REGISTRY_PORT: $(REGISTRY_PORT)
3441
KUBERNETES_VERSION: $(KUBERNETES_VERSION)
3542
KIND_CLUSTER_NAME: $(KIND_CLUSTER_NAME)
3643
KIND_NETWORK: $(KIND_NETWORK)
37-
CLIENT_ID: $(AZURE_CLIENT_ID)
38-
CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
44+
AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
45+
AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
3946
4047
- template: cluster-health-template.yml
4148
- template: kind-debug-template.yml

.pipelines/templates/e2e-upgrade-template.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ jobs:
1010
- name: REGISTRY_PORT
1111
value: 5000
1212
- name: KUBERNETES_VERSION
13-
value: v1.21.1
13+
value: v1.23.5
1414
- name: KIND_CLUSTER_NAME
1515
value: kms
1616
- name: KIND_NETWORK
1717
value: kind
18+
# contains the following environment variables:
19+
# - AZURE_CLIENT_ID
20+
# - AZURE_CLIENT_SECRET
21+
# - AZURE_TENANT_ID
22+
# - KEYVAULT_NAME
23+
# - KEY_NAME
24+
# - KEY_VERSION
1825
- group: kubernetes-kms
1926

2027
steps:
21-
- task: GoTool@0
22-
inputs:
23-
version: 1.18
24-
2528
- script: make e2e-install-prerequisites
2629
displayName: "Install e2e test prerequisites"
2730

.pipelines/templates/manifest-template.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ steps:
1818
echo "##vso[task.setvariable variable=IMAGE_NAME]${{ parameters.imageName }}"
1919
displayName: "Generate Manifests"
2020
env:
21-
CLIENT_ID: $(AZURE_CLIENT_ID)
22-
CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
21+
AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
22+
AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET)

.pipelines/templates/scan-images-template.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ steps:
55
export OUTPUT_TYPE="type=docker"
66
make docker-init-buildx docker-build
77
8-
wget https://github.com/aquasecurity/trivy/releases/download/v$(TRIVY_VERSION)/trivy_$(TRIVY_VERSION)_Linux-64bit.tar.gz
9-
tar zxvf trivy_$(TRIVY_VERSION)_Linux-64bit.tar.gz
8+
wget https://github.com/aquasecurity/trivy/releases/download/v${TRIVY_VERSION:-0.24.4}/trivy_${TRIVY_VERSION:-0.24.4}_Linux-64bit.tar.gz
9+
tar zxvf trivy_${TRIVY_VERSION:-0.24.4}_Linux-64bit.tar.gz
1010
1111
# show all vulnerabilities in the logs
12-
./trivy "${REGISTRY}/keyvault:${IMAGE_VERSION}"
13-
14-
./trivy --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL "${REGISTRY}/keyvault:${IMAGE_VERSION}" || exit 1
12+
./trivy image "${REGISTRY}/keyvault:${IMAGE_VERSION}"
13+
./trivy image --exit-code 1 --ignore-unfixed --severity MEDIUM,HIGH,CRITICAL "${REGISTRY}/keyvault:${IMAGE_VERSION}" || exit 1
1514
displayName: "Scan images for vulnerability"

.pipelines/templates/unit-tests-template.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ jobs:
55
workspace:
66
clean: all
77
variables:
8-
- group: kubernetes-kms
8+
# contains the following environment variables:
9+
# - AZURE_CLIENT_ID
10+
# - AZURE_CLIENT_SECRET
11+
# - AZURE_TENANT_ID
12+
# - KEYVAULT_NAME
13+
# - KEY_NAME
14+
# - KEY_VERSION
15+
- group: kubernetes-kms
916

1017
steps:
11-
- task: GoTool@0
12-
inputs:
13-
version: 1.18
1418
- script: make lint
1519
displayName: Run lint
1620
- script: make unit-test
@@ -22,14 +26,14 @@ jobs:
2226
displayName: Check binary version
2327
- script: |
2428
sudo mkdir /etc/kubernetes
25-
echo -e '{\n "tenantId": "'$TENANT_ID'",\n "subscriptionId": "'$SUBSCRIPTION_ID'",\n "aadClientId": "'$CLIENT_ID'",\n "aadClientSecret": "'$CLIENT_SECRET'",\n}' | sudo tee --append /etc/kubernetes/azure.json > /dev/null
29+
echo -e '{\n "tenantId": "'$AZURE_TENANT_ID'",\n "aadClientId": "'$AZURE_CLIENT_ID'",\n "aadClientSecret": "'$AZURE_CLIENT_SECRET'",\n}' | sudo tee --append /etc/kubernetes/azure.json > /dev/null
2630
sudo chown root:root /etc/kubernetes/azure.json && sudo chmod 600 /etc/kubernetes/azure.json
2731
displayName: Setup azure.json on host
2832
env:
29-
CLIENT_ID: $(AZURE_CLIENT_ID)
30-
CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
33+
AZURE_CLIENT_ID: $(AZURE_CLIENT_ID)
34+
AZURE_CLIENT_SECRET: $(AZURE_CLIENT_SECRET)
3135
- script: |
32-
sudo ./_output/kubernetes-kms --keyvault-name $KV_NAME --key-name $KV_KEY --key-version $KV_KEY_VERSION --listen-addr "unix:///opt/azurekms.sock" > /dev/null &
36+
sudo ./_output/kubernetes-kms --keyvault-name $KEYVAULT_NAME --key-name $KEY_NAME --key-version $KEY_VERSION --listen-addr "unix:///opt/azurekms.sock" > /dev/null &
3337
echo Waiting 2 seconds for the server to start
3438
sleep 2
3539
sudo make integration-test

docs/testing.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ make e2e-install-prerequisites
1515
```
1616

1717
The E2E test suite extracts runtime configurations through environment variables. Below is a list of environment variables to set before running the E2E test suite.
18-
| Variable | Description |
19-
| ------------- | --------------------------------------------------------------------------------------------------- |
20-
| CLIENT_ID | The client ID of your service principal that has `encrypt, decrypt` access to the keyvault key. |
21-
| CLIENT_SECRET | The client secret of your service principal that has `encrypt, decrypt` access to the keyvault key. |
22-
| TENANT_ID | The Azure tenant ID. |
23-
| KEYVAULT_NAME | The Azure Keyvault name. |
24-
| KEY_NAME | The name of Keyvault key that will be used by the kms plugin. |
25-
| KEY_VERSION | The version of Keyvault key that will be used by the kms plugin. |
18+
| Variable | Description |
19+
| ------------------- | --------------------------------------------------------------------------------------------------- |
20+
| AZURE_CLIENT_ID | The client ID of your service principal that has `encrypt, decrypt` access to the keyvault key. |
21+
| AZURE_CLIENT_SECRET | The client secret of your service principal that has `encrypt, decrypt` access to the keyvault key. |
22+
| AZURE_TENANT_ID | The Azure tenant ID. |
23+
| KEYVAULT_NAME | The Azure Keyvault name. |
24+
| KEY_NAME | The name of Keyvault key that will be used by the kms plugin. |
25+
| KEY_VERSION | The version of Keyvault key that will be used by the kms plugin. |
2626

2727
## Running the tests
2828

tests/e2e/azure.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cloud": "AzurePublicCloud",
3-
"tenantId": "$TENANT_ID",
4-
"aadClientId": "$CLIENT_ID",
5-
"aadClientSecret": "$CLIENT_SECRET"
3+
"tenantId": "$AZURE_TENANT_ID",
4+
"aadClientId": "$AZURE_CLIENT_ID",
5+
"aadClientSecret": "$AZURE_CLIENT_SECRET"
66
}
7+

0 commit comments

Comments
 (0)