Skip to content

Commit

Permalink
Preserve crd conversion data
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Jun 2, 2024
1 parent d0e01cd commit b895017
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apiextensions/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ func RegisterCRDs(client crd_cs.Interface, crds []*CustomResourceDefinition) err
in.Labels = meta_util.OverwriteKeys(in.Labels, crd.V1.Labels)
in.Annotations = meta_util.OverwriteKeys(in.Annotations, crd.V1.Annotations)

conversion := in.Spec.Conversion
in.Spec = crd.V1.Spec
// preserve conversion
if in.Spec.Conversion == nil && conversion != nil {
in.Spec.Conversion = conversion
}
return in
},
metav1.UpdateOptions{},
Expand Down

0 comments on commit b895017

Please sign in to comment.