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 controller-runtime to v0.14.x #420

Merged
merged 20 commits into from
Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ install-protoc:
if [ $(shell ${DEPSGOBIN}/protoc --version | grep -c ${PROTOC_VERSION}) -ne 0 ]; then \
echo expected protoc version ${PROTOC_VERSION} already installed ;\
else \
if [ "$(shell uname)" == "Darwin" ]; then \
if [ "$(shell uname)" = "Darwin" ]; then \
echo "downloading protoc for osx" ;\
wget $(PROTOC_URL)-osx-x86_64.zip -O $(DEPSGOBIN)/protoc-${PROTOC_VERSION}.zip ;\
elif [ "$(shell uname -m)" == "aarch64" ]; then \
elif [ "$(shell uname -m)" = "aarch64" ]; then \
echo "downloading protoc for linux aarch64" ;\
wget $(PROTOC_URL)-linux-aarch_64.zip -O $(DEPSGOBIN)/protoc-${PROTOC_VERSION}.zip ;\
else \
Expand Down
5 changes: 5 additions & 0 deletions changelog/v0.30.0/update-controller-runtime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
- type: BREAKING_CHANGE
Copy link
Contributor

Choose a reason for hiding this comment

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

could you also list the DEPENDENCY_BUMPS, particularly k8s.io/api and controller-runtime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, those seem reasonable. All were a consequence of pulling in controller-runtime.

description: Update Status API signature to comply with controller-runtime v0.14.x API breakage
issueLink: https://github.com/solo-io/skv2/issues/419

42 changes: 20 additions & 22 deletions ci/oss_compliance/osa_provided.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
Name|Version|License
---|---|---
[PuerkitoBio/purell](https://github.com/PuerkitoBio/purell)|v1.1.1|BSD 3-clause "New" or "Revised" License
[PuerkitoBio/urlesc](https://github.com/PuerkitoBio/urlesc)|v0.0.0-20170810143723-de5bf2ad4578|BSD 3-clause "New" or "Revised" License
[perks/quantile](https://github.com/beorn7/perks)|v1.0.1|MIT License
[xxhash/v2](https://github.com/cespare/xxhash)|v2.1.2|MIT License
[go-spew/spew](https://github.com/davecgh/go-spew)|v1.1.1|ISC License
[v3/log](https://github.com/emicklei/go-restful)|v3.8.0|MIT License
[v3/log](https://github.com/emicklei/go-restful)|v3.9.0|MIT License
[json-patch/v5](https://github.com/evanphx/json-patch)|v5.6.0|BSD 3-clause "New" or "Revised" License
[fsnotify/fsnotify](https://github.com/fsnotify/fsnotify)|v1.5.4|BSD 3-clause "New" or "Revised" License
[fsnotify/fsnotify](https://github.com/fsnotify/fsnotify)|v1.6.0|BSD 3-clause "New" or "Revised" License
[go-logr/logr](https://github.com/go-logr/logr)|v1.2.3|Apache License 2.0
[go-openapi/jsonpointer](https://github.com/go-openapi/jsonpointer)|v0.19.5|Apache License 2.0
[go-openapi/jsonreference](https://github.com/go-openapi/jsonreference)|v0.19.5|Apache License 2.0
[jsonreference/internal](https://github.com/go-openapi/jsonreference)|v0.20.0|Apache License 2.0
[go-openapi/swag](https://github.com/go-openapi/swag)|v0.19.14|Apache License 2.0
[gogo/protobuf](https://github.com/gogo/protobuf)|v1.3.2|BSD 3-clause "New" or "Revised" License
[groupcache/lru](https://github.com/golang/groupcache)|v0.0.0-20210331224755-41bb18bfe9da|Apache License 2.0
Expand All @@ -22,38 +20,38 @@ Name|Version|License
[josharian/intern](https://github.com/josharian/intern)|v1.0.0|MIT License
[json-iterator/go](https://github.com/json-iterator/go)|v1.1.12|MIT License
[mailru/easyjson](https://github.com/mailru/easyjson)|v0.7.6|MIT License
[golang_protobuf_extensions/pbutil](https://github.com/matttproud/golang_protobuf_extensions)|v1.0.2-0.20181231171920-c182affec369|Apache License 2.0
[golang_protobuf_extensions/pbutil](https://github.com/matttproud/golang_protobuf_extensions)|v1.0.2|Apache License 2.0
[modern-go/concurrent](https://github.com/modern-go/concurrent)|v0.0.0-20180306012644-bacd9c7ef1dd|Apache License 2.0
[modern-go/reflect2](https://github.com/modern-go/reflect2)|v1.0.2|Apache License 2.0
[munnerz/goautoneg](https://github.com/munnerz/goautoneg)|v0.0.0-20191010083416-a7dc8b61c822|BSD 3-clause "New" or "Revised" License
[pkg/errors](https://github.com/pkg/errors)|v0.9.1|BSD 2-clause "Simplified" License
[client_golang/prometheus](https://github.com/prometheus/client_golang)|v1.12.2|Apache License 2.0
[client_model/go](https://github.com/prometheus/client_model)|v0.2.0|Apache License 2.0
[prometheus/common](https://github.com/prometheus/common)|v0.32.1|Apache License 2.0
[procfs/internal](https://github.com/prometheus/procfs)|v0.7.3|Apache License 2.0
[client_golang/prometheus](https://github.com/prometheus/client_golang)|v1.14.0|Apache License 2.0
[client_model/go](https://github.com/prometheus/client_model)|v0.3.0|Apache License 2.0
[prometheus/common](https://github.com/prometheus/common)|v0.37.0|Apache License 2.0
[procfs/internal](https://github.com/prometheus/procfs)|v0.8.0|Apache License 2.0
[rotisserie/eris](https://github.com/rotisserie/eris)|v0.1.1|MIT License
[go.uber.org/atomic](https://go.uber.org/atomic)|v1.7.0|MIT License
[go.uber.org/multierr](https://go.uber.org/multierr)|v1.6.0|MIT License
[go.uber.org/zap](https://go.uber.org/zap)|v1.21.0|MIT License
[go.uber.org/zap](https://go.uber.org/zap)|v1.24.0|MIT License
[exp/maps](https://golang.org/x/exp/maps)|v0.0.0-20220921164117-439092de6870|BSD 3-clause "New" or "Revised" License
[x/net](https://golang.org/x/net)|v0.6.0|BSD 3-clause "New" or "Revised" License
[oauth2/internal](https://golang.org/x/oauth2/internal)|v0.0.0-20211104180415-d3ed0bb246c8|BSD 3-clause "New" or "Revised" License
[oauth2/internal](https://golang.org/x/oauth2/internal)|v0.0.0-20220223155221-ee480838109b|BSD 3-clause "New" or "Revised" License
[x/term](https://golang.org/x/term)|v0.5.0|BSD 3-clause "New" or "Revised" License
[x/text](https://golang.org/x/text)|v0.7.0|BSD 3-clause "New" or "Revised" License
[time/rate](https://golang.org/x/time/rate)|v0.0.0-20220609170525-579cf78fd858|BSD 3-clause "New" or "Revised" License
[time/rate](https://golang.org/x/time/rate)|v0.3.0|BSD 3-clause "New" or "Revised" License
[jsonpatch/v2](https://gomodules.xyz/jsonpatch/v2)|v2.2.0|Apache License 2.0
[google.golang.org/protobuf](https://google.golang.org/protobuf)|v1.28.0|BSD 3-clause "New" or "Revised" License
[google.golang.org/protobuf](https://google.golang.org/protobuf)|v1.28.1|BSD 3-clause "New" or "Revised" License
[gopkg.in/inf.v0](https://gopkg.in/inf.v0)|v0.9.1|BSD 3-clause "New" or "Revised" License
[gopkg.in/yaml.v2](https://gopkg.in/yaml.v2)|v2.4.0|Apache License 2.0
[gopkg.in/yaml.v3](https://gopkg.in/yaml.v3)|v3.0.1|MIT License
[k8s.io/api](https://k8s.io/api)|v0.25.4|Apache License 2.0
[k8s.io/apimachinery](https://k8s.io/apimachinery)|v0.25.4|Apache License 2.0
[k8s.io/client-go](https://k8s.io/client-go)|v0.25.4|Apache License 2.0
[config/v1alpha1](https://k8s.io/component-base/config/v1alpha1)|v0.25.4|Apache License 2.0
[v2/internal](https://k8s.io/klog/v2/internal)|v2.70.1|Apache License 2.0
[kube-openapi/pkg](https://k8s.io/kube-openapi/pkg)|v0.0.0-20220803162953-67bda5d908f1|Apache License 2.0
[k8s.io/utils](https://k8s.io/utils)|v0.0.0-20220728103510-ee6ede2d64ed|Apache License 2.0
[controller-runtime/pkg](https://sigs.k8s.io/controller-runtime/pkg)|v0.13.1|Apache License 2.0
[k8s.io/api](https://k8s.io/api)|v0.26.1|Apache License 2.0
[k8s.io/apimachinery](https://k8s.io/apimachinery)|v0.26.1|Apache License 2.0
[k8s.io/client-go](https://k8s.io/client-go)|v0.26.1|Apache License 2.0
[config/v1alpha1](https://k8s.io/component-base/config/v1alpha1)|v0.26.1|Apache License 2.0
[v2/internal](https://k8s.io/klog/v2/internal)|v2.80.1|Apache License 2.0
[kube-openapi/pkg](https://k8s.io/kube-openapi/pkg)|v0.0.0-20221012153701-172d655c2280|Apache License 2.0
[k8s.io/utils](https://k8s.io/utils)|v0.0.0-20221128185143-99ec85e7a448|Apache License 2.0
[controller-runtime/pkg](https://sigs.k8s.io/controller-runtime/pkg)|v0.14.4|Apache License 2.0
[encoding/json](https://sigs.k8s.io/json/internal/golang/encoding/json)|v0.0.0-20220713155537-f223a00ba0e2|Apache License 2.0
[structured-merge-diff/v4](https://sigs.k8s.io/structured-merge-diff/v4)|v4.2.3|Apache License 2.0
[sigs.k8s.io/yaml](https://sigs.k8s.io/yaml)|v1.3.0|MIT License
Expand Down
8 changes: 4 additions & 4 deletions codegen/templates/code/types/clients.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ type {{ $resource.Kind }}Writer interface {
type {{ $resource.Kind }}StatusWriter interface {
// Update updates the fields corresponding to the status subresource for the
// given {{ $resource.Kind }} object.
Update{{ $resource.Kind }}Status(ctx context.Context, obj *{{ $import_prefix }}{{ $resource.Kind }}, opts ...client.UpdateOption) error
Update{{ $resource.Kind }}Status(ctx context.Context, obj *{{ $import_prefix }}{{ $resource.Kind }}, opts ...client.SubResourceUpdateOption) error
Copy link
Contributor

Choose a reason for hiding this comment

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

do you know why these had to be renamed? as far as i can tell, UpdateOption and PatchOption both still exist in controller-runtime. do they behave differently in the newest controller-runtime (e.g., are they enforcing that we call the 'subresource' methods on statuses now)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From kubernetes-sigs/controller-runtime#2072

Use distinct options for subresource Update and Patch which makes this a breaking change

So I can't comment on why these API breakages had to happen other than link to the upstream pull request, but I can say that while UpdateOption and PatchOption` still exist, but now can only be applied to resources that aren't subresources.


// Patch patches the given {{ $resource.Kind }} object's subresource.
Patch{{ $resource.Kind }}Status(ctx context.Context, obj *{{ $import_prefix }}{{ $resource.Kind }}, patch client.Patch, opts ...client.PatchOption) error
Patch{{ $resource.Kind }}Status(ctx context.Context, obj *{{ $import_prefix }}{{ $resource.Kind }}, patch client.Patch, opts ...client.SubResourcePatchOption) error
}

// Client knows how to perform CRUD operations on {{ $resource.Kind }}s.
Expand Down Expand Up @@ -224,11 +224,11 @@ func (c *{{ $kindLowerCamel }}Client) Upsert{{ $resource.Kind }}(ctx context.Con
return err
}

func (c *{{ $kindLowerCamel }}Client) Update{{ $resource.Kind }}Status(ctx context.Context, obj *{{ $import_prefix }}{{ $resource.Kind }}, opts ...client.UpdateOption) error {
func (c *{{ $kindLowerCamel }}Client) Update{{ $resource.Kind }}Status(ctx context.Context, obj *{{ $import_prefix }}{{ $resource.Kind }}, opts ...client.SubResourceUpdateOption) error {
return c.client.Status().Update(ctx, obj, opts...)
}

func (c *{{ $kindLowerCamel }}Client) Patch{{ $resource.Kind }}Status(ctx context.Context, obj *{{ $import_prefix }}{{ $resource.Kind }}, patch client.Patch, opts ...client.PatchOption) error {
func (c *{{ $kindLowerCamel }}Client) Patch{{ $resource.Kind }}Status(ctx context.Context, obj *{{ $import_prefix }}{{ $resource.Kind }}, patch client.Patch, opts ...client.SubResourcePatchOption) error {
return c.client.Status().Patch(ctx, obj, patch, opts...)
}

Expand Down
16 changes: 8 additions & 8 deletions codegen/test/api/things.test.io/v1/clients.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions codegen/test/api/things.test.io/v1/mocks/clients.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading