-
Notifications
You must be signed in to change notification settings - Fork 62
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
chore: v1 api #544
chore: v1 api #544
Commits on Jan 6, 2023
-
In order to create the v1 api for eraser, a number of additional changes had to be made. Our eraser-tooling image had to be modified to include the `conversion-gen` tool. This is to generate type conversions between the older `v1alpha1` API and the newer `v1`. To facilitate conversion between the two, an `unversioned` api was created. This becomes a common hub between `v1` and `v1alpha1` and facilitates conversion. It also makes it easier for our code: with the `unversioned` api, we no longer need to update large swaths of code when a new api version is introduced. In order to get the `conversion-gen` tool to work, I needed to add several magic comments throughout the api code. Most importantly, I needed to add a `doc.go` file to each of the api version directories. `conversion-gen` looks for this file and will not work without it. Above the package name in those files, I added the following two magic comments: ``` +// +k8s:conversion-gen=github.com/Azure/eraser/api/unversioned +// -external-types=github.com/Azure/eraser/api/v1 ``` This tells `conversion-gen` to use the `unversioned` api as the conversion hub. To skip kubebuilder processing the `unversioned` api, `+kubebuilder:skip` had to be added before the package declaration. To specify which api version should be stored in etcd, the `+kubebuilder:storageversion` comment was added to the `v1` types. In addition, `kubebuilder:deprecatedversion:warning="v1alpha1 of the eraser API has been deprecated"` was added to the `v1alpha1` API in order to warn the user to upgrade. In the `groupversion_info.go` file of each version directory, I had to add the line ```go localSchemeBuilder = runtime.NewSchemeBuilder(SchemeBuilder.AddToScheme) ``` To be perfectly honest, I'm not sure what this does, but it is required for the `conversion-gen` process to generate working code. Finally, a new file was added to `test/e2e/test-data` which deploys an imagelist using the new API version. One of the tests was updated to use this file instead. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 0ae1a78 - Browse repository at this point
Copy the full SHA 0ae1a78View commit details -
Re-run generation and make manifests
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 55c5f74 - Browse repository at this point
Copy the full SHA 55c5f74View commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 9080f33 - Browse repository at this point
Copy the full SHA 9080f33View commit details -
For now, use --server-side to circumvent CRD size problems
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 661c9fb - Browse repository at this point
Copy the full SHA 661c9fbView commit details -
Rebase on PodTemplate changes (eraser-dev#555) and regenerate
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for b50ac66 - Browse repository at this point
Copy the full SHA b50ac66View commit details -
Remove ImageJobSpec everywhere
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 11bdd8d - Browse repository at this point
Copy the full SHA 11bdd8dView commit details -
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 957bd84 - Browse repository at this point
Copy the full SHA 957bd84View commit details -
In order to avoid changing the Makefile every time a new version is added, add an empty package to the `./api` directory in order to use the `...` wildcard. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for e676d59 - Browse repository at this point
Copy the full SHA e676d59View commit details -
Remove --server-side flag from Makefile
This flag will no longer be needed, because we have reduced the size of the CRDs. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for f16077c - Browse repository at this point
Copy the full SHA f16077cView commit details -
Remove --server-side flag in Makefile (again)
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for a788bde - Browse repository at this point
Copy the full SHA a788bdeView commit details -
Instruct user to migrate to v1 in deprecation warning
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for d660b13 - Browse repository at this point
Copy the full SHA d660b13View commit details -
Re-generate manifests and codegen after rebasing
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for bbfd528 - Browse repository at this point
Copy the full SHA bbfd528View commit details