Skip to content

Update to latest Kubebuilder (v4) and Go (1.22)#2542

Merged
Weltraumschaf merged 19 commits intosecureCodeBox:mainfrom
J12934:update-golang
Jun 28, 2024
Merged

Update to latest Kubebuilder (v4) and Go (1.22)#2542
Weltraumschaf merged 19 commits intosecureCodeBox:mainfrom
J12934:update-golang

Conversation

@J12934
Copy link
Member

@J12934 J12934 commented Jun 26, 2024

Description

Updates to golang 1.22

While searching for 1.22, I've notitced we had some doc pages linking to kubernetes api pages with hardcoded (and terribly outdated) versions. I think at that point the new version independend links didn't exist. Fixed it in here too.

Kubebuilder and their tooling was having problems with golang 1.22.
I've updated Kubuilder to the latest version for both the operator and auto-discovery/kubernetes which are the two places where we are using it. This was quit a bit of work, see the commits for more context.

Checklist

  • Test your changes as thoroughly as possible before you commit them. Preferably, automate your test by unit/integration tests.
  • Make sure that all your commits are signed-off and that you are added to the Contributors file.
  • Make sure that all CI finish successfully.
  • Optional (but appreciated): Make sure that all commits are Verified.

@J12934 J12934 self-assigned this Jun 26, 2024
@netlify
Copy link

netlify bot commented Jun 26, 2024

Deploy Preview for docs-securecodebox canceled.

Name Link
🔨 Latest commit 62bdbd1
🔍 Latest deploy log https://app.netlify.com/sites/docs-securecodebox/deploys/667dc8e2bbc21c0008338b5e

@J12934 J12934 marked this pull request as draft June 26, 2024 19:36
J12934 added 8 commits June 27, 2024 19:58
Signed-off-by: Jannik Hollenbach <[email protected]>
Signed-off-by: Jannik Hollenbach <[email protected]>
Signed-off-by: Jannik Hollenbach <[email protected]>
Hash changed as new fields were added to the job spec with default values and so on.
This causes the hash to change for each version

Signed-off-by: Jannik Hollenbach <[email protected]>
Finally supported by the newer kubebuilder version

Signed-off-by: Jannik Hollenbach <[email protected]>
Signed-off-by: Jannik Hollenbach <[email protected]>
J12934 added 5 commits June 27, 2024 20:21
Signed-off-by: Jannik Hollenbach <[email protected]>
At least it seems unnecessary.
Script came directly from the newer kubebuilder version

Signed-off-by: Jannik Hollenbach <[email protected]>
controller-gen now finally omits the empty createdAt timestamps

Signed-off-by: Jannik Hollenbach <[email protected]>
kubebuilder now ensures that the correct version is installed which is great!
Missed the pinning at first

Signed-off-by: Jannik Hollenbach <[email protected]>
This turned out to be a bit tricky because of the deprecation/removal of the controller runtime config handling.
I've moved the config handling to use viper now which seems to be working fine.
Had to move some stuff around for it, like he metav1.Duration to the default duration.
This actually made the code cleaner so no complaints from me.

Signed-off-by: Jannik Hollenbach <[email protected]>
@J12934 J12934 changed the title Update to Go 1.22 Update to latest Kubebuilder (v4) and Go (1.22) Jun 27, 2024
J12934 added 6 commits June 27, 2024 21:56
The empty creation timestamp is no longer auto-generated by kube-builder

Signed-off-by: Jannik Hollenbach <[email protected]>
CI was already executing the tests seperatly

Signed-off-by: Jannik Hollenbach <[email protected]>
Was there to have the kubebuilder managed config file, but was removed with the migration to viper

Signed-off-by: Jannik Hollenbach <[email protected]>
Newer helm unit versions don't include the notes of subcharts anymore
Which is good as we don't control it and it's not displayed to users

Signed-off-by: Jannik Hollenbach <[email protected]>
@J12934 J12934 marked this pull request as ready for review June 27, 2024 20:19
@Weltraumschaf Weltraumschaf merged commit e50e25b into secureCodeBox:main Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants