From d63c33b19ef0578b28e5768e8f4b451752446392 Mon Sep 17 00:00:00 2001 From: Heather Lanigan Date: Mon, 7 Oct 2024 18:16:11 +0000 Subject: [PATCH] test: fix permissions for microk8s install --- .github/workflows/test_integration.yml | 7 ++++--- .github/workflows/test_integration_jaas.yaml | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index 4b90312e..aa4f34f1 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -73,10 +73,11 @@ jobs: if: ${{ matrix.action-operator.cloud == 'lxd' }} run: | sudo snap install microk8s --channel=1.28-strict/stable - sudo usermod -a -G microk8s ubuntu + sudo usermod -a -G snap_microk8s $USER + sudo chown -R $USER ~/.kube sudo microk8s.enable dns storage sudo microk8s.enable dns local-storage - sudo -g microk8s -E microk8s status --wait-ready --timeout=600 + sudo -g snap_microk8s -E microk8s status --wait-ready --timeout=600 - name: Create additional networks when testing with LXD if: ${{ matrix.action-operator.cloud == 'lxd' }} run: | @@ -100,7 +101,7 @@ jobs: if: ${{ matrix.action-operator.cloud == 'lxd' }} run: | echo "MICROK8S_CONFIG<<-EOT" >> $GITHUB_ENV - microk8s.config view >> $GITHUB_ENV + sudo microk8s.config view >> $GITHUB_ENV echo "EOT" >> $GITHUB_ENV - run: go mod download - env: diff --git a/.github/workflows/test_integration_jaas.yaml b/.github/workflows/test_integration_jaas.yaml index 1c81b011..3fcb8f8d 100644 --- a/.github/workflows/test_integration_jaas.yaml +++ b/.github/workflows/test_integration_jaas.yaml @@ -66,12 +66,13 @@ jobs: - name: Setup microk8s for juju_kubernetes_cloud test run: | sudo snap install microk8s --channel=1.28-strict/stable - sudo usermod -a -G microk8s ubuntu + sudo usermod -a -G snap_microk8s $USER + sudo chown -R $USER ~/.kube sudo microk8s.enable dns storage sudo microk8s.enable dns local-storage - sudo -g microk8s -E microk8s status --wait-ready --timeout=600 + sudo -g snap_microk8s -E microk8s status --wait-ready --timeout=600 echo "MICROK8S_CONFIG<<-EOT" >> $GITHUB_ENV - microk8s.config view >> $GITHUB_ENV + sudo microk8s.config view >> $GITHUB_ENV echo "EOT" >> $GITHUB_ENV - name: Create additional networks when testing with LXD run: |