Add labels configuration to Shell node pod (#1847)
* Add labels config to shell node pod spec * Add labels to config testsmine
parent
82fecb9804
commit
ff4bfe1162
|
|
@ -315,6 +315,7 @@ var expectedConfig = `k9s:
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
|
labels: {}
|
||||||
portForwardAddress: localhost
|
portForwardAddress: localhost
|
||||||
fred:
|
fred:
|
||||||
namespace:
|
namespace:
|
||||||
|
|
@ -338,6 +339,7 @@ var expectedConfig = `k9s:
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
|
labels: {}
|
||||||
portForwardAddress: localhost
|
portForwardAddress: localhost
|
||||||
minikube:
|
minikube:
|
||||||
namespace:
|
namespace:
|
||||||
|
|
@ -361,6 +363,7 @@ var expectedConfig = `k9s:
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
|
labels: {}
|
||||||
portForwardAddress: localhost
|
portForwardAddress: localhost
|
||||||
thresholds:
|
thresholds:
|
||||||
cpu:
|
cpu:
|
||||||
|
|
@ -411,6 +414,7 @@ var resetConfig = `k9s:
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
|
labels: {}
|
||||||
portForwardAddress: localhost
|
portForwardAddress: localhost
|
||||||
thresholds:
|
thresholds:
|
||||||
cpu:
|
cpu:
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,12 @@ type Limits map[v1.ResourceName]string
|
||||||
|
|
||||||
// ShellPod represents k9s shell configuration.
|
// ShellPod represents k9s shell configuration.
|
||||||
type ShellPod struct {
|
type ShellPod struct {
|
||||||
Image string `json:"image"`
|
Image string `json:"image"`
|
||||||
Command []string `json:"command,omitempty"`
|
Command []string `json:"command,omitempty"`
|
||||||
Args []string `json:"args,omitempty"`
|
Args []string `json:"args,omitempty"`
|
||||||
Namespace string `json:"namespace"`
|
Namespace string `json:"namespace"`
|
||||||
Limits Limits `json:"resources,omitempty"`
|
Limits Limits `json:"resources,omitempty"`
|
||||||
|
Labels map[string]string `json:"labels,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewShellPod returns a new instance.
|
// NewShellPod returns a new instance.
|
||||||
|
|
|
||||||
|
|
@ -331,6 +331,7 @@ func k9sShellPod(node string, cfg *config.ShellPod) v1.Pod {
|
||||||
ObjectMeta: metav1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: k9sShellPodName(),
|
Name: k9sShellPodName(),
|
||||||
Namespace: cfg.Namespace,
|
Namespace: cfg.Namespace,
|
||||||
|
Labels: cfg.Labels,
|
||||||
},
|
},
|
||||||
Spec: v1.PodSpec{
|
Spec: v1.PodSpec{
|
||||||
NodeName: node,
|
NodeName: node,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue