Skip to content

Commit

Permalink
fix ClusterServiceVersion manifest to not use deprecated version
Browse files Browse the repository at this point in the history
Currently manifest templator created the field customresourcedefinitions.owned[0].version
using the deprecated crd version field.
Lets move to updated versions field.

Signed-off-by: Ram Lavi <[email protected]>
  • Loading branch information
RamLavi committed Sep 2, 2020
1 parent 0e591c3 commit 51a5064
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ spec:
customresourcedefinitions:
owned:
- name: {{.CNA.CRD.ObjectMeta.Name}}
version: {{.CNA.CRD.Spec.Version}}
version: {{.CNA.CRDVersion}}
group: {{.CNA.CRD.Spec.Group}}
kind: {{.CNA.CRD.Spec.Names.Kind}}
displayName: Cluster Network Addons
Expand Down
3 changes: 3 additions & 0 deletions tools/manifest-templator/manifest-templator.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type operatorData struct {
ClusterRules string
CRD *extv1beta1.CustomResourceDefinition
CRDString string
CRDVersion string
CRString string
RelatedImages components.RelatedImages
}
Expand Down Expand Up @@ -194,6 +195,7 @@ func getCNA(data *templateData) {
crd := components.GetCrd()
marshallObject(crd, &writer)
crdString := writer.String()
crdVersion := crd.Spec.Versions[0].Name

// Get CNA CR
writer = strings.Builder{}
Expand All @@ -215,6 +217,7 @@ func getCNA(data *templateData) {
ClusterRules: clusterRules,
CRD: crd,
CRDString: crdString,
CRDVersion: crdVersion,
CRString: crString,
RelatedImages: relatedImages,
}
Expand Down

0 comments on commit 51a5064

Please sign in to comment.