Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubernetes: add support for optional cascading deletes #938

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions args.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ const (
ArgVolumeFilesystemLabel = "fs-label"
// ArgVolumeList is the IDs of many volumes.
ArgVolumeList = "volumes"
// ArgVolumeSnapshotList is the IDs of many volume snapshots.
ArgVolumeSnapshotList = "snapshots"
// ArgLoadBalancerList is the IDs of many load balancers.
ArgLoadBalancerList = "load-balancers"

// ArgCDNTTL is a cdn ttl argument
ArgCDNTTL = "ttl"
Expand Down Expand Up @@ -335,4 +339,7 @@ const (

// ArgOneClickType is the type of 1-Click
ArgOneClickType = "type"

//ArgDangerous indicates whether to delete the cluster and all it's associated resources
ArgDangerous = "dangerous"
)
37 changes: 37 additions & 0 deletions commands/displayers/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,40 @@ func (nodeSizes *KubernetesNodeSizes) KV() []map[string]interface{} {

return out
}

type KubernetesAssociatedResources struct {
KubernetesAssociatedResources *do.KubernetesAssociatedResources
}

var _ Displayable = &KubernetesAssociatedResources{}

func (ar *KubernetesAssociatedResources) JSON(out io.Writer) error {
return writeJSON(ar.KubernetesAssociatedResources, out)
}

func (ar *KubernetesAssociatedResources) Cols() []string {
return []string{
"Volumes",
"VolumeSnapshots",
"LoadBalancers",
}
}

func (ar *KubernetesAssociatedResources) ColMap() map[string]string {
return map[string]string{
"Volumes": "Volumes",
"VolumeSnapshots": "Volume Snapshots",
"LoadBalancers": "Load Balancers",
}
}

func (ar *KubernetesAssociatedResources) KV() []map[string]interface{} {
out := make([]map[string]interface{}, 0, 1)
o := map[string]interface{}{
"Volumes": ar.KubernetesAssociatedResources.Volumes,
"VolumeSnapshots": ar.KubernetesAssociatedResources.VolumeSnapshots,
"LoadBalancers": ar.KubernetesAssociatedResources.LoadBalancers,
}
out = append(out, o)
return out
}
Loading