Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This drops another dependency on k8s.io/kubernetes. This does have the unfortunate side effect that implementers will now get a compile error until they update their code to use the new type. Just as a note: The stats types have moved to k8s.io/kubelet, however the stats types are only there as of v1.20. Currently we support older versions than v1.20, and even our go.mod imports from v1.19. For now we copy the types in. Later we can remove the type defs and change them to type aliases to the k8s.io/kubelet types (which prevents another compile time issue). Anything relying on type assertions to determine if something implements this method will, unfortunately, be broken and it will be hard to notice until runtime. We need to make sure to call this out in the release notes. Signed-off-by: Brian Goff <cpuguy83@gmail.com>
- Loading branch information
Showing
7 changed files
with
360 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
These types are copied from the [k8s.io/kubelet](https://pkg.go.dev/k8s.io/kubelet@v0.21.0/pkg/apis/stats/v1alpha1) module. | ||
They are used from a type alias in the API package. | ||
|
||
It is being used this way because the module is only available from 1.20 and on, but currently we are pinned to v1.19 and plan to continue to support v1.19 for some time. | ||
Likewise we want to stop importing k8s.io/kubernetes (where the older type def is) since this transatively imports all of kubernetes. | ||
|
||
After the min version is v1.20 we can update the type alias to point the the module and remove these type definitions. |
Oops, something went wrong.