Skip to content

Commit 0fcf473

Browse files
committed
include versionNumber as spec.versionNumber to follow k8s struct standards
1 parent f9b9dea commit 0fcf473

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

cmd/troubleshoot/cli/version.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ const VersionFilename = "version.yaml"
3030

3131
func writeVersionFile(path string) error {
3232
version := troubleshootv1beta1.SupportBundleVersion{
33-
ApiVersion: "troubleshoot.replicated.com/v1beta1",
34-
Kind: "SupportBundle",
35-
VersionNumber: version.Version(),
33+
ApiVersion: "troubleshoot.replicated.com/v1beta1",
34+
Kind: "SupportBundle",
35+
Spec: troubleshootv1beta1.SupportBundleVersionSpec{
36+
VersionNumber: version.Version(),
37+
},
3638
}
3739
b, err := yaml.Marshal(version)
3840
if err != nil {
Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
package v1beta1
22

3-
type SupportBundleVersion struct {
4-
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
5-
Kind string `json:"kind" yaml:"kind"`
3+
type SupportBundleVersionSpec struct {
64
VersionNumber string `json:"versionNumber" yaml:"versionNumber"`
75
}
6+
7+
type SupportBundleVersion struct {
8+
ApiVersion string `json:"apiVersion" yaml:"apiVersion"`
9+
Kind string `json:"kind" yaml:"kind"`
10+
Spec SupportBundleVersionSpec `json:"spec" yaml:"spec"`
11+
}

pkg/apis/troubleshoot/v1beta1/zz_generated.deepcopy.go

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)