diff --git a/cmd/troubleshoot/cli/root.go b/cmd/troubleshoot/cli/root.go index 4d5c47d7..6e12fd5a 100644 --- a/cmd/troubleshoot/cli/root.go +++ b/cmd/troubleshoot/cli/root.go @@ -46,7 +46,7 @@ from a server that can be used to assist when troubleshooting a Kubernetes clust cmd.Flags().Bool("redact", true, "enable/disable default redactions") cmd.Flags().Bool("interactive", true, "enable/disable interactive mode") cmd.Flags().Bool("collect-without-permissions", true, "always generate a support bundle, even if it some require additional permissions") - cmd.Flags().StringSliceP("selector", "l", []string{"troubleshoot.io/kind=supportbundle-spec"}, "selector to filter on for loading additional support bundle specs found in secrets within the cluster") + cmd.Flags().StringSliceP("selector", "l", []string{"troubleshoot.io/kind=support-bundle"}, "selector to filter on for loading additional support bundle specs found in secrets within the cluster") cmd.Flags().Bool("load-cluster-specs", false, "enable/disable loading additional troubleshoot specs found within the cluster. required when no specs are provided on the command line") cmd.Flags().String("since-time", "", "force pod logs collectors to return logs after a specific date (RFC3339)") cmd.Flags().String("since", "", "force pod logs collectors to return logs newer than a relative duration like 5s, 2m, or 3h.") diff --git a/docs/support-bundle.md b/docs/support-bundle.md index 33ae33b7..c0dba200 100644 --- a/docs/support-bundle.md +++ b/docs/support-bundle.md @@ -36,7 +36,7 @@ support-bundle [url] [flags] --redact enable/disable default redactions (default true) --redactors strings names of the additional redactors to use --request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0") - -l, --selector strings selector to filter on for loading additional support bundle specs found in secrets within the cluster (default [troubleshoot.io/kind=supportbundle-spec]) + -l, --selector strings selector to filter on for loading additional support bundle specs found in secrets within the cluster (default [troubleshoot.io/kind=support-bundle]) -s, --server string The address and port of the Kubernetes API server --since string force pod logs collectors to return logs newer than a relative duration like 5s, 2m, or 3h. --since-time string force pod logs collectors to return logs after a specific date (RFC3339) @@ -47,7 +47,7 @@ support-bundle [url] [flags] ### SEE ALSO -* [support-bundle analyze](support-bundle_analyze.md) - analyze a support bundle -* [support-bundle version](support-bundle_version.md) - Print the current version and exit +* [support-bundle analyze](support-bundle_analyze.md) - analyze a support bundle +* [support-bundle version](support-bundle_version.md) - Print the current version and exit ###### Auto generated by spf13/cobra on 21-Nov-2022 diff --git a/pkg/specs/configmaps_test.go b/pkg/specs/configmaps_test.go index 44670542..628d4d3e 100644 --- a/pkg/specs/configmaps_test.go +++ b/pkg/specs/configmaps_test.go @@ -31,7 +31,7 @@ func Test_LoadFromConfigMapMatchingLabel(t *testing.T) { Name: "configmap", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -44,7 +44,7 @@ spec: - runPod: name: "run-ping" namespace: default - podSpec: + podSpec: containers: - name: run-ping image: busybox:1 @@ -63,7 +63,7 @@ spec: - runPod: name: "run-ping" namespace: default - podSpec: + podSpec: containers: - name: run-ping image: busybox:1 @@ -79,7 +79,7 @@ spec: Name: "configmap", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -92,7 +92,7 @@ spec: - runPod: name: "run-ping" namespace: default - podSpec: + podSpec: containers: - name: run-ping image: busybox:1 @@ -123,7 +123,7 @@ spec: - runPod: name: "run-ping" namespace: default - podSpec: + podSpec: containers: - name: run-ping image: busybox:1 @@ -199,7 +199,7 @@ spec: Name: "configmap", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -217,7 +217,7 @@ spec: Name: "configmap-2", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -256,7 +256,7 @@ spec: Name: "configmap", Namespace: "some-namespace", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -274,7 +274,7 @@ spec: Name: "configmap-2", Namespace: "some-namespace-2", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -313,7 +313,7 @@ spec: Name: "configmap", Namespace: "some-namespace", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec-wrong", + "troubleshoot.io/kind": "support-bundle-wrong", }, }, Data: map[string]string{ @@ -331,7 +331,7 @@ spec: Name: "configmap-2", Namespace: "some-namespace-2", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -364,7 +364,7 @@ spec: _, err := client.CoreV1().ConfigMaps(configmap.Namespace).Create(ctx, &configmap, metav1.CreateOptions{}) require.NoError(t, err) } - got, err := LoadFromConfigMapMatchingLabel(client, "troubleshoot.io/kind=supportbundle-spec", "", "support-bundle-spec") + got, err := LoadFromConfigMapMatchingLabel(client, "troubleshoot.io/kind=support-bundle", "", "support-bundle-spec") if tt.wantErr { assert.Error(t, err) } else { @@ -394,7 +394,7 @@ func TestUserProvidedNamespace_LoadFromConfigMapMatchingLabel(t *testing.T) { Name: "configmap", Namespace: "some-namespace", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -432,7 +432,7 @@ spec: Name: "configmap", Namespace: "not-your-namespace", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -460,7 +460,7 @@ spec: _, err := client.CoreV1().ConfigMaps(configmap.Namespace).Create(ctx, &configmap, metav1.CreateOptions{}) require.NoError(t, err) } - got, err := LoadFromConfigMapMatchingLabel(client, "troubleshoot.io/kind=supportbundle-spec", "some-namespace", "support-bundle-spec") + got, err := LoadFromConfigMapMatchingLabel(client, "troubleshoot.io/kind=support-bundle", "some-namespace", "support-bundle-spec") if tt.wantErr { assert.Error(t, err) } else { @@ -490,7 +490,7 @@ func TestRedactors_LoadFromConfigMapMatchingLabel(t *testing.T) { Name: "configmap", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -532,7 +532,7 @@ spec: Name: "configmap", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string]string{ @@ -562,7 +562,7 @@ spec: _, err := client.CoreV1().ConfigMaps(configmap.Namespace).Create(ctx, &configmap, metav1.CreateOptions{}) require.NoError(t, err) } - got, err := LoadFromConfigMapMatchingLabel(client, "troubleshoot.io/kind=supportbundle-spec", "", "redactor-spec") + got, err := LoadFromConfigMapMatchingLabel(client, "troubleshoot.io/kind=support-bundle", "", "redactor-spec") if tt.wantErr { assert.Error(t, err) } else { diff --git a/pkg/specs/secrets_test.go b/pkg/specs/secrets_test.go index d7f07e88..682cc7a1 100644 --- a/pkg/specs/secrets_test.go +++ b/pkg/specs/secrets_test.go @@ -31,7 +31,7 @@ func Test_LoadFromSecretMatchingLabel(t *testing.T) { Name: "secret", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -44,7 +44,7 @@ spec: - runPod: name: "run-ping" namespace: default - podSpec: + podSpec: containers: - name: run-ping image: busybox:1 @@ -63,7 +63,7 @@ spec: - runPod: name: "run-ping" namespace: default - podSpec: + podSpec: containers: - name: run-ping image: busybox:1 @@ -79,7 +79,7 @@ spec: Name: "secret", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -92,7 +92,7 @@ spec: - runPod: name: "run-ping" namespace: default - podSpec: + podSpec: containers: - name: run-ping image: busybox:1 @@ -123,7 +123,7 @@ spec: - runPod: name: "run-ping" namespace: default - podSpec: + podSpec: containers: - name: run-ping image: busybox:1 @@ -199,7 +199,7 @@ spec: Name: "secret", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -217,7 +217,7 @@ spec: Name: "secret-2", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -256,7 +256,7 @@ spec: Name: "secret", Namespace: "some-namespace", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -274,7 +274,7 @@ spec: Name: "secret-2", Namespace: "some-namespace-2", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -313,7 +313,7 @@ spec: Name: "secret", Namespace: "some-namespace", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec-wrong", + "troubleshoot.io/kind": "support-bundle-wrong", }, }, Data: map[string][]byte{ @@ -331,7 +331,7 @@ spec: Name: "secret-2", Namespace: "some-namespace-2", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -364,7 +364,7 @@ spec: _, err := client.CoreV1().Secrets(secret.Namespace).Create(ctx, &secret, metav1.CreateOptions{}) require.NoError(t, err) } - got, err := LoadFromSecretMatchingLabel(client, "troubleshoot.io/kind=supportbundle-spec", "", "support-bundle-spec") + got, err := LoadFromSecretMatchingLabel(client, "troubleshoot.io/kind=support-bundle", "", "support-bundle-spec") if tt.wantErr { assert.Error(t, err) } else { @@ -394,7 +394,7 @@ func TestUserProvidedNamespace_LoadFromSecretMatchingLabel(t *testing.T) { Name: "secret", Namespace: "some-namespace", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -432,7 +432,7 @@ spec: Name: "secret", Namespace: "not-your-namespace", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -460,7 +460,7 @@ spec: _, err := client.CoreV1().Secrets(secret.Namespace).Create(ctx, &secret, metav1.CreateOptions{}) require.NoError(t, err) } - got, err := LoadFromSecretMatchingLabel(client, "troubleshoot.io/kind=supportbundle-spec", "some-namespace", "support-bundle-spec") + got, err := LoadFromSecretMatchingLabel(client, "troubleshoot.io/kind=support-bundle", "some-namespace", "support-bundle-spec") if tt.wantErr { assert.Error(t, err) } else { @@ -490,7 +490,7 @@ func TestRedactors_LoadFromSecretMatchingLabel(t *testing.T) { Name: "secret", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -532,7 +532,7 @@ spec: Name: "secret", Namespace: "default", Labels: map[string]string{ - "troubleshoot.io/kind": "supportbundle-spec", + "troubleshoot.io/kind": "support-bundle", }, }, Data: map[string][]byte{ @@ -562,7 +562,7 @@ spec: _, err := client.CoreV1().Secrets(secret.Namespace).Create(ctx, &secret, metav1.CreateOptions{}) require.NoError(t, err) } - got, err := LoadFromSecretMatchingLabel(client, "troubleshoot.io/kind=supportbundle-spec", "", "redactor-spec") + got, err := LoadFromSecretMatchingLabel(client, "troubleshoot.io/kind=support-bundle", "", "redactor-spec") if tt.wantErr { assert.Error(t, err) } else {