Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
ci: sudo microk8s.$command
Browse files Browse the repository at this point in the history
Apparently microk8s commands now require `sudo` to run [1]. Even
`kubectl`. It's a bit annoying to have to do this, but without it all of
our builds are blocked.

According to microk8s itself, we could try a different approach:

```
Insufficient permissions to access MicroK8s.
You can either try again with sudo or add the user travis to the 'microk8s' group:
    sudo usermod -a -G microk8s travis
The new group will be available on the user's next login.
```

Although that would require a new login during a CI run, which I'm also
not a fan of.

[1] canonical/microk8s#640
  • Loading branch information
juliogreff authored and Oleg Sidorov committed Sep 12, 2019
1 parent f40c5bd commit d1d5d79
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ services:
- docker
before_install:
- sudo snap install microk8s --classic --channel=1.14/stable
- sudo snap alias microk8s.kubectl kubectl
- curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.14.6/bin/linux/amd64/kubectl > $(go env GOPATH)/bin/kubectl
- chmod +x $(go env GOPATH)/bin/kubectl
- mkdir ~/.kube
- microk8s.config > ~/.kube/config
- sudo microk8s.config > ~/.kube/config
- curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh |
sh -s -- -b $(go env GOPATH)/bin v1.17.1
- microk8s.status --wait-ready
- microk8s.enable registry
- sudo microk8s.status --wait-ready
- sudo microk8s.enable registry
install: true
script:
- "./ci/test.sh && ./ci/build.sh && ./ci/e2e.sh"
Expand Down

0 comments on commit d1d5d79

Please sign in to comment.