repo stringlengths 6 47 | file_url stringlengths 77 269 | file_path stringlengths 5 186 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-07 08:35:43 2026-01-07 08:55:24 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/views.go | internal/config/views.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
import (
"cmp"
"errors"
"fmt"
"io/fs"
"log/slog"
"maps"
"os"
"regexp"
"slices"
"strings"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/config/data"
"github.com/derailed/k9s/internal/config/jso... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/logger_test.go | internal/config/logger_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/stretchr/testify/assert"
)
func TestNewLogger(t *testing.T) {
l := config.NewLogger()
l = l.Validate()
assert.Equal(t, int64(100), l.TailCount)
asse... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/scans_test.go | internal/config/scans_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/stretchr/testify/assert"
)
func TestScansShouldExclude(t *testing.T) {
uu := map[string]struct {
sc config.ImageScans
ns string
ll map[string]stri... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/files.go | internal/config/files.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
import (
_ "embed"
"errors"
"io/fs"
"log/slog"
"os"
"path/filepath"
"github.com/adrg/xdg"
"github.com/derailed/k9s/internal/config/data"
"github.com/derailed/k9s/internal/slogs"
)
const (
// K9sEnvConfigDir represents k9s co... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/files_int_test.go | internal/config/files_int_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
import (
"os"
"path/filepath"
"testing"
"github.com/adrg/xdg"
"github.com/derailed/k9s/internal/config/data"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func Test_initXDGLocs(t *testing.T) {
tm... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/color.go | internal/config/color.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
import (
"fmt"
"github.com/derailed/tcell/v2"
)
const (
// DefaultColor represents a default color.
DefaultColor Color = "default"
// TransparentColor represents the terminal bg color.
TransparentColor Color = "-"
)
// Colors... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/scans.go | internal/config/scans.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
// Labels tracks a collection of labels.
type Labels map[string][]string
func (l Labels) exclude(k, val string) bool {
vv, ok := l[k]
if !ok {
return false
}
for _, v := range vv {
if v == val {
return true
}
}
return ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/config_test.go | internal/config/config_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config_test
import (
"errors"
"fmt"
"log/slog"
"os"
"path/filepath"
"testing"
"github.com/adrg/xdg"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/config/data"
... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/alias_test.go | internal/config/alias_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config_test
import (
"maps"
"os"
"path"
"slices"
"testing"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/config/data"
"github.com/derailed/k9s/internal/view/cmd"... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/hotkey_test.go | internal/config/hotkey_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestHotKeyLoad(t *testing.T) {
h := config.NewHotKeys()
require.NoError(t, h.Loa... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/benchmark_test.go | internal/config/benchmark_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestBenchEmpty(t *testing.T) {
uu := map[string]struct {
b Benchmark
e bool
}{
"empty": {Benchmark{}, true}... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/views_test.go | internal/config/views_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config_test
import (
"log/slog"
"testing"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/config"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func init() {
slog.SetDefault(s... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/styles_test.go | internal/config/styles_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/tcell/v2"
"github.com/derailed/tview"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestNewStyle(t *testi... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/threshold.go | internal/config/threshold.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
const (
// SeverityLow tracks low severity.
SeverityLow SeverityLevel = iota
// SeverityMedium tracks medium severity level.
SeverityMedium
// SeverityHigh tracks high severity level.
SeverityHigh
)
// SeverityLevel tracks seve... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/styles_int_test.go | internal/config/styles_int_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_newStyle(t *testing.T) {
s := newStyle()
assert.Equal(t, Color("black"), s.Body.BgColor)
assert.Equal(t, Color("cadetblue"), s.Body.FgColor)
assert.Equal(t, Co... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/logger.go | internal/config/logger.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
const (
// DefaultLoggerTailCount tracks default log tail size.
DefaultLoggerTailCount = 100
// MaxLogThreshold sets the max value for log size.
MaxLogThreshold = 5_000
// DefaultSinceSeconds tracks default log age.
DefaultSince... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/k9s_test.go | internal/config/k9s_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config_test
import (
"errors"
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/config/mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/cli-runtime/pkg/generic... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/plugin.go | internal/config/plugin.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
import (
"bytes"
"errors"
"fmt"
"io/fs"
"log/slog"
"os"
"path/filepath"
"strings"
"github.com/adrg/xdg"
"github.com/derailed/k9s/internal/config/data"
"github.com/derailed/k9s/internal/config/json"
"github.com/derailed/k9s/... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/flags_test.go | internal/config/flags_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/stretchr/testify/assert"
)
func TestNewFlags(t *testing.T) {
config.AppDumpsDir = "/tmp/k9s-test/screen-dumps"
config.AppLogFile = "/tmp/k9s-test/k9s.l... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/helpers.go | internal/config/helpers.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package config
import (
"log/slog"
"os"
"os/user"
"path/filepath"
"github.com/derailed/k9s/internal/slogs"
)
const (
envPFAddress = "K9S_DEFAULT_PF_ADDRESS"
defaultPortFwdAddress = "localhost"
)
// IsBoolSet checks if a bool ptr is ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/mock/test_helpers.go | internal/config/mock/test_helpers.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package mock
import (
"errors"
"fmt"
"io/fs"
"net/http"
"net/url"
"os"
"strings"
"testing"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/config"
"github.com/stretchr/testify/require"
version "k8s.io/apimachin... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/json/validator_test.go | internal/config/json/validator_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package json_test
import (
"os"
"path/filepath"
"testing"
"github.com/derailed/k9s/internal/config/json"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestValidatePluginSnippet(t *testing.T) {
plugPath := "... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/json/validator.go | internal/config/json/validator.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package json
import (
"cmp"
_ "embed"
"errors"
"fmt"
"log/slog"
"slices"
"github.com/derailed/k9s/internal/slogs"
"github.com/xeipuuv/gojsonschema"
"gopkg.in/yaml.v3"
)
const (
// PluginsSchema describes plugins schema.
PluginsSchema = "p... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/view.go | internal/config/data/view.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
const DefaultView = "po"
// View tracks view configuration options.
type View struct {
Active string `yaml:"active"`
}
// NewView creates a new view configuration.
func NewView() *View {
return &View{Active: DefaultView}
}
// Validat... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/proxy.go | internal/config/data/proxy.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
// Proxy tracks a context's proxy configuration.
type Proxy struct {
Address string `yaml:"address"`
}
| go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/feature_gate.go | internal/config/data/feature_gate.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
// FeatureGates represents K9s opt-in features.
type FeatureGates struct {
NodeShell bool `yaml:"nodeShell"`
}
// NewFeatureGates returns a new feature gate.
func NewFeatureGates() FeatureGates {
return FeatureGates{}
}
| go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/dir_test.go | internal/config/data/dir_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data_test
import (
"log/slog"
"os"
"strings"
"testing"
"github.com/derailed/k9s/internal/config/data"
"github.com/derailed/k9s/internal/config/mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/types.go | internal/config/data/types.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
import (
"net/http"
"net/url"
"os"
"github.com/derailed/k9s/internal/config/json"
"k8s.io/client-go/tools/clientcmd/api"
)
// JSONValidator validate yaml configurations.
var JSONValidator = json.NewValidator()
const (
// DefaultD... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/context_test.go | internal/config/data/context_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data_test
import (
"testing"
"github.com/derailed/k9s/internal/config/data"
"github.com/derailed/k9s/internal/config/mock"
"github.com/stretchr/testify/assert"
)
func TestClusterValidate(t *testing.T) {
c := data.NewContext()
c.Validat... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/config.go | internal/config/data/config.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
import (
"fmt"
"io"
"sync"
"github.com/derailed/k9s/internal/client"
"gopkg.in/yaml.v3"
"k8s.io/client-go/tools/clientcmd/api"
)
// Config tracks a context configuration.
type Config struct {
Context *Context `yaml:"k9s"`
mx ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/ns_test.go | internal/config/data/ns_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data_test
import (
"testing"
"github.com/derailed/k9s/internal/config/data"
"github.com/derailed/k9s/internal/config/mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestNSValidate(t *testing.T) {
... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/helpers_test.go | internal/config/data/helpers_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data_test
import (
"os"
"path/filepath"
"slices"
"testing"
"github.com/derailed/k9s/internal/config/data"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestSanitizeFileName(t *testing.T) {
uu := ma... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/ns.go | internal/config/data/ns.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
import (
"log/slog"
"slices"
"sync"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/slogs"
)
const (
// MaxFavoritesNS number # favorite namespaces to keep in the configuration.
MaxFavoritesNS = 9
)
/... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/context.go | internal/config/data/context.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
import (
"os"
"sync"
"github.com/derailed/k9s/internal/client"
"k8s.io/client-go/tools/clientcmd/api"
)
// Context tracks K9s context configuration.
type Context struct {
ClusterName string `yaml:"cluster,omitempty"`
ReadOn... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/view_test.go | internal/config/data/view_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data_test
import (
"testing"
"github.com/derailed/k9s/internal/config/data"
"github.com/stretchr/testify/assert"
)
func TestViewValidate(t *testing.T) {
v := data.NewView()
v.Validate()
assert.Equal(t, "po", v.Active)
v.Active = "fr... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/context_int_test.go | internal/config/data/context_int_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
import (
"testing"
"github.com/stretchr/testify/assert"
)
func Test_contextMerge(t *testing.T) {
uu := map[string]struct {
c1, c2, e *Context
}{
"empty": {},
"nil": {
c1: &Context{
Namespace: &Namespace{
Active: ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/helpers.go | internal/config/data/helpers.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
import (
"bytes"
"errors"
"io/fs"
"os"
"path/filepath"
"regexp"
"gopkg.in/yaml.v3"
)
const envFGNodeShell = "K9S_FEATURE_GATE_NODE_SHELL"
var invalidPathCharsRX = regexp.MustCompile(`[:/]+`)
// SanitizeContextSubpath ensure clu... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/config/data/dir.go | internal/config/data/dir.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package data
import (
"errors"
"fmt"
"io/fs"
"log/slog"
"os"
"path/filepath"
"sync"
"github.com/derailed/k9s/internal/config/json"
"github.com/derailed/k9s/internal/slogs"
"gopkg.in/yaml.v3"
"k8s.io/client-go/tools/clientcmd/api"
)
// Dir... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/metrics.go | internal/client/metrics.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client
import (
"context"
"errors"
"fmt"
"math"
"strconv"
"time"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/cache"
mv1beta1 "k8s.io/metrics/pkg/apis/metrics/v1beta1"
)
const ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/gvr_test.go | internal/client/gvr_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client_test
import (
"path"
"sort"
"testing"
"github.com/derailed/k9s/internal/client"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/runtime/schema"
)
func TestGVRSort(t *testing.T) {
gg := client.GVRs{
client.PodGVR... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/client.go | internal/client/client.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client
import (
"context"
"errors"
"fmt"
"log/slog"
"os"
"path/filepath"
"strings"
"sync"
"time"
"github.com/derailed/k9s/internal/slogs"
authorizationv1 "k8s.io/api/authorization/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/types.go | internal/client/types.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client
import (
"k8s.io/apimachinery/pkg/version"
"k8s.io/client-go/discovery/cached/disk"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes"
restclient "k8s.io/client-go/rest"
mv1beta1 "k8s.io/metrics/pkg/apis/metrics/v1beta1"
ve... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/errors.go | internal/client/errors.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client
import metricsapi "k8s.io/metrics/pkg/apis/metrics"
// Error represents an error.
type Error string
// Error returns the error text.
func (e Error) Error() string {
return string(e)
}
const (
noMetricServerErr = Error("No metri... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/helper_test.go | internal/client/helper_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client_test
import (
"testing"
"github.com/derailed/k9s/internal/client"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestMetaFQN(t *testing.T) {
uu := map[string]struct {
meta metav1.Objec... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/config.go | internal/client/config.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client
import (
"errors"
"fmt"
"net/http"
"net/url"
"strings"
"sync"
"time"
"k8s.io/cli-runtime/pkg/genericclioptions"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/tools/clientcmd/api"
)
... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/client_test.go | internal/client/client_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
authorizationv1 "k8s.io/api/authorization/v1"
)
func TestMakeSAR(t *testing.T) {
uu := map[string]struct {
ns string
gvr *GVR
sar *authorizationv1.SelfSubjectA... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/config_test.go | internal/client/config_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client_test
import (
"errors"
"log/slog"
"os"
"testing"
"time"
"github.com/derailed/k9s/internal/client"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/cli-runtime/pkg/genericclioptions"
)
var kub... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/metrics_test.go | internal/client/metrics_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client_test
import (
"testing"
"github.com/derailed/k9s/internal/client"
"github.com/stretchr/testify/assert"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1beta1 "k8s.io/... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/gvrs.go | internal/client/gvrs.go | package client
import "k8s.io/apimachinery/pkg/util/sets"
var (
// Apps...
DpGVR = NewGVR("apps/v1/deployments")
StsGVR = NewGVR("apps/v1/statefulsets")
DsGVR = NewGVR("apps/v1/daemonsets")
RsGVR = NewGVR("apps/v1/replicasets")
// Core...
SaGVR = NewGVR("v1/serviceaccounts")
PvcGVR = NewGVR("v1/persist... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/helpers.go | internal/client/helpers.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client
import (
"log/slog"
"os"
"os/user"
"path"
"regexp"
"strings"
"github.com/derailed/k9s/internal/slogs"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var toFileName = regexp.MustCompile(`[^(\w/.)]`)
// IsClusterWide returns t... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/client/gvr.go | internal/client/gvr.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package client
import (
"fmt"
"log/slog"
"path"
"strings"
"sync"
"github.com/derailed/k9s/internal/slogs"
"github.com/fvbommel/sortorder"
"gopkg.in/yaml.v3"
apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/ap... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/watch/helper.go | internal/watch/helper.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package watch
import (
"fmt"
"log/slog"
"path"
"strings"
"k8s.io/apimachinery/pkg/runtime/schema"
)
func toGVR(gvr string) schema.GroupVersionResource {
tokens := strings.Split(gvr, "/")
if len(tokens) < 3 {
tokens = append([]string{""}, to... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/watch/forwarders_test.go | internal/watch/forwarders_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package watch_test
import (
"log/slog"
"testing"
"time"
"github.com/derailed/k9s/internal/port"
"github.com/derailed/k9s/internal/watch"
"github.com/stretchr/testify/assert"
"k8s.io/client-go/tools/portforward"
)
func init() {
slog.SetDefaul... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/watch/factory.go | internal/watch/factory.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package watch
import (
"fmt"
"log/slog"
"strings"
"sync"
"time"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/slogs"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachin... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/watch/forwarders.go | internal/watch/forwarders.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package watch
import (
"fmt"
"log/slog"
"strings"
"time"
"github.com/derailed/k9s/internal/port"
"github.com/derailed/k9s/internal/slogs"
"k8s.io/client-go/tools/portforward"
)
// Forwarder represents a port forwarder.
type Forwarder interfac... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/color/colorize_test.go | internal/color/colorize_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package color_test
import (
"testing"
"github.com/derailed/k9s/internal/color"
"github.com/stretchr/testify/assert"
)
func TestColorize(t *testing.T) {
uu := map[string]struct {
s string
c color.Paint
e string
}{
"white": {"blee", col... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/color/colorize.go | internal/color/colorize.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package color
import (
"fmt"
"strconv"
)
const colorFmt = "\x1b[%dm%s\x1b[0m"
// Paint describes a terminal color.
type Paint int
// Defines basic ANSI colors.
const (
Black Paint = iota + 30 // 30
Red // 31
Green ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/crumbs.go | internal/ui/crumbs.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"fmt"
"strings"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/tview"
)
// Crumbs represents user breadcrumbs.
type Crumbs struct {
*tview.TextView
styles *config.S... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/tree.go | internal/ui/tree.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"context"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/tcell/v2"
"github.com/derailed/tview"
)
// KeyListenerFunc listens to key presses.
type KeyListenerFunc func()
// Tree represents a tree view.
type Tree... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/flash_test.go | internal/ui/flash_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"context"
"testing"
"time"
"github.com/derailed/k9s/internal/config/mock"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/ui"
"github.com/stretchr/testify/assert"
)
func TestFlash(t *testing... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/splash_test.go | internal/ui/splash_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/ui"
"github.com/stretchr/testify/assert"
)
func TestNewSplash(t *testing.T) {
s := ui.NewSplash(config.NewStyles(), "bozo")
x, y, w... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/pages.go | internal/ui/pages.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"fmt"
"log/slog"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/slogs"
"github.com/derailed/tview"
)
// Pages represents a stack of view pages.
type Pages struct {
*tview.Pages
*model.Stack
}
/... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/action_test.go | internal/ui/action_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"testing"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/ui"
"github.com/stretchr/testify/assert"
)
func TestKeyActionsHints(t *testing.T) {
kk := ui.NewKeyActionsFromMap(ui.KeyMap{
ui.KeyF... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/prompt_test.go | internal/ui/prompt_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/tcell/v2"
"github.com/stretchr/testify/assert"
)
func TestCmdNew(t... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/table_test.go | internal/ui/table_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"context"
"testing"
"time"
"github.com/derailed/k9s/internal"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/dao"
"github.com/derailed/k9s/interna... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/table.go | internal/ui/table.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"context"
"fmt"
"log/slog"
"sync"
"github.com/derailed/k9s/internal"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/in... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/padding.go | internal/ui/padding.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"strings"
"unicode"
"github.com/derailed/k9s/internal/model1"
"github.com/derailed/k9s/internal/render"
)
// MaxyPad tracks uniform column padding.
type MaxyPad []int
// ComputeMaxColumns figures out column max size and nece... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/logo_test.go | internal/ui/logo_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/ui"
"github.com/stretchr/testify/assert"
)
func TestNewLogoView(t *testing.T) {
v := ui.NewLogo(config.NewStyles())
v.Reset()
cons... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/splash.go | internal/ui/splash.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"fmt"
"strings"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/tview"
)
// LogoSmall K9s small log.
var LogoSmall = []string{
` ____ __ ________ `,
`| |/ / __ \______`,
`| /\____ / ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/types.go | internal/ui/types.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"context"
"time"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/dao"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/model1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/deltas.go | internal/ui/deltas.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"regexp"
"strconv"
"strings"
"time"
"github.com/derailed/k9s/internal/render"
"k8s.io/apimachinery/pkg/api/resource"
)
const (
// DeltaSign signals a diff.
DeltaSign = "Δ"
// PlusSign signals inc.
PlusSign = "[red::b]↑"... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/action.go | internal/ui/action.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"log/slog"
"slices"
"sync"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/slogs"
"github.com/derailed/tcell/v2"
)
type (
// RangeFn represents a range iteration callback.
RangeFn func(tcell.Key... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/flash.go | internal/ui/flash.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"context"
"log/slog"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/tcell/v2"
"github.com/derailed/tview"
)
const (
emoHappy = "😎"
emoDoh = "😗"
emoRed = "😡"... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/table_helper_test.go | internal/ui/table_helper_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"testing"
"github.com/derailed/k9s/internal/render"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/labels"
)
func TestTruncate(t *testing.T) {
uu := map[string]struct {
s, e string
}{
"empty": {},
"max"... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/menu_test.go | internal/ui/menu_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/ui"
"github.com/stretchr/testify/assert"
)
func TestNewMenu(t *testing.T) {
v := ui.NewMenu... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/config.go | internal/ui/config.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"context"
"errors"
"io/fs"
"log/slog"
"os"
"path/filepath"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/model1"
"github.com/derailed/k9s/internal/sl... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/prompt_validation_test.go | internal/ui/prompt_validation_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"fmt"
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/tcell/v2"
"github.com/stretchr/testify/assert"
)
// TestPro... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/indicator_test.go | internal/ui/indicator_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/config/mock"
"github.com/derailed/k9s/internal/ui"
"github.com/stretchr/testify/assert"
)
func TestIndicatorReset(t *testing.T) {
i ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/padding_test.go | internal/ui/padding_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"testing"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/model1"
"github.com/stretchr/testify/assert"
)
func TestMaxColumn(t *testing.T) {
uu := map[string]struct {
t *model1.TableData
s stri... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/logo.go | internal/ui/logo.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"fmt"
"strings"
"sync"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/tview"
)
// Logo represents a K9s logo.
type Logo struct {
*tview.Flex
logo, status *tview.TextView
styles *config.Styles
mx ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/modal_list.go | internal/ui/modal_list.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"github.com/derailed/tcell/v2"
"github.com/derailed/tview"
)
type ModalList struct {
*tview.Box
// The list embedded in the modal's frame.
list *tview.List
// The frame embedded in the modal.
frame *tview.Frame
// The o... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/config_test.go | internal/ui/config_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"os"
"path/filepath"
"testing"
"time"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/config/data"
"github.com/derailed/k9s/internal/config/mock"
"github.com/derailed/k9s/internal/model"
"... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/menu.go | internal/ui/menu.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"fmt"
"regexp"
"runtime"
"sort"
"strconv"
"strings"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/tview"
runewidth "github.com/mattn/go-runewidth"
)
const (
men... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/deltas_test.go | internal/ui/deltas_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"testing"
"github.com/derailed/k9s/internal/render"
"github.com/stretchr/testify/assert"
)
func TestDeltas(t *testing.T) {
uu := []struct {
s1, s2, e string
}{
{"", "", ""},
{render.MissingValue, "", DeltaSign},
{ren... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/config_int_test.go | internal/ui/config_int_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"os"
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/config/mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/cli-runtime/pkg/genericclioptions"
)... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/prompt.go | internal/ui/prompt.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"fmt"
"sync"
"unicode"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/tcell/v2"
"github.com/derailed/tview"
)
const (
defaultPrompt = "%c%c [::b]%s"
defaultSpacer ... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/app_test.go | internal/ui/app_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"testing"
"github.com/derailed/k9s/internal/config/mock"
"github.com/derailed/k9s/internal/ui"
"github.com/stretchr/testify/assert"
)
func TestAppGetCmd(t *testing.T) {
a := ui.NewApp(mock.NewMockConfig(t), "")
a.Init(... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/crumbs_test.go | internal/ui/crumbs_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"context"
"log/slog"
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/k9s/internal/view/cmd"
"github.com/derailed/... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/table_helper.go | internal/ui/table_helper.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"context"
"fmt"
"log/slog"
"os"
"strings"
"github.com/derailed/k9s/internal"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/slogs"
"k8s.io/apimachinery/pkg/labels"
)
const (
// DefaultColorN... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/indicator.go | internal/ui/indicator.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"context"
"fmt"
"time"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/render"
"github.com/derailed/tview"
)
// StatusIndicator represents a status indic... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/pages_test.go | internal/ui/pages_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui_test
import (
"testing"
"github.com/derailed/k9s/internal/ui"
"github.com/stretchr/testify/assert"
)
func TestPagesPush(t *testing.T) {
c1, c2 := makeComponent("c1"), makeComponent("c2")
p := ui.NewPages()
p.Push(c1)
p.Push(c2)
... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/key.go | internal/ui/key.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import "github.com/derailed/tcell/v2"
func init() {
initKeys()
}
func initKeys() {
tcell.KeyNames[KeyHelp] = "?"
tcell.KeyNames[KeySlash] = "/"
tcell.KeyNames[KeySpace] = "space"
initNumbKeys()
initStdKeys()
initShiftKeys()
initS... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/select_table.go | internal/ui/select_table.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"github.com/derailed/tcell/v2"
"github.com/derailed/tview"
)
// SelectTable represents a table with selections.
type SelectTable struct {
*tview.Table
model Tabular
selectedFn func(string) string
marks map[string]... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/app.go | internal/ui/app.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package ui
import (
"log/slog"
"os"
"sync"
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/model"
"github.com/derailed/k9s/internal/slogs"
"github.com/derailed/tcell/v2"
"... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/dialog/prompt_test.go | internal/ui/dialog/prompt_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package dialog
import (
"context"
"testing"
"time"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/tcell/v2"
"github.com/derailed/tview"
"github.com/stretchr/testify/assert"
)
func TestSho... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/dialog/error.go | internal/ui/dialog/error.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package dialog
import (
"fmt"
"strings"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/tcell/v2"
"github.com/derailed/tview"
)
// ShowError pops an error dialog.
func ShowError(styles *conf... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/dialog/delete.go | internal/ui/dialog/delete.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package dialog
import (
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/tview"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
noDeletePropagation = "None"
defaultPropagationIdx = 0... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/dialog/error_test.go | internal/ui/dialog/error_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package dialog
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/tview"
"github.com/stretchr/testify/assert"
)
func TestErrorDialog(t *testing.T) {
p := ui.NewPages()
Show... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/dialog/delete_test.go | internal/ui/dialog/delete_test.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package dialog
import (
"testing"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/tview"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func TestDeleteD... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
derailed/k9s | https://github.com/derailed/k9s/blob/3784c12ae74593e8aca597c3c347e8714ad3d6b7/internal/ui/dialog/restart.go | internal/ui/dialog/restart.go | // SPDX-License-Identifier: Apache-2.0
// Copyright Authors of K9s
package dialog
import (
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/ui"
"github.com/derailed/tview"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type RestartFn func(*metav1.PatchOptions) bool
type RestartDialog... | go | Apache-2.0 | 3784c12ae74593e8aca597c3c347e8714ad3d6b7 | 2026-01-07T08:36:21.587988Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.