Skip to content

Commit

Permalink
chore: cat temp cred. add refresh to gcp-auth. in debug, look for sec…
Browse files Browse the repository at this point in the history
…ret.
  • Loading branch information
kevin-dimichel committed May 30, 2024
1 parent c5da6d3 commit d3e9d69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-helm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
service_account: '[email protected]'
# token_format: access_token
workload_identity_provider: ${{ secrets.ORG_GOOGLE_WORKLOAD_IDP }}
# export_environment_variables: true
- name: Set up gcloud
uses: google-github-actions/[email protected]
# - name: Login to GAR
Expand All @@ -55,6 +54,7 @@ jobs:
- name: Run Helm integration tests for internal
shell: bash
run: |
cat "${GOOGLE_APPLICATION_CREDENTIALS}"
make start
make test-integration-helm-internal
# integration-helm-legacy:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pre-commit: ## Run pre-commit against all files

start: ## Run minikube with ingress and gcp-auth
minikube start --wait=all
minikube addons enable gcp-auth --alsologtostderr -v=5
minikube addons enable gcp-auth --alsologtostderr -v=5 --refresh
minikube addons enable ingress

stop: ## Stop minikube
Expand Down
8 changes: 7 additions & 1 deletion tests/integration/helm/helm-internal-auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,9 @@ func (s *internalAuthHelmTest) TestHelmInstall() {

if errDeployment != nil {
// Get details why it failed
// Get k8s logs from gcp-auth
kubectlOptionsGcpAuth := k8s.NewKubectlOptions(s.context, "", "gcp-auth")

// Get k8s logs from gcp-auth
podsGcpAuth := k8s.ListPods(subT, kubectlOptionsGcpAuth, metav1.ListOptions{LabelSelector: "app=gcp-auth"})
logger.Log(subT, "Logs - GCP Auth:")
for _, pod := range podsGcpAuth {
Expand All @@ -274,6 +275,11 @@ func (s *internalAuthHelmTest) TestHelmInstall() {
logger.Log(subT, fmt.Sprintf("%s\t%s\t%s\t%s", event.Type, event.Reason, event.Related, event.Message))
}

// Get k8s secret
logger.Log(subT, "Secret in ephemeral namespace:")
secret := k8s.GetSecret(subT, kubectlOptions, "gcp-auth")
logger.Log(subT, fmt.Sprintf("%s\t%s", secret.Type, secret.ObjectMeta.CreationTimestamp))

// TODO: DRY
// Get k8s logs from pod
selectorLabelsPods := makeLabels(deployment.Spec.Selector.MatchLabels)
Expand Down

0 comments on commit d3e9d69

Please sign in to comment.