Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/supportbundle/supportbundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func GetSpecURI(appSlug string) string {
}

func GetBundleCommand(appSlug string) []string {
redactURIs := []string{redact.GetKotsadmRedactSpecURI(), redact.GetAppRedactSpecURI(appSlug)}
redactURIs := []string{redact.GetKotsadmRedactSpecURI(), redact.GetAppRedactSpecURI(appSlug), redact.GetDefaultRedactSpecURI()}
redactors := strings.Join(redactURIs, ",")

command := []string{
Expand Down
33 changes: 33 additions & 0 deletions pkg/supportbundle/supportbundle_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package supportbundle

import (
"fmt"
"strings"
"testing"

"github.com/replicatedhq/kots/pkg/redact"
"github.com/replicatedhq/kots/pkg/util"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestGetBundleCommand(t *testing.T) {
origPodNamespace := util.PodNamespace
util.PodNamespace = "test-namespace"
defer func() {
util.PodNamespace = origPodNamespace
}()

appSlug := "test-app"
command := GetBundleCommand(appSlug)

require.Len(t, command, 2)
assert.Equal(t, "curl https://krew.sh/support-bundle | bash", command[0])

expectedRedactors := strings.Join([]string{
redact.GetKotsadmRedactSpecURI(),
redact.GetAppRedactSpecURI(appSlug),
redact.GetDefaultRedactSpecURI(),
}, ",")
assert.Equal(t, fmt.Sprintf("kubectl support-bundle --load-cluster-specs --redactors=%s\n", expectedRedactors), command[1])
}
Loading