Merge branch 'master' of github.com-derailed:derailed/k9s
commit
afd7bf74c1
|
|
@ -14,4 +14,5 @@ popeye1.go
|
||||||
gen.sh
|
gen.sh
|
||||||
cluster_info_test.go
|
cluster_info_test.go
|
||||||
*.test
|
*.test
|
||||||
*.log
|
*.log
|
||||||
|
*~
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,8 @@ K9s uses aliases to navigate most K8s resources.
|
||||||
| `<Esc>` | Bails out of command mode | |
|
| `<Esc>` | Bails out of command mode | |
|
||||||
| `d`,`v`, `e`, `l`,... | Key mapping to describe, view, edit, view logs,... | `d` (describes a resource) |
|
| `d`,`v`, `e`, `l`,... | Key mapping to describe, view, edit, view logs,... | `d` (describes a resource) |
|
||||||
| `:`ctx`<ENTER>` | To view and switch to another Kubernetes context | `:`+`ctx`+`<ENTER>` |
|
| `:`ctx`<ENTER>` | To view and switch to another Kubernetes context | `:`+`ctx`+`<ENTER>` |
|
||||||
|
| `Ctrl-d` | To delete a resource (TAB and ENTER to confirm) | |
|
||||||
|
| `Ctrl-k` | To delete a resource (no confirmation dialog) | |
|
||||||
| `:q`, `Ctrl-c` | To bail out of K9s | |
|
| `:q`, `Ctrl-c` | To bail out of K9s | |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -4,24 +4,24 @@ import (
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// PeristentVolume represents a Kubernetes PersistentVolume.
|
// PersistentVolume represents a Kubernetes PersistentVolume.
|
||||||
type PeristentVolume struct {
|
type PersistentVolume struct {
|
||||||
*base
|
*base
|
||||||
Connection
|
Connection
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPersistentVolume returns a new PeristentVolume.
|
// NewPersistentVolume returns a new PersistentVolume.
|
||||||
func NewPersistentVolume(c Connection) *PeristentVolume {
|
func NewPersistentVolume(c Connection) *PersistentVolume {
|
||||||
return &PeristentVolume{&base{}, c}
|
return &PersistentVolume{&base{}, c}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a PeristentVolume.
|
// Get a PersistentVolume.
|
||||||
func (p *PeristentVolume) Get(_, n string) (interface{}, error) {
|
func (p *PersistentVolume) Get(_, n string) (interface{}, error) {
|
||||||
return p.DialOrDie().CoreV1().PersistentVolumes().Get(n, metav1.GetOptions{})
|
return p.DialOrDie().CoreV1().PersistentVolumes().Get(n, metav1.GetOptions{})
|
||||||
}
|
}
|
||||||
|
|
||||||
// List all PeristentVolumes in a given namespace.
|
// List all PersistentVolumes in a given namespace.
|
||||||
func (p *PeristentVolume) List(_ string) (Collection, error) {
|
func (p *PersistentVolume) List(_ string) (Collection, error) {
|
||||||
opts := metav1.ListOptions{
|
opts := metav1.ListOptions{
|
||||||
LabelSelector: p.labelSelector,
|
LabelSelector: p.labelSelector,
|
||||||
FieldSelector: p.fieldSelector,
|
FieldSelector: p.fieldSelector,
|
||||||
|
|
@ -39,7 +39,7 @@ func (p *PeristentVolume) List(_ string) (Collection, error) {
|
||||||
return cc, nil
|
return cc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete a PeristentVolume.
|
// Delete a PersistentVolume.
|
||||||
func (p *PeristentVolume) Delete(_, n string, cascade, force bool) error {
|
func (p *PersistentVolume) Delete(_, n string, cascade, force bool) error {
|
||||||
return p.DialOrDie().CoreV1().PersistentVolumes().Delete(n, nil)
|
return p.DialOrDie().CoreV1().PersistentVolumes().Delete(n, nil)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ func (r *PersistentVolume) Marshal(path string) (string, error) {
|
||||||
|
|
||||||
pv := i.(*v1.PersistentVolume)
|
pv := i.(*v1.PersistentVolume)
|
||||||
pv.TypeMeta.APIVersion = "v1"
|
pv.TypeMeta.APIVersion = "v1"
|
||||||
pv.TypeMeta.Kind = "PeristentVolume"
|
pv.TypeMeta.Kind = "PersistentVolume"
|
||||||
|
|
||||||
return r.marshalObject(pv)
|
return r.marshalObject(pv)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ func newPV() resource.Columnar {
|
||||||
|
|
||||||
func pvYaml() string {
|
func pvYaml() string {
|
||||||
return `apiVersion: v1
|
return `apiVersion: v1
|
||||||
kind: PeristentVolume
|
kind: PersistentVolume
|
||||||
metadata:
|
metadata:
|
||||||
creationTimestamp: "2018-12-14T17:36:43Z"
|
creationTimestamp: "2018-12-14T17:36:43Z"
|
||||||
name: fred
|
name: fred
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue