-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate embedded objectmeta in CRDs
make it so embedded ObjectMeta in the CRD get's properly generated if the generator option generateEmbeddedObjectMeta=true is passed, this is needed because if a CRD has embedded ObjectMeta in any field and preserveUnknowFields is set to false, all the metadata will be lost when doing conversion between versions. By default any embedded ObjectMeta is not generated in the resulting CRD, however the top level ObjectMeta belonging to the CRD itself is never generated as the kubernetes API disallows changes to the CRD metadata between conversions. The generated ObjectMeta is also only a subset of the original set of fields inside ObjectMeta this is due to the fact that other runtime fields are problematic if they are being traded with the kubernetes API, such as creationTimeStamp so this only generates name, namespace, labels, annotations and finalizers which from a design perspective should be enough. An example of why this is useful is if a CRD had a volumeClaimTemplate (for an underlying statefulset) which include ObjectMeta such as Labels, Annotations and/or name which are meant to be passed to the PVC. Also addresses the type of FieldsV1 being typed as "Any" and instead types it as "object"
- Loading branch information
Showing
6 changed files
with
88 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,4 @@ require ( | |
k8s.io/apimachinery v0.20.2 | ||
sigs.k8s.io/yaml v1.2.0 | ||
) | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.