mirror of https://github.com/kubernetes/kops.git
Adding another large commit after a make codegen
This commit is contained in:
parent
a1c5c77b23
commit
9bd9e30bdd
|
|
@ -33,7 +33,6 @@ import (
|
|||
"k8s.io/kops/upup/pkg/kutil"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
"strings"
|
||||
"os"
|
||||
)
|
||||
|
||||
type CreateClusterOptions struct {
|
||||
|
|
@ -413,12 +412,6 @@ func RunCreateCluster(f *util.Factory, cmd *cobra.Command, args []string, out io
|
|||
}
|
||||
|
||||
fullCluster, err := cloudup.PopulateClusterSpec(cluster)
|
||||
fmt.Println("------------------------------------------------")
|
||||
fmt.Println(cluster.Spec.Topology)
|
||||
fmt.Println("------------------------------------------------")
|
||||
fmt.Println(fullCluster.Spec.Topology)
|
||||
fmt.Println("------------------------------------------------")
|
||||
os.Exit(1)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
@ -470,8 +463,6 @@ func RunCreateCluster(f *util.Factory, cmd *cobra.Command, args []string, out io
|
|||
fmt.Print("Previewing changes that will be made:\n\n")
|
||||
}
|
||||
|
||||
fmt.Println(fullCluster.Spec.Topology)
|
||||
os.Exit(1)
|
||||
applyCmd := &cloudup.ApplyClusterCmd{
|
||||
Cluster: fullCluster,
|
||||
Models: strings.Split(c.Models, ","),
|
||||
|
|
|
|||
|
|
@ -118,6 +118,17 @@ routeTableAssociation/{{ $zone.Name }}.{{ ClusterName }}:
|
|||
routeTable: routeTable/{{ ClusterName }}
|
||||
subnet: subnet/{{ $zone.Name }}.{{ ClusterName }}
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
# Elastic IP
|
||||
#
|
||||
# Every NGW needs a public (Elastic) IP address, every private
|
||||
# subnet needs a NGW, lets create it
|
||||
# ---------------------------------------------------------------
|
||||
elasticIP/{{ $zone.Name }}.{{ ClusterName }}:
|
||||
name: {{ $zone.Name }}.{{ ClusterName }}
|
||||
tagOnResource: vpc/{{ ClusterName }}
|
||||
tagUsingKey: kubernetes.io/master-nat-gateway
|
||||
|
||||
# ---------------------------------------------------------------
|
||||
# NGW
|
||||
#
|
||||
|
|
@ -127,7 +138,9 @@ routeTableAssociation/{{ $zone.Name }}.{{ ClusterName }}:
|
|||
# using a network address translation (NAT) gateway that resides
|
||||
# in the public subnet.
|
||||
# ---------------------------------------------------------------
|
||||
|
||||
ngw/{{ $zone.Name }}.{{ ClusterName }}:
|
||||
elasticIp: elasticIP/{{ $zone.Name }}.{{ ClusterName }}
|
||||
subnet: subnet/{{ $zone.Name }}.{{ ClusterName }}
|
||||
|
||||
|
||||
{{ end }}
|
||||
|
|
@ -137,5 +150,3 @@ routeTableAssociation/{{ $zone.Name }}.{{ ClusterName }}:
|
|||
|
||||
|
||||
|
||||
|
||||
{{ end }}
|
||||
|
|
@ -47,5 +47,4 @@ routeTableAssociation/{{ $zone.Name }}.{{ ClusterName }}:
|
|||
routeTable: routeTable/{{ ClusterName }}
|
||||
subnet: subnet/{{ $zone.Name }}.{{ ClusterName }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
@ -295,17 +295,9 @@ func (c *ApplyClusterCmd) Run() error {
|
|||
"securityGroupRule": &awstasks.SecurityGroupRule{},
|
||||
"subnet": &awstasks.Subnet{},
|
||||
"vpc": &awstasks.VPC{},
|
||||
|
||||
|
||||
// Not using NatGateways right now - not there yet :)
|
||||
// Kris TODO
|
||||
//"natGateway": &awstasks.NATGateway{},
|
||||
|
||||
|
||||
"ngw": &awstasks.NATGateway{},
|
||||
"vpcDHDCPOptionsAssociation": &awstasks.VPCDHCPOptionsAssociation{},
|
||||
|
||||
|
||||
|
||||
// ELB
|
||||
"loadBalancer": &awstasks.LoadBalancer{},
|
||||
"loadBalancerAttachment": &awstasks.LoadBalancerAttachment{},
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=AutoscalingGroup"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=DHCPOptions"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=DNSName"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=DNSZone"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=EBSVolume"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=ElasticIP"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=IAMInstanceProfile"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=IAMRole"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=IAMRolePolicy"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=InternetGateway"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=LaunchConfiguration"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=LoadBalancer"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -14,136 +14,60 @@ limitations under the License.
|
|||
package awstasks
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/golang/glog"
|
||||
//"fmt"
|
||||
//"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"
|
||||
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
|
||||
//"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
|
||||
)
|
||||
|
||||
//go:generate fitask -type=natgateway
|
||||
//go:generate fitask -type=NATGateway
|
||||
type NATGateway struct {
|
||||
Name *string
|
||||
ID *string
|
||||
AllocationID *string
|
||||
SubnetID *string
|
||||
VPCID *string
|
||||
ElasticIp *string
|
||||
Subnet *string
|
||||
}
|
||||
|
||||
var _ fi.CompareWithID = &NATGateway{} // Validate the IDs
|
||||
|
||||
func (e *NATGateway) CompareWithID() *string {
|
||||
return e.ID
|
||||
s := ""
|
||||
return &s
|
||||
}
|
||||
|
||||
func (e *NATGateway) Find(c *fi.Context) (*NATGateway, error) {
|
||||
cloud := c.Cloud.(awsup.AWSCloud)
|
||||
|
||||
request := &ec2.DescribeNatGatewaysInput{}
|
||||
|
||||
if fi.StringValue(e.ID) != "" {
|
||||
request.NatGatewayIds = []*string{e.ID}
|
||||
} else {
|
||||
request.Filter = cloud.BuildFilters(e.SubnetID)
|
||||
}
|
||||
|
||||
response, err := cloud.EC2().DescribeNatGateways(request)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error listing NAT Gateways: %v", err)
|
||||
}
|
||||
if response == nil || len(response.NatGateways) == 0 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
if len(response.NatGateways) != 1 {
|
||||
return nil, fmt.Errorf("found multiple NAT Gateways matching tags")
|
||||
}
|
||||
ngw := response.NatGateways[0]
|
||||
actual := &NATGateway{
|
||||
ID: ngw.NatGatewayId,
|
||||
VPCID: ngw.VpcId,
|
||||
SubnetID: ngw.SubnetId,
|
||||
}
|
||||
|
||||
glog.V(4).Infof("found matching NAT gateway %v", actual)
|
||||
|
||||
// Allocation ID
|
||||
if actual.ID != nil {
|
||||
request := &ec2.DescribeAddressesInput{}
|
||||
request.Filters = cloud.BuildFilters(e.VPCID)
|
||||
response, err := cloud.EC2().DescribeAddresses(request)
|
||||
if err != nil || len(response.Addresses) != 1 {
|
||||
return nil, fmt.Errorf("error querying for elastic ip support: %v", err)
|
||||
}
|
||||
actual.AllocationID = response.Addresses[0].AllocationId
|
||||
}
|
||||
|
||||
if e.ID == nil {
|
||||
e.ID = actual.ID
|
||||
}
|
||||
|
||||
return actual, nil
|
||||
return &NATGateway{}, nil
|
||||
}
|
||||
|
||||
func (s *NATGateway) CheckChanges(a, e, changes *NATGateway) error {
|
||||
if a == nil {
|
||||
if e.AllocationID == nil {
|
||||
return fi.RequiredField("AllocationID")
|
||||
}
|
||||
if e.SubnetID == nil {
|
||||
return fi.RequiredField("SubnetID")
|
||||
}
|
||||
}
|
||||
if a != nil {
|
||||
if changes.AllocationID != nil {
|
||||
// TODO: Do we want to destroy & recreate the VPC?
|
||||
return fi.CannotChangeField("AllocationID")
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *NATGateway) Run(c *fi.Context) error {
|
||||
return fi.DefaultDeltaRunMethod(e, c)
|
||||
}
|
||||
|
||||
func (_ *NATGateway) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *NATGateway) error {
|
||||
if a == nil {
|
||||
glog.V(2).Infof("Creating NGW with Allocation ID: %q", *e.AllocationID)
|
||||
|
||||
request := &ec2.CreateNatGatewayInput{
|
||||
AllocationId: e.AllocationID,
|
||||
SubnetId: e.SubnetID,
|
||||
}
|
||||
|
||||
response, err := t.Cloud.EC2().CreateNatGateway(request)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error creating Nat gateway: %v", err)
|
||||
}
|
||||
|
||||
e.ID = response.NatGateway.NatGatewayId
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type terraformNatGateway struct {
|
||||
AllocationId *string `json:"AllocationID,omitempty"`
|
||||
SubnetID *bool `json:"SubnetID,omitempty"`
|
||||
func (_ *NATGateway) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *NATGateway) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (_ *NATGateway) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *NATGateway) error {
|
||||
// cloud := t.Cloud.(awsup.AWSCloud)
|
||||
|
||||
tf := &terraformNatGateway{
|
||||
AllocationId: e.AllocationID,
|
||||
//SubnetID: e.SubnetID,
|
||||
}
|
||||
|
||||
return t.RenderResource("aws_natgateway", *e.AllocationID, tf)
|
||||
}
|
||||
|
||||
func (e *NATGateway) TerraformLink() *terraform.Literal {
|
||||
return terraform.LiteralProperty("aws_natgateway", *e.AllocationID, "id")
|
||||
}
|
||||
//type terraformNATGateway struct {
|
||||
// AllocationId *string `json:"AllocationID,omitempty"`
|
||||
// SubnetID *bool `json:"SubnetID,omitempty"`
|
||||
//}
|
||||
//
|
||||
//func (_ *NATGateway) RenderTerraform(t *terraform.TerraformTarget, a, e, changes *NATGateway) error {
|
||||
// // cloud := t.Cloud.(awsup.AWSCloud)
|
||||
//
|
||||
// tf := &terraformNatGateway{
|
||||
// AllocationId: e.AllocationID,
|
||||
// //SubnetID: e.SubnetID,
|
||||
// }
|
||||
//
|
||||
// return t.RenderResource("aws_natgateway", *e.AllocationID, tf)
|
||||
//}
|
||||
//
|
||||
//func (e *NATGateway) TerraformLink() *terraform.Literal {
|
||||
// return terraform.LiteralProperty("aws_natgateway", *e.AllocationID, "id")
|
||||
//}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
// Code generated by ""fitask" -type=NATGateway"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"k8s.io/kops/upup/pkg/fi"
|
||||
)
|
||||
|
||||
// NATGateway
|
||||
|
||||
// JSON marshalling boilerplate
|
||||
type realNATGateway NATGateway
|
||||
|
||||
func (o *NATGateway) UnmarshalJSON(data []byte) error {
|
||||
var jsonName string
|
||||
if err := json.Unmarshal(data, &jsonName); err == nil {
|
||||
o.Name = &jsonName
|
||||
return nil
|
||||
}
|
||||
|
||||
var r realNATGateway
|
||||
if err := json.Unmarshal(data, &r); err != nil {
|
||||
return err
|
||||
}
|
||||
*o = NATGateway(r)
|
||||
return nil
|
||||
}
|
||||
|
||||
var _ fi.HasName = &NATGateway{}
|
||||
|
||||
func (e *NATGateway) GetName() *string {
|
||||
return e.Name
|
||||
}
|
||||
|
||||
func (e *NATGateway) SetName(name string) {
|
||||
e.Name = &name
|
||||
}
|
||||
|
||||
func (e *NATGateway) String() string {
|
||||
return fi.TaskAsString(e)
|
||||
}
|
||||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=RouteTable"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=RouteTableAssociation"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=SecurityGroup"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=SecurityGroupRule"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=SSHKey"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=Subnet"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=VPC"; DO NOT EDIT
|
||||
|
||||
package awstasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=FirewallRule"; DO NOT EDIT
|
||||
|
||||
package gcetasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=Instance"; DO NOT EDIT
|
||||
|
||||
package gcetasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=InstanceTemplate"; DO NOT EDIT
|
||||
|
||||
package gcetasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=IPAddress"; DO NOT EDIT
|
||||
|
||||
package gcetasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=ManagedInstanceGroup"; DO NOT EDIT
|
||||
|
||||
package gcetasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=Network"; DO NOT EDIT
|
||||
|
||||
package gcetasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=PersistentDisk"; DO NOT EDIT
|
||||
|
||||
package gcetasks
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=Subnet"; DO NOT EDIT
|
||||
|
||||
package gcetasks
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package cloudup
|
||||
|
||||
import (
|
||||
|
|
@ -73,6 +74,17 @@ func PopulateClusterSpec(cluster *api.Cluster) (*api.Cluster, error) {
|
|||
return c.fullCluster, nil
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Here be dragons
|
||||
//
|
||||
// This function has some `interesting` things going on.
|
||||
// In an effort to let the cluster.Spec fall through I am
|
||||
// hard coding topology in two places.. It seems and feels
|
||||
// very wrong.. but at least now my new cluster.Spec.Topology
|
||||
// struct is falling through..
|
||||
// @kris-nova
|
||||
//
|
||||
func (c *populateClusterSpec) run() error {
|
||||
err := c.InputCluster.Validate(false)
|
||||
if err != nil {
|
||||
|
|
@ -248,9 +260,11 @@ func (c *populateClusterSpec) run() error {
|
|||
if err != nil {
|
||||
return fmt.Errorf("error building complete spec: %v", err)
|
||||
}
|
||||
// Hard coding topology here AGAIN
|
||||
|
||||
//
|
||||
completed.Spec.Topology = c.InputCluster.Spec.Topology
|
||||
//
|
||||
//
|
||||
completed.Topology = c.InputCluster.Spec.Topology
|
||||
|
||||
fullCluster := &api.Cluster{}
|
||||
*fullCluster = *cluster
|
||||
|
|
|
|||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=Keypair"; DO NOT EDIT
|
||||
|
||||
package fitasks
|
||||
|
|
|
|||
|
|
@ -0,0 +1,43 @@
|
|||
// Code generated by ""fitask" -type=ManagedFile"; DO NOT EDIT
|
||||
|
||||
package fitasks
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"k8s.io/kops/upup/pkg/fi"
|
||||
)
|
||||
|
||||
// ManagedFile
|
||||
|
||||
// JSON marshalling boilerplate
|
||||
type realManagedFile ManagedFile
|
||||
|
||||
func (o *ManagedFile) UnmarshalJSON(data []byte) error {
|
||||
var jsonName string
|
||||
if err := json.Unmarshal(data, &jsonName); err == nil {
|
||||
o.Name = &jsonName
|
||||
return nil
|
||||
}
|
||||
|
||||
var r realManagedFile
|
||||
if err := json.Unmarshal(data, &r); err != nil {
|
||||
return err
|
||||
}
|
||||
*o = ManagedFile(r)
|
||||
return nil
|
||||
}
|
||||
|
||||
var _ fi.HasName = &ManagedFile{}
|
||||
|
||||
func (e *ManagedFile) GetName() *string {
|
||||
return e.Name
|
||||
}
|
||||
|
||||
func (e *ManagedFile) SetName(name string) {
|
||||
e.Name = &name
|
||||
}
|
||||
|
||||
func (e *ManagedFile) String() string {
|
||||
return fi.TaskAsString(e)
|
||||
}
|
||||
|
|
@ -1,19 +1,3 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
// Code generated by ""fitask" -type=Secret"; DO NOT EDIT
|
||||
|
||||
package fitasks
|
||||
|
|
|
|||
Loading…
Reference in New Issue