mirror of https://github.com/kubernetes/kops.git
Apply gofmt
This commit is contained in:
parent
847ec6b6a3
commit
933506bdbb
|
|
@ -58,10 +58,10 @@ type CreateClusterOptions struct {
|
|||
AssociatePublicIP bool
|
||||
|
||||
// Channel is the location of the api.Channel to use for our defaults
|
||||
Channel string
|
||||
Channel string
|
||||
|
||||
// The network topology to use
|
||||
Topology string
|
||||
Topology string
|
||||
}
|
||||
|
||||
func NewCmdCreateCluster(f *util.Factory, out io.Writer) *cobra.Command {
|
||||
|
|
@ -365,9 +365,8 @@ func RunCreateCluster(f *util.Factory, cmd *cobra.Command, args []string, out io
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Network Topology
|
||||
switch c.Topology{
|
||||
switch c.Topology {
|
||||
case api.TopologyPublic:
|
||||
cluster.Spec.Topology = &api.TopologySpec{Masters: api.TopologyPublic, Nodes: api.TopologyPublic, BypassBastion: false}
|
||||
case api.TopologyPrivate:
|
||||
|
|
@ -528,4 +527,4 @@ func parseZoneList(s string) []string {
|
|||
filtered = append(filtered, v)
|
||||
}
|
||||
return filtered
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import (
|
|||
"io"
|
||||
"io/ioutil"
|
||||
"k8s.io/kops/cmd/kops/util"
|
||||
"k8s.io/kops/pkg/apis/kops"
|
||||
"k8s.io/kops/pkg/apis/kops/registry"
|
||||
"k8s.io/kops/upup/pkg/fi"
|
||||
"k8s.io/kops/upup/pkg/fi/cloudup"
|
||||
|
|
@ -30,7 +31,6 @@ import (
|
|||
"k8s.io/kops/upup/pkg/kutil"
|
||||
"os"
|
||||
"strings"
|
||||
"k8s.io/kops/pkg/apis/kops"
|
||||
)
|
||||
|
||||
type UpdateClusterOptions struct {
|
||||
|
|
@ -191,7 +191,7 @@ func RunUpdateCluster(f *util.Factory, cmd *cobra.Command, args []string, out io
|
|||
fmt.Printf(" * list nodes: kubectl get nodes --show-labels\n")
|
||||
if cluster.Spec.Topology.Masters == kops.TopologyPublic {
|
||||
fmt.Printf(" * ssh to the master: ssh -i ~/.ssh/id_rsa admin@%s\n", cluster.Spec.MasterPublicName)
|
||||
}else {
|
||||
} else {
|
||||
fmt.Printf(" * ssh to the bastion: ssh -i ~/.ssh/id_rsa admin@%s\n", cluster.Spec.MasterPublicName)
|
||||
}
|
||||
fmt.Printf(" * read about installing addons: https://github.com/kubernetes/kops/blob/master/docs/addons.md\n")
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ func up() error {
|
|||
cluster.Spec.Topology.Masters = api.TopologyPublic
|
||||
cluster.Spec.Topology.Nodes = api.TopologyPublic
|
||||
|
||||
|
||||
for _, z := range nodeZones {
|
||||
cluster.Spec.Zones = append(cluster.Spec.Zones, &api.ClusterZoneSpec{
|
||||
Name: z,
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ type ApplyClusterCmd struct {
|
|||
DryRun bool
|
||||
}
|
||||
|
||||
|
||||
func (c *ApplyClusterCmd) Run() error {
|
||||
|
||||
if c.InstanceGroups == nil {
|
||||
|
|
@ -295,7 +294,7 @@ func (c *ApplyClusterCmd) Run() error {
|
|||
"securityGroupRule": &awstasks.SecurityGroupRule{},
|
||||
"subnet": &awstasks.Subnet{},
|
||||
"vpc": &awstasks.VPC{},
|
||||
"ngw": &awstasks.NatGateway{},
|
||||
"ngw": &awstasks.NatGateway{},
|
||||
"vpcDHDCPOptionsAssociation": &awstasks.VPCDHCPOptionsAssociation{},
|
||||
|
||||
// ELB
|
||||
|
|
@ -678,4 +677,4 @@ func ChannelForCluster(c *api.Cluster) (*api.Channel, error) {
|
|||
channelLocation = api.DefaultChannel
|
||||
}
|
||||
return api.LoadChannel(channelLocation)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ package awstasks
|
|||
import (
|
||||
//"fmt"
|
||||
//
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kops/upup/pkg/fi"
|
||||
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
//go:generate fitask -type=ElasticIP
|
||||
|
|
@ -32,16 +32,14 @@ import (
|
|||
// Elastic IP
|
||||
// Representation the EIP AWS task
|
||||
type ElasticIP struct {
|
||||
Name *string
|
||||
ID *string
|
||||
PublicIP *string
|
||||
|
||||
|
||||
Name *string
|
||||
ID *string
|
||||
PublicIP *string
|
||||
|
||||
// Allow support for associated subnets
|
||||
// If you need another resource to tag on (ebs volume)
|
||||
// you must add it
|
||||
Subnet *Subnet
|
||||
Subnet *Subnet
|
||||
}
|
||||
|
||||
var _ fi.HasAddress = &ElasticIP{}
|
||||
|
|
@ -185,17 +183,16 @@ func (_ *ElasticIP) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *ElasticIP) e
|
|||
e.PublicIP = response.PublicIp
|
||||
publicIp = e.PublicIP
|
||||
eipId = response.AllocationId
|
||||
}else {
|
||||
} else {
|
||||
publicIp = a.PublicIP
|
||||
eipId = a.ID
|
||||
}
|
||||
|
||||
|
||||
// Tag the associated subnet
|
||||
if e.Subnet == nil {
|
||||
return fmt.Errorf("Subnet not set")
|
||||
return fmt.Errorf("Subnet not set")
|
||||
} else if e.Subnet.ID == nil {
|
||||
return fmt.Errorf("Subnet ID not set")
|
||||
return fmt.Errorf("Subnet ID not set")
|
||||
}
|
||||
tags := make(map[string]string)
|
||||
tags["AssociatedElasticIp"] = *publicIp
|
||||
|
|
@ -207,5 +204,4 @@ func (_ *ElasticIP) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *ElasticIP) e
|
|||
return nil
|
||||
}
|
||||
|
||||
|
||||
// TODO Kris - We need to support EIP for Terraform
|
||||
|
|
|
|||
|
|
@ -21,15 +21,15 @@ import (
|
|||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/service/autoscaling"
|
||||
"github.com/aws/aws-sdk-go/service/elb"
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kops/upup/pkg/fi"
|
||||
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
|
||||
"github.com/aws/aws-sdk-go/service/elb"
|
||||
)
|
||||
|
||||
type LoadBalancerAttachment struct {
|
||||
Name *string
|
||||
LoadBalancer *LoadBalancer
|
||||
Name *string
|
||||
LoadBalancer *LoadBalancer
|
||||
|
||||
// LoadBalancerAttachments now support ASGs or direct instances
|
||||
AutoscalingGroup *AutoscalingGroup
|
||||
|
|
@ -38,7 +38,7 @@ type LoadBalancerAttachment struct {
|
|||
// Here be dragons..
|
||||
// This will *NOT* unmarshal.. for some reason this pointer is initiated as nil
|
||||
// instead of a pointer to Instance with nil members..
|
||||
Instance *Instance
|
||||
Instance *Instance
|
||||
}
|
||||
|
||||
func (e *LoadBalancerAttachment) Find(c *fi.Context) (*LoadBalancerAttachment, error) {
|
||||
|
|
|
|||
|
|
@ -182,4 +182,4 @@ func (_ *NatGateway) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *NatGateway)
|
|||
//
|
||||
//func (e *NATGateway) TerraformLink() *terraform.Literal {
|
||||
// return terraform.LiteralProperty("aws_natgateway", *e.AllocationID, "id")
|
||||
//}
|
||||
//}
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ import (
|
|||
type Route struct {
|
||||
Name *string
|
||||
|
||||
RouteTable *RouteTable
|
||||
Instance *Instance
|
||||
CIDR *string
|
||||
RouteTable *RouteTable
|
||||
Instance *Instance
|
||||
CIDR *string
|
||||
|
||||
// Either an InternetGateway or a NAT Gateway
|
||||
// MUST be provided.
|
||||
|
|
@ -152,9 +152,9 @@ func (_ *Route) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Route) error {
|
|||
|
||||
if e.InternetGateway == nil && e.NatGateway == nil {
|
||||
return fmt.Errorf("missing target for route")
|
||||
}else if e.InternetGateway != nil {
|
||||
} else if e.InternetGateway != nil {
|
||||
request.GatewayId = checkNotNil(e.InternetGateway.ID)
|
||||
}else if e.NatGateway != nil {
|
||||
} else if e.NatGateway != nil {
|
||||
request.NatGatewayId = checkNotNil(e.NatGateway.ID)
|
||||
}
|
||||
|
||||
|
|
@ -179,9 +179,9 @@ func (_ *Route) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Route) error {
|
|||
|
||||
if e.InternetGateway == nil && e.NatGateway == nil {
|
||||
return fmt.Errorf("missing target for route")
|
||||
}else if e.InternetGateway != nil {
|
||||
} else if e.InternetGateway != nil {
|
||||
request.GatewayId = checkNotNil(e.InternetGateway.ID)
|
||||
}else if e.NatGateway != nil {
|
||||
} else if e.NatGateway != nil {
|
||||
request.NatGatewayId = checkNotNil(e.NatGateway.ID)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,4 +32,4 @@ func TestValidatePrivateNetworkingHappy(t *testing.T) {
|
|||
// Sad path
|
||||
func TestValidatePrivateNetworkingSad(t *testing.T) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package cloudup
|
||||
|
||||
import (
|
||||
|
|
@ -74,7 +73,6 @@ func PopulateClusterSpec(cluster *api.Cluster) (*api.Cluster, error) {
|
|||
return c.fullCluster, nil
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Here be dragons
|
||||
//
|
||||
|
|
@ -117,7 +115,6 @@ func (c *populateClusterSpec) run() error {
|
|||
clusterZones[z.Name] = z
|
||||
}
|
||||
|
||||
|
||||
// Check etcd configuration
|
||||
{
|
||||
for i, etcd := range cluster.Spec.EtcdClusters {
|
||||
|
|
@ -164,7 +161,6 @@ func (c *populateClusterSpec) run() error {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
keyStore, err := registry.KeyStore(cluster)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -224,7 +220,6 @@ func (c *populateClusterSpec) run() error {
|
|||
// Otherwise we were losing the pointer
|
||||
cluster.Spec.Topology = c.InputCluster.Spec.Topology
|
||||
|
||||
|
||||
if cluster.Spec.DNSZone == "" {
|
||||
dns, err := cloud.DNS()
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ func buildMinimalCluster() *api.Cluster {
|
|||
// Default to public topology
|
||||
c.Spec.Topology = &api.TopologySpec{
|
||||
Masters: api.TopologyPublic,
|
||||
Nodes: api.TopologyPublic,
|
||||
Nodes: api.TopologyPublic,
|
||||
}
|
||||
c.Spec.NetworkCIDR = "172.20.0.0/16"
|
||||
c.Spec.NonMasqueradeCIDR = "100.64.0.0/10"
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func buildCluster(clusterArgs interface{}) *api.Cluster {
|
|||
KubernetesVersion: cParams.KubernetesVersion,
|
||||
Networking: networking,
|
||||
UpdatePolicy: fi.String(cParams.UpdatePolicy),
|
||||
Topology: &api.TopologySpec{
|
||||
Topology: &api.TopologySpec{
|
||||
Masters: api.TopologyPublic,
|
||||
Nodes: api.TopologyPublic,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ func (tf *TemplateFunctions) AddTo(dest template.FuncMap) {
|
|||
dest["SharedVPC"] = tf.SharedVPC
|
||||
|
||||
// Network topology definitions
|
||||
dest["IsTopologyPublic"] = tf.IsTopologyPublic
|
||||
dest["IsTopologyPublic"] = tf.IsTopologyPublic
|
||||
dest["IsTopologyPrivate"] = tf.IsTopologyPrivate
|
||||
dest["IsTopologyPrivateMasters"] = tf.IsTopologyPrivateMasters
|
||||
dest["WithBastion"] = tf.WithBastion
|
||||
|
|
@ -175,12 +175,14 @@ func (tf *TemplateFunctions) SharedVPC() bool {
|
|||
|
||||
// These are the network topology functions. They are boolean logic for checking which type of
|
||||
// topology this cluster is set to be deployed with.
|
||||
func (tf *TemplateFunctions) IsTopologyPrivate() bool { return tf.cluster.IsTopologyPrivate() }
|
||||
func (tf *TemplateFunctions) IsTopologyPublic() bool { return tf.cluster.IsTopologyPublic() }
|
||||
func (tf *TemplateFunctions) IsTopologyPrivateMasters() bool { return tf.cluster.IsTopologyPrivateMasters() }
|
||||
func (tf *TemplateFunctions) IsTopologyPrivate() bool { return tf.cluster.IsTopologyPrivate() }
|
||||
func (tf *TemplateFunctions) IsTopologyPublic() bool { return tf.cluster.IsTopologyPublic() }
|
||||
func (tf *TemplateFunctions) IsTopologyPrivateMasters() bool {
|
||||
return tf.cluster.IsTopologyPrivateMasters()
|
||||
}
|
||||
|
||||
func (tf *TemplateFunctions) WithBastion() bool {
|
||||
return !tf.cluster.Spec.Topology.BypassBastion
|
||||
func (tf *TemplateFunctions) WithBastion() bool {
|
||||
return !tf.cluster.Spec.Topology.BypassBastion
|
||||
}
|
||||
|
||||
// This function is replacing existing yaml
|
||||
|
|
@ -197,13 +199,13 @@ func (tf *TemplateFunctions) GetBastionZone() (string, error) {
|
|||
|
||||
// Will attempt to calculate a meaningful name for an ELB given a prefix
|
||||
// Will never return a string longer than 32 chars
|
||||
func (tf *TemplateFunctions) GetELBName32(prefix string) (string, error ){
|
||||
func (tf *TemplateFunctions) GetELBName32(prefix string) (string, error) {
|
||||
var returnString string
|
||||
c := tf.cluster.Name
|
||||
s := strings.Split(c, ".")
|
||||
if len(s) > 0 {
|
||||
returnString = fmt.Sprintf("%s-%s", prefix, s[0])
|
||||
}else {
|
||||
} else {
|
||||
returnString = fmt.Sprintf("%s-%s", prefix, c)
|
||||
}
|
||||
if len(returnString) > 32 {
|
||||
|
|
@ -215,7 +217,7 @@ func (tf *TemplateFunctions) GetELBName32(prefix string) (string, error ){
|
|||
func (tf *TemplateFunctions) GetBastionImageId() (string, error) {
|
||||
if len(tf.instanceGroups) == 0 {
|
||||
return "", fmt.Errorf("Unable to find AMI in instance group")
|
||||
}else if len(tf.instanceGroups) > 0 {
|
||||
} else if len(tf.instanceGroups) > 0 {
|
||||
ami := tf.instanceGroups[0].Spec.Image
|
||||
for i := 1; i < len(tf.instanceGroups); i++ {
|
||||
// If we can't be sure all AMIs are the same, we don't know which one to use for the bastion host
|
||||
|
|
@ -223,7 +225,7 @@ func (tf *TemplateFunctions) GetBastionImageId() (string, error) {
|
|||
return "", fmt.Errorf("Unable to use multiple image id's with a private bastion")
|
||||
}
|
||||
}
|
||||
return ami, nil;
|
||||
return ami, nil
|
||||
}
|
||||
return "", nil
|
||||
}
|
||||
|
|
@ -376,4 +378,4 @@ func (tf *TemplateFunctions) DnsControllerArgv() ([]string, error) {
|
|||
argv = append(argv, "-v=8")
|
||||
|
||||
return argv, nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,8 +112,7 @@ func newTemplateFunctions(nodeupConfig *NodeUpConfig, cluster *api.Cluster, inst
|
|||
|
||||
func (t *templateFunctions) populate(dest template.FuncMap) {
|
||||
|
||||
|
||||
dest["IsTopologyPublic"] = t.cluster.IsTopologyPublic
|
||||
dest["IsTopologyPublic"] = t.cluster.IsTopologyPublic
|
||||
dest["IsTopologyPrivate"] = t.cluster.IsTopologyPrivate
|
||||
|
||||
dest["CACertificatePool"] = t.CACertificatePool
|
||||
|
|
|
|||
|
|
@ -53,19 +53,19 @@ type DeleteCluster struct {
|
|||
}
|
||||
|
||||
type ResourceTracker struct {
|
||||
Name string
|
||||
Type string
|
||||
ID string
|
||||
Name string
|
||||
Type string
|
||||
ID string
|
||||
|
||||
blocks []string
|
||||
blocked []string
|
||||
done bool
|
||||
blocks []string
|
||||
blocked []string
|
||||
done bool
|
||||
|
||||
deleter func(cloud fi.Cloud, tracker *ResourceTracker) error
|
||||
groupKey string
|
||||
groupDeleter func(cloud fi.Cloud, trackers []*ResourceTracker) error
|
||||
|
||||
obj interface{}
|
||||
obj interface{}
|
||||
}
|
||||
|
||||
type listFn func(fi.Cloud, string) ([]*ResourceTracker, error)
|
||||
|
|
@ -91,7 +91,7 @@ func buildEC2Filters(cloud fi.Cloud) []*ec2.Filter {
|
|||
|
||||
var filters []*ec2.Filter
|
||||
for k, v := range tags {
|
||||
filter := awsup.NewEC2Filter("tag:" + k, v)
|
||||
filter := awsup.NewEC2Filter("tag:"+k, v)
|
||||
filters = append(filters, filter)
|
||||
}
|
||||
return filters
|
||||
|
|
@ -131,7 +131,7 @@ func (c *DeleteCluster) ListResources() (map[string]*ResourceTracker, error) {
|
|||
return nil, err
|
||||
}
|
||||
for _, t := range trackers {
|
||||
resources[t.Type + ":" + t.ID] = t
|
||||
resources[t.Type+":"+t.ID] = t
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -152,8 +152,8 @@ func (c *DeleteCluster) ListResources() (map[string]*ResourceTracker, error) {
|
|||
if vpcID == "" || igwID == "" {
|
||||
continue
|
||||
}
|
||||
if resources["vpc:" + vpcID] != nil && resources["internet-gateway:" + igwID] == nil {
|
||||
resources["internet-gateway:" + igwID] = &ResourceTracker{
|
||||
if resources["vpc:"+vpcID] != nil && resources["internet-gateway:"+igwID] == nil {
|
||||
resources["internet-gateway:"+igwID] = &ResourceTracker{
|
||||
Name: FindName(igw.Tags),
|
||||
ID: igwID,
|
||||
Type: "internet-gateway",
|
||||
|
|
@ -192,7 +192,7 @@ func addUntaggedRouteTables(cloud awsup.AWSCloud, clusterName string, resources
|
|||
continue
|
||||
}
|
||||
|
||||
if resources["vpc:" + vpcID] == nil {
|
||||
if resources["vpc:"+vpcID] == nil {
|
||||
// Not deleting this VPC; ignore
|
||||
continue
|
||||
}
|
||||
|
|
@ -215,8 +215,8 @@ func addUntaggedRouteTables(cloud awsup.AWSCloud, clusterName string, resources
|
|||
}
|
||||
|
||||
t := buildTrackerForRouteTable(rt)
|
||||
if resources[t.Type + ":" + t.ID] == nil {
|
||||
resources[t.Type + ":" + t.ID] = t
|
||||
if resources[t.Type+":"+t.ID] == nil {
|
||||
resources[t.Type+":"+t.ID] = t
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -469,19 +469,19 @@ func ListInstances(cloud fi.Cloud, clusterName string) ([]*ResourceTracker, erro
|
|||
}
|
||||
|
||||
var blocks []string
|
||||
blocks = append(blocks, "vpc:" + aws.StringValue(instance.VpcId))
|
||||
blocks = append(blocks, "vpc:"+aws.StringValue(instance.VpcId))
|
||||
|
||||
for _, volume := range instance.BlockDeviceMappings {
|
||||
if volume.Ebs == nil {
|
||||
continue
|
||||
}
|
||||
blocks = append(blocks, "volume:" + aws.StringValue(volume.Ebs.VolumeId))
|
||||
blocks = append(blocks, "volume:"+aws.StringValue(volume.Ebs.VolumeId))
|
||||
}
|
||||
for _, sg := range instance.SecurityGroups {
|
||||
blocks = append(blocks, "security-group:" + aws.StringValue(sg.GroupId))
|
||||
blocks = append(blocks, "security-group:"+aws.StringValue(sg.GroupId))
|
||||
}
|
||||
blocks = append(blocks, "subnet:" + aws.StringValue(instance.SubnetId))
|
||||
blocks = append(blocks, "vpc:" + aws.StringValue(instance.VpcId))
|
||||
blocks = append(blocks, "subnet:"+aws.StringValue(instance.SubnetId))
|
||||
blocks = append(blocks, "vpc:"+aws.StringValue(instance.VpcId))
|
||||
|
||||
tracker.blocks = blocks
|
||||
|
||||
|
|
@ -566,7 +566,7 @@ func ListSecurityGroups(cloud fi.Cloud, clusterName string) ([]*ResourceTracker,
|
|||
}
|
||||
|
||||
var blocks []string
|
||||
blocks = append(blocks, "vpc:" + aws.StringValue(sg.VpcId))
|
||||
blocks = append(blocks, "vpc:"+aws.StringValue(sg.VpcId))
|
||||
|
||||
tracker.blocks = blocks
|
||||
|
||||
|
|
@ -730,8 +730,8 @@ func ListKeypairs(cloud fi.Cloud, clusterName string) ([]*ResourceTracker, error
|
|||
|
||||
glog.V(2).Infof("Listing EC2 Keypairs")
|
||||
request := &ec2.DescribeKeyPairsInput{
|
||||
// We need to match both the name and a prefix
|
||||
//Filters: []*ec2.Filter{awsup.NewEC2Filter("key-name", keypairName)},
|
||||
// We need to match both the name and a prefix
|
||||
//Filters: []*ec2.Filter{awsup.NewEC2Filter("key-name", keypairName)},
|
||||
}
|
||||
response, err := c.EC2().DescribeKeyPairs(request)
|
||||
if err != nil {
|
||||
|
|
@ -742,7 +742,7 @@ func ListKeypairs(cloud fi.Cloud, clusterName string) ([]*ResourceTracker, error
|
|||
|
||||
for _, keypair := range response.KeyPairs {
|
||||
name := aws.StringValue(keypair.KeyName)
|
||||
if name != keypairName && !strings.HasPrefix(name, keypairName + "-") {
|
||||
if name != keypairName && !strings.HasPrefix(name, keypairName+"-") {
|
||||
continue
|
||||
}
|
||||
tracker := &ResourceTracker{
|
||||
|
|
@ -828,7 +828,7 @@ func ListSubnets(cloud fi.Cloud, clusterName string) ([]*ResourceTracker, error)
|
|||
}
|
||||
|
||||
var blocks []string
|
||||
blocks = append(blocks, "vpc:" + aws.StringValue(subnet.VpcId))
|
||||
blocks = append(blocks, "vpc:"+aws.StringValue(subnet.VpcId))
|
||||
|
||||
tracker.blocks = blocks
|
||||
|
||||
|
|
@ -984,10 +984,10 @@ func buildTrackerForRouteTable(rt *ec2.RouteTable) *ResourceTracker {
|
|||
var blocks []string
|
||||
var blocked []string
|
||||
|
||||
blocks = append(blocks, "vpc:" + aws.StringValue(rt.VpcId))
|
||||
blocks = append(blocks, "vpc:"+aws.StringValue(rt.VpcId))
|
||||
|
||||
for _, a := range rt.Associations {
|
||||
blocked = append(blocked, "subnet:" + aws.StringValue(a.SubnetId))
|
||||
blocked = append(blocked, "subnet:"+aws.StringValue(a.SubnetId))
|
||||
}
|
||||
|
||||
tracker.blocks = blocks
|
||||
|
|
@ -1139,7 +1139,7 @@ func ListInternetGateways(cloud fi.Cloud, clusterName string) ([]*ResourceTracke
|
|||
var blocks []string
|
||||
for _, a := range o.Attachments {
|
||||
if aws.StringValue(a.VpcId) != "" {
|
||||
blocks = append(blocks, "vpc:" + aws.StringValue(a.VpcId))
|
||||
blocks = append(blocks, "vpc:"+aws.StringValue(a.VpcId))
|
||||
}
|
||||
}
|
||||
tracker.blocks = blocks
|
||||
|
|
@ -1242,7 +1242,7 @@ func ListVPCs(cloud fi.Cloud, clusterName string) ([]*ResourceTracker, error) {
|
|||
}
|
||||
|
||||
var blocks []string
|
||||
blocks = append(blocks, "dhcp-options:" + aws.StringValue(v.DhcpOptionsId))
|
||||
blocks = append(blocks, "dhcp-options:"+aws.StringValue(v.DhcpOptionsId))
|
||||
|
||||
tracker.blocks = blocks
|
||||
|
||||
|
|
@ -1298,9 +1298,9 @@ func ListAutoScalingGroups(cloud fi.Cloud, clusterName string) ([]*ResourceTrack
|
|||
if subnet == "" {
|
||||
continue
|
||||
}
|
||||
blocks = append(blocks, "subnet:" + subnet)
|
||||
blocks = append(blocks, "subnet:"+subnet)
|
||||
}
|
||||
blocks = append(blocks, TypeAutoscalingLaunchConfig + ":" + aws.StringValue(asg.LaunchConfigurationName))
|
||||
blocks = append(blocks, TypeAutoscalingLaunchConfig+":"+aws.StringValue(asg.LaunchConfigurationName))
|
||||
|
||||
tracker.blocks = blocks
|
||||
|
||||
|
|
@ -1462,12 +1462,12 @@ func ListELBs(cloud fi.Cloud, clusterName string) ([]*ResourceTracker, error) {
|
|||
|
||||
var blocks []string
|
||||
for _, sg := range elb.SecurityGroups {
|
||||
blocks = append(blocks, "security-group:" + aws.StringValue(sg))
|
||||
blocks = append(blocks, "security-group:"+aws.StringValue(sg))
|
||||
}
|
||||
for _, s := range elb.Subnets {
|
||||
blocks = append(blocks, "subnet:" + aws.StringValue(s))
|
||||
blocks = append(blocks, "subnet:"+aws.StringValue(s))
|
||||
}
|
||||
blocks = append(blocks, "vpc:" + aws.StringValue(elb.VPCId))
|
||||
blocks = append(blocks, "vpc:"+aws.StringValue(elb.VPCId))
|
||||
|
||||
tracker.blocks = blocks
|
||||
|
||||
|
|
@ -1742,8 +1742,8 @@ func ListIAMRoles(cloud fi.Cloud, clusterName string) ([]*ResourceTracker, error
|
|||
c := cloud.(awsup.AWSCloud)
|
||||
|
||||
remove := make(map[string]bool)
|
||||
remove["masters." + clusterName] = true
|
||||
remove["nodes." + clusterName] = true
|
||||
remove["masters."+clusterName] = true
|
||||
remove["nodes."+clusterName] = true
|
||||
|
||||
var roles []*iam.Role
|
||||
// Find roles matching remove map
|
||||
|
|
@ -1819,8 +1819,8 @@ func ListIAMInstanceProfiles(cloud fi.Cloud, clusterName string) ([]*ResourceTra
|
|||
c := cloud.(awsup.AWSCloud)
|
||||
|
||||
remove := make(map[string]bool)
|
||||
remove["masters." + clusterName] = true
|
||||
remove["nodes." + clusterName] = true
|
||||
remove["masters."+clusterName] = true
|
||||
remove["nodes."+clusterName] = true
|
||||
|
||||
var profiles []*iam.InstanceProfile
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue