mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
In pkg/apis/extensions/v1beta1/conversion.go, some conversion code was copied from the legacy api because Pod conversions cannot be automatically generated because of something about deprecatedServiceAccount. This PR fixes two problems due to that copying. First, the copied code could drift from its source To fix that, I replaced the Convert_api_ and Convert_v1 implementations with a call to the original function. I left a wrapper in case something needed to have a package-local function name. Second, the copied Convert_* functions, were copied, in a way that they refer to other conversion functions that aren't in the current package. This prevented genconverion from working from a clean start (no conversion_generated.go). Perhaps the person who wrote this in the first place had copied the conversion_generated.go file from legacy, so it worked. So, I added the v1 package name to calls to Convert_* functions. So, when someone Cargo-Cult copies the conversion.go file, like I did, they now will not have to wonder why genconversion complains about missing Convert_ functions. Deleted the conversion_generated.go and reran genconversion and it worked, no diffs old vs new conversion_generated.go.