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

Update K8s pins to 0.27.9 and controller-runtime to 0.15.3 / fix incompatibilities #3146

Merged
merged 4 commits into from
Feb 14, 2024

Conversation

Brian-McM
Copy link
Contributor

@Brian-McM Brian-McM commented Jan 31, 2024

This commit updates the pins to 0.27.9 (and controller-runtime to 0.15.3, where most of the incompabitilities lie) and fixes the incompatibilities with the new versions, specifically:

  • updating the manager creation, replacing the removed cache builder and mapper provider inputs with the replacements
  • Implementing a new Controller layer to cache the manager cache to deal with the new source.Kind requirement where you must provide a cache to the source.Kind function (previously a struct) when creatin a watch
  • Replace bits of deprecated functionality from the apiserver wait package.

For the second bullet, I've introduced our own Controller interface which extends the controller.Controller interface so the individual controller / controller utilities don't need to deal with cache management. As outlined in some of the comments for that package, I intendd to use this layer to house future adaptations for cache management (and possibly even multi tenancy) to the controller runtime package.

Description

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

@Brian-McM Brian-McM requested a review from a team as a code owner January 31, 2024 17:26
@marvin-tigera marvin-tigera added this to the v1.33.0 milestone Jan 31, 2024
@Brian-McM Brian-McM force-pushed the bm-upgrade-k8s-pins-to-0.27.9 branch from bb0c784 to 15ac5f2 Compare January 31, 2024 17:28
@Brian-McM Brian-McM changed the title Update K8s pins to 0.27.9 / fix incompatibilities Update K8s pins to 0.27.9 and controller-runtime to 0.15.3 / fix incompatibilities Jan 31, 2024
@danudey danudey modified the milestones: v1.33.0, v1.33.1 Jan 31, 2024
@Brian-McM Brian-McM force-pushed the bm-upgrade-k8s-pins-to-0.27.9 branch 2 times, most recently from 37397e1 to f6f674b Compare January 31, 2024 23:01
@danudey danudey modified the milestones: v1.33.1, v1.34.0 Jan 31, 2024
@Brian-McM Brian-McM force-pushed the bm-upgrade-k8s-pins-to-0.27.9 branch 8 times, most recently from 8acfaf7 to 737243f Compare February 1, 2024 22:12
@hjiawei
Copy link
Contributor

hjiawei commented Feb 1, 2024

K8s v1.27.10 is also released. Might be a good time to update to the latest v1.27 release.

Copy link
Member

@tmjd tmjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few thoughts but looks good.

main.go Show resolved Hide resolved
test/client.go Outdated
// See the License for the specific language governing permissions and
// limitations under the License.

package test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to move this under the pkg/runtime and keep it named fake or maybe go with fakeclient?
It would keep the context of being runtime related.
It could be added as pkg/runtime/client/fake.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dunno, I like the line of thinking, I'm just not sure if it's better to have test utils packaged under a test directory or in line with a similar package.

Copy link
Member

@tmjd tmjd Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The controller-runtime folks nested the fake package at a sub-directory to the client package so if we've got our own controller runtime package then it makes sense to me to duplicate the structure.
If you don't want to move this to under our runtime/client directory I'd probably at least suggest a sub-directory/package so it doesn't some how get mixed up with anything else under test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I updated the location, definitely feels like better organization.

@Brian-McM Brian-McM force-pushed the bm-upgrade-k8s-pins-to-0.27.9 branch from 737243f to 5aaef02 Compare February 3, 2024 00:16
…mpatibilities

This commit updates the pins to 0.27.9 (and controller-runtime to 0.15.3, where most of the incompabitilities lie)  and fixes the incompatibilities
with the new versions, specifically:
- updating the manager creation, replacing the removed cache builder and mapper
  provider inputs with the replacements
- Implementing a new Controller layer to cache the manager cache to deal
  with the new source.Kind requirement where you must provide a cache to
  the source.Kind function (previously a struct) when creatin a watch
- Replace bits of deprecated functionality from the apiserver wait
  package.
- Automatically register types that have statuses with the fake client
  using utility function (types with status now must be registered)
- updated egress controller test to not wait for proper calico version,
  just expect the first reconcile to fail and the next one to succeed
  after setting the right version

For the second bullet, I've introduced our own Controller interface
which extends the controller.Controller interface so the individual
controller / controller utilities don't need to deal with cache management.
As outlined in some of the comments for that package, I intendd to use
this layer to house future adaptations for cache management (and
possibly even multi tenancy) to the controller runtime package.
Copy link
Member

@tmjd tmjd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Brian-McM Brian-McM merged commit c0e2ab2 into tigera:master Feb 14, 2024
5 checks passed
@Brian-McM Brian-McM deleted the bm-upgrade-k8s-pins-to-0.27.9 branch February 14, 2024 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants