Merge pull request #9632 from johngmyers/gengo

Replace custom codegen package with gengo
This commit is contained in:
Kubernetes Prow Robot 2020-07-28 22:11:46 -07:00 committed by GitHub
commit 67966d5288
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
236 changed files with 6774 additions and 866 deletions

View File

@ -161,14 +161,8 @@ upup/models/bindata.go: ${UPUP_MODELS_BINDATA_SOURCES}
.PHONY: codegen
codegen: kops-gobindata
go install k8s.io/kops/upup/tools/generators/...
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/awstasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/gcetasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/dotasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/openstacktasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/alitasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/cloudup/spotinsttasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/assettasks
PATH="${GOPATH_1ST}/bin:${PATH}" go generate k8s.io/kops/upup/pkg/fi/fitasks
${GOPATH_1ST}/bin/fitask --input-dirs k8s.io/kops/upup/pkg/fi/... \
--go-header-file "hack/boilerplate/boilerplate.go.txt"
.PHONY: protobuf
protobuf:

2
go.mod
View File

@ -114,8 +114,10 @@ require (
k8s.io/client-go v0.18.1
k8s.io/cloud-provider-openstack v1.17.0
k8s.io/component-base v0.18.1
k8s.io/gengo v0.0.0-20200710205751-c0d492a0f3ca
k8s.io/helm v2.9.0+incompatible
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.0.0
k8s.io/kubectl v0.0.0
k8s.io/legacy-cloud-providers v0.0.0
k8s.io/utils v0.0.0-20200324210504-a9aa75ae1b89

7
go.sum
View File

@ -370,6 +370,8 @@ github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ=
github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
@ -1017,6 +1019,7 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191203134012-c197fd4bf371 h1:Cjq6sG3gnKDchzWy7ouGQklhxMtWvh4AhSNJ0qGIeo4=
golang.org/x/tools v0.0.0-20191203134012-c197fd4bf371/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f h1:JcoF/bowzCDI+MXu1yLqQGNO3ibqWsWq+Sk7pOT218w=
golang.org/x/tools v0.0.0-20200626171337-aa94e735be7f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
@ -1142,6 +1145,8 @@ k8s.io/gengo v0.0.0-20190822140433-26a664648505 h1:ZY6yclUKVbZ+SdWnkfY+Je5vrMpKO
k8s.io/gengo v0.0.0-20190822140433-26a664648505/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200114144118-36b2048a9120 h1:RPscN6KhmG54S33L+lr3GS+oD1jmchIU0ll519K6FA4=
k8s.io/gengo v0.0.0-20200114144118-36b2048a9120/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
k8s.io/gengo v0.0.0-20200710205751-c0d492a0f3ca h1:/o8XeHsWWmi4lTKp3uxWAZY7Eq/v1HelCDmrKZM4SVQ=
k8s.io/gengo v0.0.0-20200710205751-c0d492a0f3ca/go.mod h1:aG2eeomYfcUw8sE3fa7YdkjgnGtyY56TjZlaJJ0ZoWo=
k8s.io/heapster v1.2.0-beta.1/go.mod h1:h1uhptVXMwC8xtZBYsPXKVi8fpdlYkTs6k949KozGrM=
k8s.io/helm v2.9.0+incompatible h1:3EFDJoqKSUe1BpC9qP+YaHi2Oua9hFT+C24/LhX2G1g=
k8s.io/helm v2.9.0+incompatible/go.mod h1:LZzlS4LQBHfciFOurYBFkCMTaZ0D1l+p0teMg7TSULI=
@ -1151,6 +1156,8 @@ k8s.io/klog v0.3.1 h1:RVgyDHY/kFKtLqh67NvEWIgkMneNoIrdkN0CxDSQc68=
k8s.io/klog v0.3.1/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk=
k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8=
k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I=
k8s.io/klog/v2 v2.0.0 h1:Foj74zO6RbjjP4hBEKjnYtjjAhGg4jNynUdYF6fJrok=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/kube-aggregator v0.18.1/go.mod h1:cXwR5+w/IZ/6tbDGFz3aEYrZctFN9R3X6u0gUcWwVzA=
k8s.io/kube-controller-manager v0.18.1/go.mod h1:HFp15+aGPbGns4K9jD9TxJVuc9eeiylCtjgCunRV3B4=
k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a h1:UcxjrRMyNx/i/y8G7kPvLyy7rfbeuf1PYyBf973pgyU=

View File

@ -165,7 +165,6 @@ k8s.io/kops/upup/pkg/fi/cloudup/aliup
k8s.io/kops/upup/pkg/fi/cloudup/awstasks
k8s.io/kops/upup/pkg/fi/cloudup/awsup
k8s.io/kops/upup/pkg/fi/cloudup/cloudformation
k8s.io/kops/upup/pkg/fi/cloudup/dnstasks
k8s.io/kops/upup/pkg/fi/cloudup/do
k8s.io/kops/upup/pkg/fi/cloudup/dotasks
k8s.io/kops/upup/pkg/fi/cloudup/gce
@ -185,7 +184,6 @@ k8s.io/kops/upup/pkg/fi/secrets
k8s.io/kops/upup/pkg/fi/utils
k8s.io/kops/upup/pkg/kutil
k8s.io/kops/upup/tools/generators/fitask
k8s.io/kops/upup/tools/generators/pkg/codegen
k8s.io/kops/util/pkg/architectures
k8s.io/kops/util/pkg/env
k8s.io/kops/util/pkg/exec

View File

@ -25,7 +25,7 @@ import (
// CopyDockerImage copies a docker image from a source registry, to a target registry,
// typically used for highly secure clusters.
//go:generate fitask -type=CopyDockerImage
// +kops:fitask
type CopyDockerImage struct {
Name *string
SourceImage *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=CopyDockerImage"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package assettasks

View File

@ -32,7 +32,7 @@ import (
// CopyFile copies an from a source file repository, to a target repository,
// typically used for highly secure clusters.
//go:generate fitask -type=CopyFile
// +kops:fitask
type CopyFile struct {
Name *string
SourceFile *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=CopyFile"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package assettasks

View File

@ -28,13 +28,13 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
// Disk represents a ALI Cloud Disk
//go:generate fitask -type=Disk
const (
DiskResource = "disk"
DiskType = ecs.DiskTypeAllData
)
// Disk represents an ALI Cloud Disk.
// +kops:fitask
type Disk struct {
Lifecycle *fi.Lifecycle
Name *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=Disk"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=EIP"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -31,7 +31,7 @@ const (
NatType = "Nat"
)
//go:generate fitask -type=EIP
// +kops:fitask
type EIP struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -36,8 +36,6 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=LaunchConfiguration
const dateFormat = "2006-01-02T15:04Z"
// defaultRetainLaunchConfigurationCount is the number of launch configurations (matching the name prefix) that we should
@ -53,6 +51,7 @@ func RetainLaunchConfigurationCount() int {
}
// LaunchConfiguration is the specification for a launch configuration
// +kops:fitask
type LaunchConfiguration struct {
Lifecycle *fi.Lifecycle
ID *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=LaunchConfiguration"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -30,8 +30,7 @@ import (
)
// LoadBalancer represents a ALI Cloud LoadBalancer
//go:generate fitask -type=LoadBalancer
// +kops:fitask
type LoadBalancer struct {
Name *string
LoadbalancerId *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=LoadBalancer"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -30,6 +30,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
// +kops:fitask
type LoadBalancerACL struct {
ID *string
Name *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=LoadBalancerACL"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -30,7 +30,7 @@ import (
const ListenerRunningStatus = "running"
//go:generate fitask -type=LoadBalancerListener
// +kops:fitask
type LoadBalancerListener struct {
LoadBalancer *LoadBalancer
Name *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=LoadBalancerListener"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -27,7 +27,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=NatGateway
// +kops:fitask
type NatGateway struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=NatGateway"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -29,8 +29,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=RAMPolicy
// +kops:fitask
type RAMPolicy struct {
Lifecycle *fi.Lifecycle
Name *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=RAMPolicy"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -29,8 +29,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=RAMRole
// +kops:fitask
type RAMRole struct {
ID *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=RAMRole"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -30,8 +30,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=ScalingGroup
// +kops:fitask
type ScalingGroup struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=ScalingGroup"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -29,9 +29,9 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=SecurityGroup
const SecurityResource = "securitygroup"
// +kops:fitask
type SecurityGroup struct {
Name *string
SecurityGroupId *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=SecurityGroup"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -29,8 +29,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=SecurityGroupRule
// +kops:fitask
type SecurityGroupRule struct {
Name *string
IpProtocol *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=SecurityGroupRule"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -30,7 +30,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=SSHKey
// +kops:fitask
type SSHKey struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=SSHKey"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -27,7 +27,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=VPC
// +kops:fitask
type VPC struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=VPC"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -28,7 +28,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=VSwitch
// +kops:fitask
type VSwitch struct {
Name *string
VSwitchId *string

View File

@ -28,7 +28,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=VSwitchSNAT
// +kops:fitask
type VSwitchSNAT struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=VSwitch"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=VSwitchSNAT"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package alitasks

View File

@ -39,6 +39,7 @@ import (
const CloudTagInstanceGroupRolePrefix = "k8s.io/role/"
// AutoscalingGroup provdes the definition for a autoscaling group in aws
// +kops:fitask
type AutoscalingGroup struct {
// Name is the name of the ASG
Name *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=AutoscalingGroup"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -30,7 +30,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=DHCPOptions
// +kops:fitask
type DHCPOptions struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=DHCPOptions"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -30,7 +30,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=DNSName
// +kops:fitask
type DNSName struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=DNSName"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -34,7 +34,7 @@ import (
)
// DNSZone is a zone object in a dns provider
//go:generate fitask -type=DNSZone
// +kops:fitask
type DNSZone struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=DNSZone"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -28,7 +28,7 @@ import (
"k8s.io/klog"
)
//go:generate fitask -type=EBSVolume
// +kops:fitask
type EBSVolume struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=EBSVolume"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -29,9 +29,8 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=ElasticIP
// ElasticIP manages an AWS Address (ElasticIP)
// +kops:fitask
type ElasticIP struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=ElasticIP"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -28,7 +28,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=ExternalLoadBalancerAttachment
// +kops:fitask
type ExternalLoadBalancerAttachment struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -29,7 +29,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=ExternalTargetGroupAttachment
// +kops:fitask
type ExternalTargetGroupAttachment struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=ExternalLoadBalancerAttachment"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=ExternalTargetGroupAttachment"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -31,7 +31,7 @@ import (
"k8s.io/klog"
)
//go:generate fitask -type=IAMInstanceProfile
// +kops:fitask
type IAMInstanceProfile struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=IAMInstanceProfile"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -29,7 +29,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=IAMInstanceProfileRole
// +kops:fitask
type IAMInstanceProfileRole struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=IAMInstanceProfileRole"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -29,7 +29,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=IAMOIDCProvider
// +kops:fitask
type IAMOIDCProvider struct {
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=IAMOIDCProvider ."; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -35,7 +35,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=IAMRole
// +kops:fitask
type IAMRole struct {
ID *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=IAMRole"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -34,7 +34,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=IAMRolePolicy
// +kops:fitask
type IAMRolePolicy struct {
ID *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=IAMRolePolicy"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -34,6 +34,7 @@ import (
const MaxUserDataSize = 16384
// Instance defines the instance specification
// +kops:fitask
type Instance struct {
ID *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=Instance"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -27,7 +27,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=InternetGateway
// +kops:fitask
type InternetGateway struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=InternetGateway"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -51,6 +51,7 @@ func RetainLaunchConfigurationCount() int {
}
// LaunchConfiguration is the specification for a launch configuration
// +kops:fitask
type LaunchConfiguration struct {
// Name is the name of the configuration
Name *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=LaunchConfiguration"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -36,7 +36,7 @@ import (
// LoadBalancer manages an ELB. We find the existing ELB using the Name tag.
//go:generate fitask -type=LoadBalancer
// +kops:fitask
type LoadBalancer struct {
// We use the Name tag to find the existing ELB, because we are (more or less) unrestricted when
// it comes to tag values, but the LoadBalancerName is length limited

View File

@ -29,7 +29,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=LoadBalancerAttachment
// +kops:fitask
type LoadBalancerAttachment struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=LoadBalancer"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=LoadBalancerAttachment"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -29,7 +29,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=NatGateway
// +kops:fitask
type NatGateway struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=NatGateway"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -28,7 +28,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=Route
// +kops:fitask
type Route struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=Route"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -28,7 +28,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=RouteTable
// +kops:fitask
type RouteTable struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=RouteTable"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -28,7 +28,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=RouteTableAssociation
// +kops:fitask
type RouteTableAssociation struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=RouteTableAssociation"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -30,7 +30,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=SecurityGroup
// +kops:fitask
type SecurityGroup struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=SecurityGroup"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -31,7 +31,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=SecurityGroupRule
// +kops:fitask
type SecurityGroupRule struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=SecurityGroupRule"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -31,7 +31,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=SSHKey
// +kops:fitask
type SSHKey struct {
ID *string
Name *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=SSHKey"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -29,7 +29,7 @@ import (
"k8s.io/kops/upup/pkg/fi/utils"
)
//go:generate fitask -type=Subnet
// +kops:fitask
type Subnet struct {
Name *string

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=Subnet"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -30,7 +30,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=VPC
// +kops:fitask
type VPC struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -27,7 +27,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=VPCDHCPOptionsAssociation
// +kops:fitask
type VPCDHCPOptionsAssociation struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=VPC"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -26,7 +26,7 @@ import (
"k8s.io/kops/upup/pkg/fi/cloudup/terraform"
)
//go:generate fitask -type=VPCCIDRBlock
// +kops:fitask
type VPCCIDRBlock struct {
Name *string
Lifecycle *fi.Lifecycle

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=VPCCIDRBlock"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -1,5 +1,7 @@
// +build !ignore_autogenerated
/*
Copyright 2019 The Kubernetes Authors.
Copyright 2020 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.
@ -14,7 +16,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by ""fitask" -type=VPCDHCPOptionsAssociation"; DO NOT EDIT
// Code generated by fitask. DO NOT EDIT.
package awstasks

View File

@ -1,13 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["dnszone.go"],
importpath = "k8s.io/kops/upup/pkg/fi/cloudup/dnstasks",
visibility = ["//visibility:public"],
deps = [
"//dnsprovider/pkg/dnsprovider:go_default_library",
"//upup/pkg/fi:go_default_library",
"//vendor/k8s.io/klog:go_default_library",
],
)

View File

@ -1,129 +0,0 @@
/*
Copyright 2019 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.
*/
package dnstasks
import (
"fmt"
"strings"
"k8s.io/klog"
"k8s.io/kops/dnsprovider/pkg/dnsprovider"
"k8s.io/kops/upup/pkg/fi"
)
// DNSZone is a zone object in a dns provider
//go:generate fitask -type=DNSZone
type DNSZone struct {
Name *string
ID *string
}
var _ fi.CompareWithID = &DNSZone{}
func (e *DNSZone) CompareWithID() *string {
return e.Name
}
func (e *DNSZone) Find(c *fi.Context) (*DNSZone, error) {
dns := c.DNS
z, err := e.findExisting(dns)
if err != nil {
return nil, err
}
if z == nil {
return nil, nil
}
actual := &DNSZone{}
actual.Name = e.Name
actual.ID = fi.String(z.Name())
if e.ID == nil {
e.ID = actual.ID
}
return actual, nil
}
func (e *DNSZone) findExisting(dns dnsprovider.Interface) (dnsprovider.Zone, error) {
findName := fi.StringValue(e.Name)
if findName == "" {
return nil, nil
}
if !strings.HasSuffix(findName, ".") {
findName += "."
}
zonesProvider, ok := dns.Zones()
if !ok {
return nil, fmt.Errorf("DNS provider does not support zones")
}
// TODO: Support filtering!
zones, err := zonesProvider.List()
if err != nil {
return nil, fmt.Errorf("error listing DNS zones: %v", err)
}
for _, zone := range zones {
if zone.Name() == findName {
zones = append(zones, zone)
}
}
if len(zones) == 0 {
return nil, nil
}
if len(zones) != 1 {
return nil, fmt.Errorf("found multiple hosted zones matching name %q", findName)
}
return zones[0], nil
}
func (e *DNSZone) Run(c *fi.Context) error {
return fi.DefaultDeltaRunMethod(e, c)
}
func (s *DNSZone) CheckChanges(a, e, changes *DNSZone) error {
if fi.StringValue(e.Name) == "" {
return fi.RequiredField("Name")
}
return nil
}
func (_ *DNSZone) Render(c *fi.Context, a, e, changes *DNSZone) error {
dns := c.DNS
zonesProvider, ok := dns.Zones()
if !ok {
return fmt.Errorf("DNS provider does not support zones")
}
if a == nil {
name := fi.StringValue(e.Name)
klog.V(2).Infof("Creating DNS Zone with Name %q", name)
zone, err := zonesProvider.New(name)
if err != nil {
return fmt.Errorf("error creating DNS Zone %q: %v", name, err)
}
e.ID = fi.String(zone.Name())
}
return nil
}

Some files were not shown because too many files have changed in this diff Show More