Merge pull request #4805 from justinsb/toolbox_dump_vpc

Add VPC to kops toolbox dump
This commit is contained in:
k8s-ci-robot 2018-03-31 20:13:02 -07:00 committed by GitHub
commit 973397f28a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -53,6 +53,13 @@ func DumpVPC(op *resources.DumpOperation, r *resources.Resource) error {
data["type"] = ec2.ResourceTypeVpc
data["raw"] = r.Obj
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
}

View File

@ -29,9 +29,15 @@ type Subnet struct {
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
type Dump struct {
Resources []interface{} `json:"resources,omitempty"`
Instances []*Instance `json:"instances,omitempty"`
Subnets []*Subnet `json:"subnets,omitempty"`
VPC *VPC `json:"vpc,omitempty"`
}