include versionNumber as spec.versionNumber to follow k8s struct standards

This commit is contained in:
Andrew Lavery
2020-01-07 17:21:59 -08:00
parent f9b9dea1c6
commit 0fcf473f85
3 changed files with 28 additions and 6 deletions
+5 -3
View File
@@ -30,9 +30,11 @@ const VersionFilename = "version.yaml"
func writeVersionFile(path string) error {
version := troubleshootv1beta1.SupportBundleVersion{
ApiVersion: "troubleshoot.replicated.com/v1beta1",
Kind: "SupportBundle",
VersionNumber: version.Version(),
ApiVersion: "troubleshoot.replicated.com/v1beta1",
Kind: "SupportBundle",
Spec: troubleshootv1beta1.SupportBundleVersionSpec{
VersionNumber: version.Version(),
},
}
b, err := yaml.Marshal(version)
if err != nil {
+7 -3
View File
@@ -1,7 +1,11 @@
package v1beta1
type SupportBundleVersion struct {
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
Kind string `json:"kind" yaml:"kind"`
type SupportBundleVersionSpec struct {
VersionNumber string `json:"versionNumber" yaml:"versionNumber"`
}
type SupportBundleVersion struct {
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
Kind string `json:"kind" yaml:"kind"`
Spec SupportBundleVersionSpec `json:"spec" yaml:"spec"`
}
@@ -1493,6 +1493,7 @@ func (in *StorageClass) DeepCopy() *StorageClass {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SupportBundleVersion) DeepCopyInto(out *SupportBundleVersion) {
*out = *in
out.Spec = in.Spec
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SupportBundleVersion.
@@ -1505,6 +1506,21 @@ func (in *SupportBundleVersion) DeepCopy() *SupportBundleVersion {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SupportBundleVersionSpec) DeepCopyInto(out *SupportBundleVersionSpec) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SupportBundleVersionSpec.
func (in *SupportBundleVersionSpec) DeepCopy() *SupportBundleVersionSpec {
if in == nil {
return nil
}
out := new(SupportBundleVersionSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TextAnalyze) DeepCopyInto(out *TextAnalyze) {
*out = *in