IsCurrentContext return the active context name.
(n string)
| 87 | |
| 88 | // IsCurrentContext return the active context name. |
| 89 | func (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. |
| 99 | func (*NamedContext) GetObjectKind() schema.ObjectKind { |
no test coverage detected