Repository: kubernetes-sigs/security-profiles-operator
Pull request #2117 (2024-02-08 11:29:09)

Update golang to v1.22


#### What type of PR is this?


/kind cleanup


#### What this PR does / why we need it:
Update golang to the latest release.
#### 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/2117#" 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/main/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":[]} -->
k8s-ci-robot: @saschagrunert: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-security-profiles-operator-verify | c6f4015733e05fb6be4f86dbc7708ab528fe7e62 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_security-profiles-operator/2117/pull-security-profiles-operator-verify/1755554367743725568) | true | `/test pull-security-profiles-operator-verify`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=security-profiles-operator&pr=2117). [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 -->
k8s-ci-robot: @saschagrunert: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-security-profiles-operator-verify | c6f4015733e05fb6be4f86dbc7708ab528fe7e62 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_security-profiles-operator/2117/pull-security-profiles-operator-verify/1755554367743725568) | true | `/test pull-security-profiles-operator-verify`
pull-security-profiles-operator-build-image | c6f4015733e05fb6be4f86dbc7708ab528fe7e62 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_security-profiles-operator/2117/pull-security-profiles-operator-build-image/1755554367898914816) | true | `/test pull-security-profiles-operator-build-image`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=security-profiles-operator&pr=2117). [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 -->
codecov-commenter: ## [Codecov](https://app.codecov.io/gh/kubernetes-sigs/security-profiles-operator/pull/2117?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubernetes-sigs) Report
> Merging [#2117](https://app.codecov.io/gh/kubernetes-sigs/security-profiles-operator/pull/2117?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubernetes-sigs) (c6f4015) into [main](https://app.codecov.io/gh/kubernetes-sigs/security-profiles-operator/commit/11d77f49d652b2b077eaeb9a0ef9eff5f24b6a8d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubernetes-sigs) (11d77f4) will **decrease** coverage by `4.72%`.
> Report is 28 commits behind head on main.
> The diff coverage is `0.00%`.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##             main    #2117      +/-   ##
==========================================
- Coverage   45.50%   40.78%   -4.72%     
==========================================
  Files          79       98      +19     
  Lines        7782    14913    +7131     
==========================================
+ Hits         3541     6082    +2541     
- Misses       4099     8402    +4303     
- Partials      142      429     +287     
```

</details>
k8s-ci-robot: @saschagrunert: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-security-profiles-operator-verify | c6f4015733e05fb6be4f86dbc7708ab528fe7e62 | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_security-profiles-operator/2117/pull-security-profiles-operator-verify/1755554367743725568) | true | `/test pull-security-profiles-operator-verify`
pull-security-profiles-operator-build-image | 785c9b82435e0f8aad8cd8236bf674041e07bbda | [link](https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/kubernetes-sigs_security-profiles-operator/2117/pull-security-profiles-operator-build-image/1755557732527640576) | true | `/test pull-security-profiles-operator-build-image`

[Full PR test history](https://prow.k8s.io/pr-history?org=kubernetes-sigs&repo=security-profiles-operator&pr=2117). [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: @kubernetes-sigs/security-profiles-operator-maintainers PTAL
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/2117#pullrequestreview-1870586948" title="Approved">ccojocar</a>*, *<a href="https://github.com/kubernetes-sigs/security-profiles-operator/pull/2117#" 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/main/OWNERS)~~ [ccojocar,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 4f4c2d7b4..af860a961 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -7,7 +7,7 @@ on:
     types: [published]
   pull_request:
 env:
-  GO_VERSION: '1.21'
+  GO_VERSION: '1.22'
   NIX_VERSION: '2.18.1'
   BOM_VERSION: v0.5.1
 
diff --git a/Makefile b/Makefile
index fafa701b7..a5b3fd9be 100644
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@ REPO_INFRA_VERSION = v0.2.5
 KUSTOMIZE_VERSION = 5.2.1
 OPERATOR_SDK_VERSION ?= v1.25.0
 ZEITGEIST_VERSION = v0.4.3
-CI_IMAGE ?= golang:1.21
+CI_IMAGE ?= golang:1.22
 
 CONTROLLER_GEN_CMD := CGO_LDFLAGS= $(GO) run $(BUILD_FLAGS) -tags generate sigs.k8s.io/controller-tools/cmd/controller-gen
 
diff --git a/dependencies.yaml b/dependencies.yaml
index 5c954ea09..70ed6e42e 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,9 +1,7 @@
 dependencies:
   - name: go
-    version: 1.21
+    version: 1.22
     refPaths:
-    - path: go.mod
-      match: go
     - path: .github/workflows/build.yml
       match: GO_VERSION
     - path: .github/workflows/test.yml
diff --git a/nix/derivation-bpf.nix b/nix/derivation-bpf.nix
index 8c852b55b..96fc0b126 100644
--- a/nix/derivation-bpf.nix
+++ b/nix/derivation-bpf.nix
@@ -1,5 +1,5 @@
 { pkgs, buildGoModule, arch ? "x86" }:
-with pkgs; buildGo121Module rec {
+with pkgs; buildGo122Module rec {
   name = "security-profiles-operator";
   src = ./..;
   vendorHash = null;
diff --git a/nix/derivation.nix b/nix/derivation.nix
index 323a02676..19e047a93 100644
--- a/nix/derivation.nix
+++ b/nix/derivation.nix
@@ -1,5 +1,5 @@
 { pkgs, buildGoModule }:
-with pkgs; buildGo121Module rec {
+with pkgs; buildGo122Module rec {
   name = "security-profiles-operator";
   src = ./..;
   vendorHash = null;
diff --git a/nix/nixpkgs.json b/nix/nixpkgs.json
index 7b225fe1b..6e0213efb 100644
--- a/nix/nixpkgs.json
+++ b/nix/nixpkgs.json
@@ -1,10 +1,10 @@
 {
   "url": "https://github.com/nixos/nixpkgs",
-  "rev": "9aaa0ca4451bc8e7ed06b204eae9d4111654fa66",
-  "date": "2023-11-28T09:08:34+01:00",
-  "path": "/nix/store/bqal42i0mpbn0fpjcwsws0lmlf0fg39z-nixpkgs",
-  "sha256": "0k5x7ic3mmayqxqirn7dj8cw3jwzkjmslc5bhmpn1j8gylyj9vcc",
-  "hash": "sha256-jO0kPfUPyWBvhaswqqucn8vBGZLt2Bxxx17VOlg8vUw=",
+  "rev": "11bc6db58203ae1180b6b349e1d669a7a244b433",
+  "date": "2024-02-08T06:47:21-05:00",
+  "path": "/nix/store/35lysqcsmizwnh6k9qn5kpbszwvqhsxy-nixpkgs",
+  "sha256": "1lnbpw6grccima4zq690jkkx5550gs1sp62avyhbc10cwb1ymdbi",
+  "hash": "sha256-cbXqw+IMBLag30qYq4N+oJTS55QgGfyJqpGx/Ay/y9I=",
   "fetchLFS": false,
   "fetchSubmodules": false,
   "deepClone": false,


Test patch:
diff --git a/.github/workflows/olm_tests.yaml b/.github/workflows/olm_tests.yaml
index b2bad3845..beaf59937 100644
--- a/.github/workflows/olm_tests.yaml
+++ b/.github/workflows/olm_tests.yaml
@@ -5,7 +5,7 @@ on:
       - main
   pull_request:
 env:
-  GO_VERSION: '1.21'
+  GO_VERSION: '1.22'
   KIND_IMG_TAG: v1.29.1
 
 permissions: {}
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index c2e6a364b..8c5d6dd1f 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -5,7 +5,7 @@ on:
       - main
   pull_request:
 env:
-  GO_VERSION: '1.21'
+  GO_VERSION: '1.22'
 
 permissions: {}