Skip to content

Commit e6c6d7e

Browse files
committed
fix(supportbundle): include default redactor spec in support bundle command
1 parent 520979c commit e6c6d7e

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

pkg/supportbundle/supportbundle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func GetSpecURI(appSlug string) string {
9898
}
9999

100100
func GetBundleCommand(appSlug string) []string {
101-
redactURIs := []string{redact.GetKotsadmRedactSpecURI(), redact.GetAppRedactSpecURI(appSlug)}
101+
redactURIs := []string{redact.GetKotsadmRedactSpecURI(), redact.GetAppRedactSpecURI(appSlug), redact.GetDefaultRedactSpecURI()}
102102
redactors := strings.Join(redactURIs, ",")
103103

104104
command := []string{
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package supportbundle
2+
3+
import (
4+
"fmt"
5+
"strings"
6+
"testing"
7+
8+
"github.com/replicatedhq/kots/pkg/redact"
9+
"github.com/replicatedhq/kots/pkg/util"
10+
"github.com/stretchr/testify/assert"
11+
"github.com/stretchr/testify/require"
12+
)
13+
14+
func TestGetBundleCommand(t *testing.T) {
15+
origPodNamespace := util.PodNamespace
16+
util.PodNamespace = "test-namespace"
17+
defer func() {
18+
util.PodNamespace = origPodNamespace
19+
}()
20+
21+
appSlug := "test-app"
22+
command := GetBundleCommand(appSlug)
23+
24+
require.Len(t, command, 2)
25+
assert.Equal(t, "curl https://krew.sh/support-bundle | bash", command[0])
26+
27+
expectedRedactors := strings.Join([]string{
28+
redact.GetKotsadmRedactSpecURI(),
29+
redact.GetAppRedactSpecURI(appSlug),
30+
redact.GetDefaultRedactSpecURI(),
31+
}, ",")
32+
assert.Equal(t, fmt.Sprintf("kubectl support-bundle --load-cluster-specs --redactors=%s\n", expectedRedactors), command[1])
33+
}

0 commit comments

Comments
 (0)