Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump K8s dependencies to v0.28.4 and set K8s min-version to 1.27 #2904

Closed
wants to merge 7 commits into from

Conversation

ReToCode
Copy link
Member

@ReToCode ReToCode commented Nov 28, 2023

Changes

  • Bump K8s dependencies to v0.28.4 and set K8s min-version to 1.27

Fixes #2902

Release Note

The minimal required kubernetes version to use `knative/pkg` is now v1.27.0

/assign @dprotaso

Copy link

knative-prow bot commented Nov 28, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ReToCode

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 28, 2023
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9386ad6) 81.82% compared to head (dc293ad) 81.80%.
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2904      +/-   ##
==========================================
- Coverage   81.82%   81.80%   -0.03%     
==========================================
  Files         167      167              
  Lines       10231    10231              
==========================================
- Hits         8372     8369       -3     
- Misses       1612     1614       +2     
- Partials      247      248       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ReToCode
Copy link
Member Author

Issues are related to:
knative/hack#336 and knative/hack#335

@ReToCode
Copy link
Member Author

ReToCode commented Nov 29, 2023

According to the discussion in slack, we can directly use go run instead of using the K8s script. We already did this a few lines below, not sure why the script was called in the first place. The last commit was tested with:

find apis/duck -name "zz_generated.deepcopy.go" -delete 
rm -rf client/injection
hack/update-codegen.sh
git diff
# shows no differences

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 5, 2023
@dprotaso
Copy link
Member

dprotaso commented Dec 5, 2023

hey sorry @ReToCode a update-deps merged - can you rebase?

@knative-prow-robot knative-prow-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 6, 2023
@ReToCode
Copy link
Member Author

ReToCode commented Dec 6, 2023

Not sure what is happening with the codegen:

Found diffs in: third_party/VENDOR-LICENSE/golang.org/x/sys/unix/LICENSE
fatal: ambiguous argument 'third_party/VENDOR-LICENSE/golang.org/x/sys/unix/LICENSE': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Error: Please run ./hack/update-codegen.sh.

knative/pkg is out of date. Please run hack/update-codegen.sh
Error: Process completed with exit code 1.

When I run it locally:

Diffing /Users/rlehmann/code/knative/pkg against freshly generated codegen
/Users/rlehmann/code/knative/pkg up to date.

@dprotaso
Copy link
Member

When I run ./hack/update-codegen.sh in Linux (Ubuntu docker container) I see the diff

git status
On branch bump-min-k8s
Your branch is up to date with 'origin/bump-min-k8s'.

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	deleted:    third_party/VENDOR-LICENSE/golang.org/x/sys/unix/LICENSE

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	third_party/VENDOR-LICENSE/golang.org/x/sys/LICENSE

@ReToCode
Copy link
Member Author

@dprotaso I'm still unable to reproduce. The codegen is fine in ubuntu in container and also on a GH codespace:

# Local ubuntu container
go version
go version go1.18.1 linux/arm64
...
=== Removing empty go.work.sum
Diffing /work against freshly generated codegen
/work up to date.

# GH codespace
go version
go version go1.21.4 linux/amd64
...
=== Removing empty go.work.sum
Diffing /workspaces/pkg against freshly generated codegen
/workspaces/pkg up to date.

GH action is using go 1.21, so no idea why this is different.
But as you are able to reproduce this, can you push the fix to my branch?

@dprotaso
Copy link
Member

I think you need to run this on amd64 not arm - the license tool isn't actually reporting licenses for all architectures

@dprotaso
Copy link
Member

/hold
/lgtm

@ReToCode unsure about the failures but if those were expected (and there are changes downstream) then feel free to drop the hold

@knative-prow knative-prow bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Dec 12, 2023
@ReToCode
Copy link
Member Author

I think you need to run this on amd64 not arm - the license tool isn't actually reporting licenses for all architectures

Not sure, the GH actions env was actually go version go1.21.4 linux/amd64. Anyway, its ok now.

@ReToCode unsure about the failures but if those were expected (and there are changes downstream) then feel free to drop the hold

I'm not sure what's the best approach here. Each downstream repo has to make some changes. I see these options:

a) update their hack/update-codegen.sh scripts to still call the deprecated generate-groups.sh but with exec to avoid the permission issues for now.
b) use go run to call all the generators, e.g. here an example for Serving: https://github.com/knative/serving/compare/main...ReToCode:serving:bump-k8s-deps?expand=1#diff-149dfe7bb29d1191dceae3a52915e750e64b7f87257a5fb309c29d3056e2a95dR70
c) Migrate to use k8s.io/code-generator/kube_codegen.sh

All of them have pros and cons. b) has the downside that we do not cleanup the old resources. It seems like the k8s scripts do delete old files.

Opinions? @dprotaso @skonto @pierDipi @matzew @mgencur @cardil (context: k8s 1.28 made changes to the generator scripts).

@dprotaso
Copy link
Member

I'd suggest just using go run and not wait - it's what gateway API is doing

@dprotaso
Copy link
Member

Not sure, the GH actions env was actually go version go1.21.4 linux/amd64. Anyway, its ok now.

Your container env was using arm arch

@knative-prow-robot knative-prow-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 18, 2023
@knative-prow-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ReToCode
Copy link
Member Author

ReToCode commented Jan 8, 2024

I'd suggest just using go run and not wait - it's what gateway API is doing

@dprotaso I also like that approach, but is it ok to lose the cleanup?

All of them have pros and cons. b) has the downside that we do not cleanup the old resources. It seems like the k8s scripts do delete old files.

@ReToCode
Copy link
Member Author

ReToCode commented Jan 8, 2024

As the release is very close, we'll just keep the old generators and just bump K8s deps here. I opened #2927 to tackle the generation change separatly.

@ReToCode ReToCode closed this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test-and-release do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump K8s min version to v1.27
3 participants