Repository: kubernetes-sigs/security-profiles-operator
Pull request #501 (2021-06-24 07:05:40)

Switch to golang 1.16 for Vagrant
#### What type of PR is this?

/kind failing-test

#### What this PR does / why we need it:
The latest dependency update requires go 1.16.
#### Which issue(s) this PR fixes:

<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.

Fixes #

or

None
-->
None
#### Does this PR have test?
None
<!--
If tests aren't applicable just write N/A.
-->

#### Special notes for your reviewer:
None
#### Does this PR introduce a user-facing change?

<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".

For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
-->

```release-note
None
```


k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/501#" title="Author self-approved">saschagrunert</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fsecurity-profiles-operator).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubernetes-sigs/security-profiles-operator/blob/master/OWNERS)~~ [saschagrunert]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
codecov-commenter: # [Codecov](https://codecov.io/gh/kubernetes-sigs/security-profiles-operator/pull/501?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) Report
> Merging [#501](https://codecov.io/gh/kubernetes-sigs/security-profiles-operator/pull/501?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (1b52884) into [master](https://codecov.io/gh/kubernetes-sigs/security-profiles-operator/commit/134d336f335fcf8a6169aa9b3410191a195b8c64?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=None) (134d336) will **not change** coverage.
> The diff coverage is `n/a`.


```diff
@@           Coverage Diff           @@
##           master     #501   +/-   ##
=======================================
  Coverage   38.21%   38.21%           
=======================================
  Files          23       23           
  Lines        1201     1201           
=======================================
  Hits          459      459           
  Misses        727      727           
  Partials       15       15           
```

k8s-ci-robot: @saschagrunert: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-security-profiles-operator-test-e2e | eb22f98c0a60779dbc31933f538e2cff6c13d30e | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_security-profiles-operator/501/pull-security-profiles-operator-test-e2e/1407959742965354496) | `/test pull-security-profiles-operator-test-e2e`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=security-profiles-operator&pr=501). [Your PR dashboard](https://prow.k8s.io/pr?query=is%3Apr%20state%3Aopen%20author%3Asaschagrunert). Please help us cut down on flakes by [linking to](https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests) an [open issue](https://github.com/kubernetes-sigs/security-profiles-operator/issues?q=is:issue+is:open) when you hit one in your PR.

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
saschagrunert: /retest
k8s-ci-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/501#pullrequestreview-691463786" title="LGTM">jhrozek</a>*, *<a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/501#" title="Author self-approved">saschagrunert</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=kubernetes-sigs%2Fsecurity-profiles-operator).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubernetes-sigs/security-profiles-operator/blob/master/OWNERS)~~ [saschagrunert]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 326fdb1cc..63ec08442 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -4,6 +4,8 @@ on:
     branches:
       - master
   pull_request:
+env:
+  GO_VERSION: '1.16'
 jobs:
   macos:
     runs-on: macos-latest
@@ -11,7 +13,7 @@ jobs:
       - uses: actions/checkout@v2
       - uses: actions/setup-go@v2
         with:
-          go-version: '1.16'
+          go-version: ${{ env.GO_VERSION }}
       - run: make test-unit
       - run: make verify-go-lint
 
diff --git a/dependencies.yaml b/dependencies.yaml
index caf4f294f..cd7137360 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,4 +1,14 @@
 dependencies:
+  - name: go
+    version: 1.16
+    refPaths:
+    - path: .github/workflows/build.yml
+      match: GO_VERSION
+    - path: .github/workflows/test.yml
+      match: GO_VERSION
+    - path: hack/ci/Vagrantfile
+      match: GO_VERSION
+
   - name: golangci-lint
     version: 1.40.1
     refPaths:
diff --git a/hack/ci/Vagrantfile b/hack/ci/Vagrantfile
index a3faa19c1..6a9782376 100644
--- a/hack/ci/Vagrantfile
+++ b/hack/ci/Vagrantfile
@@ -20,6 +20,16 @@ Vagrant.configure("2") do |config|
   config.vm.provision "install-dependencies", type: "shell", run: "once" do |sh|
     sh.inline = <<~SHELL
       set -euxo pipefail
+
+      export GO_VERSION=1.16
+      curl -sSfL -o- https://dl.google.com/go/go"$GO_VERSION".linux-amd64.tar.gz |
+        tar xfz - -C /usr/local
+
+      echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile
+      echo 'export GOPATH="$HOME/go"' >> /etc/profile
+      echo 'export GOBIN="$GOPATH/bin"' >> /etc/profile
+      echo '. /etc/profile' >> $HOME/.bashrc
+
       dnf install -y \
         conntrack \
         container-selinux \


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 7a039db6a..35f692640 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -4,6 +4,8 @@ on:
     branches:
       - master
   pull_request:
+env:
+  GO_VERSION: '1.16'
 jobs:
   analyze:
     runs-on: ubuntu-latest
@@ -21,7 +23,7 @@ jobs:
       - uses: actions/checkout@v2
       - uses: actions/setup-go@v2
         with:
-          go-version: '1.16'
+          go-version: ${{ env.GO_VERSION }}
       - name: Install libseccomp-dev
         run: |
           sudo apt update