From a3b79756903eb102d97ff52e3f4ab96f19ac8220 Mon Sep 17 00:00:00 2001 From: Xav Paice Date: Tue, 6 Jun 2023 07:19:49 +1200 Subject: [PATCH] Update the preflight secret label to troubleshoot.sh/kind (#1204) Partial-fix: #1070 Changes the default label for preflights to troubleshoot.sh/kind: preflight --- pkg/preflight/read_specs.go | 4 ++-- .../troubleshoot_v1beta2_preflight_secret_gotest.yaml | 2 +- ...oubleshoot_v1beta2_preflight_secret_stringdata_gotest.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/preflight/read_specs.go b/pkg/preflight/read_specs.go index caf50436..14257813 100644 --- a/pkg/preflight/read_specs.go +++ b/pkg/preflight/read_specs.go @@ -34,7 +34,7 @@ type documentMetadata struct { } type documentMetadataLabels struct { - TroubleshootKind string `yaml:"troubleshoot.io/kind,omitempty"` + TroubleshootKind string `yaml:"troubleshoot.sh/kind,omitempty"` } type documentData struct { @@ -136,7 +136,7 @@ func (p *PreflightSpecs) Read(args []string) error { return types.NewExitCodeError(constants.EXIT_CODE_SPEC_ISSUES, errors.Wrap(err, "failed to parse yaml")) } - // We're going to look for either of "kind: Preflight" OR "kind: Secret" with the label "troubleshoot.io/kind: preflight" + // We're going to look for either of "kind: Preflight" OR "kind: Secret" with the label "troubleshoot.sh/kind: preflight" if parsedDocHead.Kind != "Preflight" && parsedDocHead.Kind != "Secret" { continue diff --git a/testdata/preflightspec/troubleshoot_v1beta2_preflight_secret_gotest.yaml b/testdata/preflightspec/troubleshoot_v1beta2_preflight_secret_gotest.yaml index ff5544a4..2a17d053 100644 --- a/testdata/preflightspec/troubleshoot_v1beta2_preflight_secret_gotest.yaml +++ b/testdata/preflightspec/troubleshoot_v1beta2_preflight_secret_gotest.yaml @@ -11,7 +11,7 @@ metadata: app.kubernetes.io/instance: "release-name" app.kubernetes.io/version: 0.62.1 helm.sh/chart: "troubleshoot-0.1.0" - troubleshoot.io/kind: preflight + troubleshoot.sh/kind: preflight name: "release-name-preflight-config" data: preflight.yaml: CmFwaVZlcnNpb246IHRyb3VibGVzaG9vdC5zaC92MWJldGEyCmtpbmQ6IFByZWZsaWdodAptZXRhZGF0YToKICBuYW1lOiBwcmVmbGlnaHQtc2FtcGxlCnNwZWM6CiAgCiAgYW5hbHl6ZXJzOgogICAgLSBub2RlUmVzb3VyY2VzOgogICAgICAgIGNoZWNrTmFtZTogTm9kZSBDb3VudCBDaGVjawogICAgICAgIG91dGNvbWVzOgogICAgICAgICAgLSBmYWlsOgogICAgICAgICAgICAgIHdoZW46ICdjb3VudCgpIDwgMycKICAgICAgICAgICAgICBtZXNzYWdlOiBUaGUgY2x1c3RlciBuZWVkcyBhIG1pbmltdW0gb2YgMyBub2Rlcy4KICAgICAgICAgIC0gcGFzczoKICAgICAgICAgICAgICBtZXNzYWdlOiBUaGVyZSBhcmUgbm90IGVub3VnaCBub2RlcyB0byBydW4gdGhpcyBhcHBsaWNhdGlvbiAoMyBvciBtb3JlKQogICAgLSBjbHVzdGVyVmVyc2lvbjoKICAgICAgICBvdXRjb21lczoKICAgICAgICAgIC0gZmFpbDoKICAgICAgICAgICAgICB3aGVuOiAiPCAxLjE2LjAiCiAgICAgICAgICAgICAgbWVzc2FnZTogVGhlIGFwcGxpY2F0aW9uIHJlcXVpcmVzIGF0IGxlYXN0IEt1YmVybmV0ZXMgMS4xNi4wLCBhbmQgcmVjb21tZW5kcyAxLjE4LjAuCiAgICAgICAgICAgICAgdXJpOiBodHRwczovL2t1YmVybmV0ZXMuaW8KICAgICAgICAgIC0gd2FybjoKICAgICAgICAgICAgICB3aGVuOiAiPCAxLjE4LjAiCiAgICAgICAgICAgICAgbWVzc2FnZTogWW91ciBjbHVzdGVyIG1lZXRzIHRoZSBtaW5pbXVtIHZlcnNpb24gb2YgS3ViZXJuZXRlcywgYnV0IHdlIHJlY29tbWVuZCB5b3UgdXBkYXRlIHRvIDEuMTguMCBvciBsYXRlci4KICAgICAgICAgICAgICB1cmk6IGh0dHBzOi8va3ViZXJuZXRlcy5pbwogICAgICAgICAgLSBwYXNzOgogICAgICAgICAgICAgIG1lc3NhZ2U6IFlvdXIgY2x1c3RlciBtZWV0cyB0aGUgcmVjb21tZW5kZWQgYW5kIHJlcXVpcmVkIHZlcnNpb25zIG9mIEt1YmVybmV0ZXMuCiAgICA= diff --git a/testdata/preflightspec/troubleshoot_v1beta2_preflight_secret_stringdata_gotest.yaml b/testdata/preflightspec/troubleshoot_v1beta2_preflight_secret_stringdata_gotest.yaml index 2f53d7ad..f6fa0c1b 100644 --- a/testdata/preflightspec/troubleshoot_v1beta2_preflight_secret_stringdata_gotest.yaml +++ b/testdata/preflightspec/troubleshoot_v1beta2_preflight_secret_stringdata_gotest.yaml @@ -11,7 +11,7 @@ metadata: app.kubernetes.io/instance: "release-name" app.kubernetes.io/version: 0.62.1 helm.sh/chart: "troubleshoot-0.1.0" - troubleshoot.io/kind: preflight + troubleshoot.sh/kind: preflight name: "release-name-preflight-config" stringData: preflight.yaml: |