mirror of https://github.com/kubernetes/kops.git
Merge pull request #4805 from justinsb/toolbox_dump_vpc
Add VPC to kops toolbox dump
This commit is contained in:
commit
973397f28a
|
@ -53,6 +53,13 @@ func DumpVPC(op *resources.DumpOperation, r *resources.Resource) error {
|
||||||
data["type"] = ec2.ResourceTypeVpc
|
data["type"] = ec2.ResourceTypeVpc
|
||||||
data["raw"] = r.Obj
|
data["raw"] = r.Obj
|
||||||
op.Dump.Resources = append(op.Dump.Resources, data)
|
op.Dump.Resources = append(op.Dump.Resources, data)
|
||||||
|
|
||||||
|
ec2VPC := r.Obj.(*ec2.Vpc)
|
||||||
|
vpc := &resources.VPC{
|
||||||
|
ID: aws.StringValue(ec2VPC.VpcId),
|
||||||
|
}
|
||||||
|
op.Dump.VPC = vpc
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,15 @@ type Subnet struct {
|
||||||
Zone string `json:"zone,omitempty"`
|
Zone string `json:"zone,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// VPC is the type for an VPC in a dump
|
||||||
|
type VPC struct {
|
||||||
|
ID string `json:"id,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
// Dump is the type for a dump result
|
// Dump is the type for a dump result
|
||||||
type Dump struct {
|
type Dump struct {
|
||||||
Resources []interface{} `json:"resources,omitempty"`
|
Resources []interface{} `json:"resources,omitempty"`
|
||||||
Instances []*Instance `json:"instances,omitempty"`
|
Instances []*Instance `json:"instances,omitempty"`
|
||||||
Subnets []*Subnet `json:"subnets,omitempty"`
|
Subnets []*Subnet `json:"subnets,omitempty"`
|
||||||
|
VPC *VPC `json:"vpc,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue