MCPcopy
hub / github.com/derailed/k9s / IsCurrentContext

Method IsCurrentContext

internal/render/context.go:89–96  ·  view source on GitHub ↗

IsCurrentContext return the active context name.

(n string)

Source from the content-addressed store, hash-verified

87
88// IsCurrentContext return the active context name.
89func (c *NamedContext) IsCurrentContext(n string) bool {
90 cl, err := c.Config.CurrentContextName()
91 if err != nil {
92 slog.Error("Fail to retrieve current context. Exiting!")
93 os.Exit(1)
94 }
95 return cl == n
96}
97
98// GetObjectKind returns a schema object.
99func (*NamedContext) GetObjectKind() schema.ObjectKind {

Callers 1

RenderMethod · 0.80

Calls 2

CurrentContextNameMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected