Skip to content

Commit

Permalink
kubernetes: support optional cascading deletes
Browse files Browse the repository at this point in the history
  • Loading branch information
varshavaradarajan committed Jan 28, 2021
1 parent 840d2aa commit 4a093f1
Show file tree
Hide file tree
Showing 6 changed files with 674 additions and 197 deletions.
8 changes: 8 additions & 0 deletions args.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ 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 +340,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

0 comments on commit 4a093f1

Please sign in to comment.