mirror of
https://github.com/derailed/k9s.git
synced 2026-10-12 02:12:51 +00:00
* [Maint] Refactor VS col handling * [Bug] Add helm hist <enter> values cmd * [Bug] Add context specific skins within a given cluster config. * [Maint] Image scan controls * [Bug] Fix fwd+bench timestamp * [Refact] all-ns const * [Maint] update tabledefs from metav1beta1 to metav1 * [Feat] Introduce workload view * [Maint] Add convenience to map out ns names - Refactor allnamespaces * [Cleanup] axe pegomock * [Refact] Use gvr type vs string * [Feat] Add blacklist scans exclusions * [Feat] setLabels for stored commands * [Maint] Rename api-group column * [Refact] gvr type refactor * [Maint] Cleaning up * [Bug] Add ability to skin based on context - Handles cluster spanning *contexts * [Maint] Cleaning up * [Feat] Cmd interpreter * [Maint] Clean up + bug fixes * [Feat] Changed k9s config loader > NOTE: !!Breaking change!! - Make k9s config readonly - Move writable artifacts to XDG data dir - Move transient artifacts to XDG state dir - Add per context skin option - Add per context readonly option - Consistent pluralization file names to yaml section * [Docs] Update release and README docs * [Maint] Rebase + cleanup * [Maint] Normalize config extensions all yml -> yaml * [Maint] Cleaning up + fixes
47 lines
1.1 KiB
Go
47 lines
1.1 KiB
Go
// SPDX-License-Identifier: Apache-2.0
|
|
// Copyright Authors of K9s
|
|
|
|
package cmd
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/derailed/k9s/internal/config"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func Test_getScreenDumpDirForInfo(t *testing.T) {
|
|
tests := map[string]struct {
|
|
k9sConfigFile string
|
|
expectedScreenDumpDir string
|
|
}{
|
|
"withK9sConfigFile": {
|
|
k9sConfigFile: "testdata/k9s.yaml",
|
|
expectedScreenDumpDir: "/tmp",
|
|
},
|
|
"withEmptyK9sConfigFile": {
|
|
k9sConfigFile: "",
|
|
expectedScreenDumpDir: config.AppDumpsDir,
|
|
},
|
|
"withInvalidK9sConfigFilePath": {
|
|
k9sConfigFile: "invalid",
|
|
expectedScreenDumpDir: config.AppDumpsDir,
|
|
},
|
|
"withScreenDumpDirEmptyInK9sConfigFile": {
|
|
k9sConfigFile: "testdata/k9s1.yaml",
|
|
expectedScreenDumpDir: config.AppDumpsDir,
|
|
},
|
|
}
|
|
for k := range tests {
|
|
u := tests[k]
|
|
t.Run(k, func(t *testing.T) {
|
|
initK9sConfigFile := config.AppConfigFile
|
|
config.AppConfigFile = u.k9sConfigFile
|
|
|
|
assert.Equal(t, u.expectedScreenDumpDir, getScreenDumpDirForInfo())
|
|
|
|
config.AppConfigFile = initK9sConfigFile
|
|
})
|
|
}
|
|
}
|