Skip to content

Commit

Permalink
Fix api config location and e2e tests
Browse files Browse the repository at this point in the history
The api config location was inconsistent between the code and deployment
manifest. The new location was chosen based on
GoogleContainerTools/distroless#718.
Kubernetes v1.25 uses new types of tokens for the service accounts which
are not automatically created.
  • Loading branch information
enarha committed Dec 6, 2022
1 parent bb846d1 commit 6984e25
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type ConfigFile struct {
func main() {

viper.AddConfigPath("./env")
viper.AddConfigPath("/env")
viper.SetConfigName("config")
viper.SetConfigType("env")

Expand Down
2 changes: 1 addition & 1 deletion config/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
value: tekton-results
volumeMounts:
- name: config
mountPath: /home/nonroot/env
mountPath: /env
readOnly: true
- name: tls
mountPath: "/etc/tls"
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/00-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ export KIND_CLUSTER_NAME=${KIND_CLUSTER_NAME:-"tekton-results"}

ROOT="$(git rev-parse --show-toplevel)"

kind create cluster --loglevel=debug --config "${ROOT}/test/e2e/kind-cluster.yaml" --name=${KIND_CLUSTER_NAME} --wait=60s
kind export kubeconfig
kind create cluster --verbosity 3 --config "${ROOT}/test/e2e/kind-cluster.yaml" --name=${KIND_CLUSTER_NAME} --wait=60s
kind export kubeconfig
6 changes: 3 additions & 3 deletions test/e2e/01-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ tokens_dir=/tmp/tekton-results/tokens
mkdir -p $tokens_dir
service_accounts=(all-namespaces-read-access single-namespace-read-access)
for service_account in ${service_accounts[@]}; do
kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='$service_account')].data.token}"|base64 --decode > $tokens_dir/$service_account
kubectl create token $service_account > $tokens_dir/$service_account
echo "Created $tokens_dir/$service_account"
done

echo "Waiting for deployments to be ready..."
kubectl wait deployment "tekton-results-api" --namespace="tekton-pipelines" --for="condition=available" --timeout="60s"
kubectl wait deployment "tekton-results-watcher" --namespace="tekton-pipelines" --for="condition=available" --timeout="60s"
kubectl wait deployment "tekton-results-api" --namespace="tekton-pipelines" --for="condition=available" --timeout="90s"
kubectl wait deployment "tekton-results-watcher" --namespace="tekton-pipelines" --for="condition=available" --timeout="90s"

0 comments on commit 6984e25

Please sign in to comment.