From 57736d4a69ff6da50465346cef2d0e6b5df1c661 Mon Sep 17 00:00:00 2001 From: rmweir Date: Wed, 8 Jul 2020 16:30:31 -0700 Subject: [PATCH] Import eks-controller and add EKSConfig field --- apis/management.cattle.io/v3/cluster_types.go | 36 ++- go.mod | 1 + go.sum | 15 + .../pkg/apis/ke.cattle.io/v1/doc.go | 21 ++ .../pkg/apis/ke.cattle.io/v1/types.go | 76 +++++ .../ke.cattle.io/v1/zz_generated_deepcopy.go | 264 ++++++++++++++++++ .../v1/zz_generated_list_types.go | 42 +++ .../ke.cattle.io/v1/zz_generated_register.go | 60 ++++ .../ke.cattle.io/zz_generated_register.go | 24 ++ vendor/golang.org/x/net/http2/transport.go | 18 +- vendor/modules.txt | 5 +- 11 files changed, 546 insertions(+), 16 deletions(-) create mode 100644 vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/doc.go create mode 100644 vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/types.go create mode 100644 vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_deepcopy.go create mode 100644 vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_list_types.go create mode 100644 vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_register.go create mode 100644 vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/zz_generated_register.go diff --git a/apis/management.cattle.io/v3/cluster_types.go b/apis/management.cattle.io/v3/cluster_types.go index 1a6607bb..40157fd1 100644 --- a/apis/management.cattle.io/v3/cluster_types.go +++ b/apis/management.cattle.io/v3/cluster_types.go @@ -5,6 +5,7 @@ import ( "encoding/gob" "strings" + eksv1 "github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1" "github.com/rancher/norman/condition" "github.com/rancher/norman/types" "github.com/sirupsen/logrus" @@ -109,19 +110,20 @@ type ClusterSpecBase struct { type ClusterSpec struct { ClusterSpecBase - DisplayName string `json:"displayName" norman:"required"` - Description string `json:"description"` - Internal bool `json:"internal" norman:"nocreate,noupdate"` - K3sConfig *K3sConfig `json:"k3sConfig,omitempty"` - ImportedConfig *ImportedConfig `json:"importedConfig,omitempty" norman:"nocreate,noupdate"` - GoogleKubernetesEngineConfig *MapStringInterface `json:"googleKubernetesEngineConfig,omitempty"` - AzureKubernetesServiceConfig *MapStringInterface `json:"azureKubernetesServiceConfig,omitempty"` - AmazonElasticContainerServiceConfig *MapStringInterface `json:"amazonElasticContainerServiceConfig,omitempty"` - GenericEngineConfig *MapStringInterface `json:"genericEngineConfig,omitempty"` - ClusterTemplateName string `json:"clusterTemplateName,omitempty" norman:"type=reference[clusterTemplate],nocreate,noupdate"` - ClusterTemplateRevisionName string `json:"clusterTemplateRevisionName,omitempty" norman:"type=reference[clusterTemplateRevision]"` - ClusterTemplateAnswers Answer `json:"answers,omitempty"` - ClusterTemplateQuestions []Question `json:"questions,omitempty" norman:"nocreate,noupdate"` + DisplayName string `json:"displayName" norman:"required"` + Description string `json:"description"` + Internal bool `json:"internal" norman:"nocreate,noupdate"` + K3sConfig *K3sConfig `json:"k3sConfig,omitempty"` + ImportedConfig *ImportedConfig `json:"importedConfig,omitempty" norman:"nocreate,noupdate"` + GoogleKubernetesEngineConfig *MapStringInterface `json:"googleKubernetesEngineConfig,omitempty"` + AzureKubernetesServiceConfig *MapStringInterface `json:"azureKubernetesServiceConfig,omitempty"` + AmazonElasticContainerServiceConfig *MapStringInterface `json:"amazonElasticContainerServiceConfig,omitempty"` + GenericEngineConfig *MapStringInterface `json:"genericEngineConfig,omitempty"` + EKSConfig *eksv1.EKSClusterConfigSpec `json:"eksConfig,omitempty"` + ClusterTemplateName string `json:"clusterTemplateName,omitempty" norman:"type=reference[clusterTemplate],nocreate,noupdate"` + ClusterTemplateRevisionName string `json:"clusterTemplateRevisionName,omitempty" norman:"type=reference[clusterTemplateRevision]"` + ClusterTemplateAnswers Answer `json:"answers,omitempty"` + ClusterTemplateQuestions []Question `json:"questions,omitempty" norman:"nocreate,noupdate"` } type ImportedConfig struct { @@ -159,6 +161,7 @@ type ClusterStatus struct { CertificatesExpiration map[string]CertExpiration `json:"certificatesExpiration,omitempty"` ScheduledClusterScanStatus *ScheduledClusterScanStatus `json:"scheduledClusterScanStatus,omitempty"` CurrentCisRunName string `json:"currentCisRunName,omitempty"` + EKSStatus EKSStatus `json:"eksStatus,omitempty" norman:"nocreate,noupdate"` } type ClusterComponentStatus struct { @@ -329,3 +332,10 @@ type SaveAsTemplateOutput struct { ClusterTemplateName string `json:"clusterTemplateName,omitempty"` ClusterTemplateRevisionName string `json:"clusterTemplateRevisionName,omitempty"` } + +type EKSStatus struct { + GeneratedVirtualNetwork string `json:"generatedVirtualNetwork"` + GeneratedSubnets []string `json:"generatedSubnets"` + GeneratedSecurityGroups []string `json:"generatedSecurityGroups"` + GeneratedServiceRole string `json:"generatedServiceRole"` +} diff --git a/go.mod b/go.mod index dbbb6670..167bbd86 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( github.com/coreos/prometheus-operator v0.36.0 github.com/knative/pkg v0.0.0-20190817231834-12ee58e32cc8 github.com/pkg/errors v0.9.1 + github.com/rancher/eks-controller v0.1.0-rc7.0.20200708232505-85ce7a9575f5 github.com/rancher/lasso v0.0.0-20200515155337-a34e1e26ad91 github.com/rancher/norman v0.0.0-20200517050325-f53cae161640 github.com/rancher/wrangler v0.6.2-0.20200515155908-1923f3f8ec3f diff --git a/go.sum b/go.sum index 98acdac7..6d51cc71 100644 --- a/go.sum +++ b/go.sum @@ -71,6 +71,8 @@ github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgI github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= github.com/aws/aws-sdk-go v1.25.48/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.30.22 h1:wImJ8jQrplgmxaTeUY7FrJFn4te/VtWq+mmmJ1TnWAg= +github.com/aws/aws-sdk-go v1.30.22/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= @@ -230,6 +232,7 @@ github.com/go-openapi/validate v0.17.2/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+ github.com/go-openapi/validate v0.18.0/go.mod h1:Uh4HdOzKt19xGIGm1qHf/ofbX1YQ4Y+MYsct2VUrAJ4= github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA= github.com/go-openapi/validate v0.19.5/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= +github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gobuffalo/flect v0.1.5/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= @@ -355,6 +358,8 @@ github.com/influxdata/influxdb v1.7.7/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOpr github.com/jessevdk/go-flags v0.0.0-20180331124232-1c38ed7ad0cc/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= +github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= +github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901/go.mod h1:Z86h9688Y0wesXCyonoVr47MasHilkuLMqGhRZ4Hpak= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= @@ -533,6 +538,10 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/prometheus/prometheus v0.0.0-20180315085919-58e2a31db8de/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= github.com/prometheus/prometheus v1.8.2-0.20200107122003-4708915ac6ef/go.mod h1:7U90zPoLkWjEIQcy/rweQla82OCTUzxVHE51G3OhJbI= github.com/prometheus/prometheus v2.3.2+incompatible/go.mod h1:oAIUtOny2rjMX0OWN5vPR5/q/twIROJvdqnQKDdil/s= +github.com/rancher/eks-controller v0.1.0-rc7.0.20200708232505-85ce7a9575f5 h1:ycAR6w6vyoqbUEMBAyDCslaavVC3l8XXabeoDeT33Wc= +github.com/rancher/eks-controller v0.1.0-rc7.0.20200708232505-85ce7a9575f5/go.mod h1:Po3hJI25RHT+l52Qx/QkkiwjEFuHSKrq4ayBHXoK74g= +github.com/rancher/lasso v0.0.0-20200427171700-e0509f89f319/go.mod h1:6Dw19z1lDIpL887eelVjyqH/mna1hfR61ddCFOG78lw= +github.com/rancher/lasso v0.0.0-20200513231433-d0ce66327a25/go.mod h1:6Dw19z1lDIpL887eelVjyqH/mna1hfR61ddCFOG78lw= github.com/rancher/lasso v0.0.0-20200515155337-a34e1e26ad91 h1:p4VVl0tr6YAeUILFMCn+0DKzbUOS0ah9biSsL7Sy6S4= github.com/rancher/lasso v0.0.0-20200515155337-a34e1e26ad91/go.mod h1:G6Vv2aj6xB2YjTVagmu4NkhBvbE8nBcGykHRENH6arI= github.com/rancher/moq v0.0.0-20190404221404-ee5226d43009 h1:Xsxh7fX3+2wAUJtPy8g2lZh0cYuyifqhBL0vxCIYojs= @@ -541,8 +550,10 @@ github.com/rancher/norman v0.0.0-20200517050325-f53cae161640 h1:wZT4IWBeMfKewJ+Z github.com/rancher/norman v0.0.0-20200517050325-f53cae161640/go.mod h1:92rz/7QN7DOeLQZlJY/8aFBOmF085igIVguR0wpxLas= github.com/rancher/pkg v0.0.0-20190514055449-b30ab9de040e h1:j6+HqCET/NLPBtew2m5apL7jWw/PStQ7iGwXjgAqdvo= github.com/rancher/pkg v0.0.0-20190514055449-b30ab9de040e/go.mod h1:XbYHTPaXuw8ZY9bylhYKQh/nJxDaTKk3YhAxPl4Qy/k= +github.com/rancher/wrangler v0.6.2-0.20200427172034-da9b142ae061/go.mod h1:n5Du/gGD7WoiqnEo0SHnPirDIp1V9Zu+6guc8lXS2dk= github.com/rancher/wrangler v0.6.2-0.20200515155908-1923f3f8ec3f h1:QPOlhiY3YCPLsEtOmPam+ghtqip/f/zsfz4F4PF70D8= github.com/rancher/wrangler v0.6.2-0.20200515155908-1923f3f8ec3f/go.mod h1:NmtmlLkchboIksYJuBemwcP4RBfv8FpeyhVoWXB9Wdc= +github.com/rancher/wrangler-api v0.6.1-0.20200427172631-a7c2f09b783e/go.mod h1:2lcWR98q8HU3U4mVETnXc8quNG0uXxrt8vKd6cAa/30= github.com/rancher/wrangler-api v0.6.1-0.20200515193802-dcf70881b087 h1:+hiZFORh4fMvRSg5SIClz4y6nD5wkKLAdtPzjxyeHgs= github.com/rancher/wrangler-api v0.6.1-0.20200515193802-dcf70881b087/go.mod h1:s95VCVHV19b+EUo7BAwwe6nhaDx2/lHu91hxxDHbZs0= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -599,6 +610,8 @@ github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/thanos-io/thanos v0.10.1 h1:rVYzLyJcjV2cmvBzIw1kx96msKQ4uwyi+6edTHVUPwA= github.com/thanos-io/thanos v0.10.1/go.mod h1:usT/TxtJQ7DzinTt+G9kinDQmRS5sxwu0unVKZ9vdcw= github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk= @@ -709,6 +722,8 @@ golang.org/x/net v0.0.0-20191004110552-13f9640d40b9 h1:rjwSpXsdiK0dV8/Naq3kAw9ym golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191112182307-2180aed22343 h1:00ohfJ4K98s3m6BGUoBd8nyfp4Yl0GoIKvw5abItTjI= golang.org/x/net v0.0.0-20191112182307-2180aed22343/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= diff --git a/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/doc.go b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/doc.go new file mode 100644 index 00000000..86dec284 --- /dev/null +++ b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/doc.go @@ -0,0 +1,21 @@ +/* +Copyright 2019 Wrangler Sample Controller 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 main. DO NOT EDIT. + +// +k8s:deepcopy-gen=package +// +groupName=ke.cattle.io +package v1 diff --git a/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/types.go b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/types.go new file mode 100644 index 00000000..4eada8d6 --- /dev/null +++ b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/types.go @@ -0,0 +1,76 @@ +/* +Copyright 2017 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 v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +genclient +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +type EKSClusterConfig struct { + metav1.TypeMeta `json:",inline"` + metav1.ObjectMeta `json:"metadata,omitempty"` + + Spec EKSClusterConfigSpec `json:"spec"` + Status EKSClusterConfigStatus `json:"status"` +} + +// EKSClusterConfigSpec is the spec for a EKSClusterConfig resource +type EKSClusterConfigSpec struct { + KubernetesVersion string `json:"kubernetesVersion" norman:"required"` + Tags map[string]string `json:"tags"` + SecretsEncryption bool `json:"secretsEncryption" norman:"noupdate"` + KmsKey string `json:"kmsKey" norman:"noupdate"` + PublicAccess bool `json:"publicAccess" norman:"required"` + PrivateAccess bool `json:"privateAccess" norman:"required"` + PublicAccessSources []string `json:"publicAccessSources"` + LoggingTypes []string `json:"loggingTypes"` + CloudCredential string `json:"cloudCredential" norman:"required"` + DisplayName string `json:"displayName" norman:"required,noupdate"` + Subnets []string `json:"subnets" norman:"noupdate"` + SecurityGroups []string `json:"securityGroups" norman:"noupdate"` + ServiceRole string `json:"serviceRole" norman:"noupdate"` + Region string `json:"region" norman:"required,noupdate"` + Imported *bool `json:"imported,omitempty" norman:"noupdate"` + NodeGroups []NodeGroup `json:"nodeGroups"` +} + +type EKSClusterConfigStatus struct { + Phase string `json:"phase"` + GeneratedVirtualNetwork string `json:"generatedVirtualNetwork"` + GeneratedSubnets []string `json:"generatedSubnets"` + GeneratedSecurityGroups []string `json:"generatedSecurityGroups"` + FailureMessage string `json:"failureMessage"` +} + +type NodeGroup struct { + Gpu bool `json:"gpu"` + NodegroupName string `json:"nodegroupName" norman:"required"` + DiskSize *int64 `json:"diskSize"` + InstanceType *string `json:"instanceType" norman:"required"` + Labels map[string]*string `json:"labels"` + Ec2SshKey *string `json:"ec2SshKey"` + SourceSecurityGroups []*string `json:"sourceSecurityGroups"` + DesiredSize *int64 `json:"desiredSize"` + MaxSize *int64 `json:"maxSize"` + MinSize *int64 `json:"minSize"` + Subnets []string `json:"subnets"` + Tags map[string]*string `json:"tags"` + Version *string `json:"version"` +} diff --git a/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_deepcopy.go b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_deepcopy.go new file mode 100644 index 00000000..da98062b --- /dev/null +++ b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_deepcopy.go @@ -0,0 +1,264 @@ +// +build !ignore_autogenerated + +/* +Copyright 2019 Wrangler Sample Controller 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 main. DO NOT EDIT. + +package v1 + +import ( + runtime "k8s.io/apimachinery/pkg/runtime" +) + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSClusterConfig) DeepCopyInto(out *EKSClusterConfig) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSClusterConfig. +func (in *EKSClusterConfig) DeepCopy() *EKSClusterConfig { + if in == nil { + return nil + } + out := new(EKSClusterConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EKSClusterConfig) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSClusterConfigList) DeepCopyInto(out *EKSClusterConfigList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EKSClusterConfig, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSClusterConfigList. +func (in *EKSClusterConfigList) DeepCopy() *EKSClusterConfigList { + if in == nil { + return nil + } + out := new(EKSClusterConfigList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EKSClusterConfigList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSClusterConfigSpec) DeepCopyInto(out *EKSClusterConfigSpec) { + *out = *in + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + if in.PublicAccessSources != nil { + in, out := &in.PublicAccessSources, &out.PublicAccessSources + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.LoggingTypes != nil { + in, out := &in.LoggingTypes, &out.LoggingTypes + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.SecurityGroups != nil { + in, out := &in.SecurityGroups, &out.SecurityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Imported != nil { + in, out := &in.Imported, &out.Imported + *out = new(bool) + **out = **in + } + if in.NodeGroups != nil { + in, out := &in.NodeGroups, &out.NodeGroups + *out = make([]NodeGroup, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSClusterConfigSpec. +func (in *EKSClusterConfigSpec) DeepCopy() *EKSClusterConfigSpec { + if in == nil { + return nil + } + out := new(EKSClusterConfigSpec) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EKSClusterConfigStatus) DeepCopyInto(out *EKSClusterConfigStatus) { + *out = *in + if in.GeneratedSubnets != nil { + in, out := &in.GeneratedSubnets, &out.GeneratedSubnets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.GeneratedSecurityGroups != nil { + in, out := &in.GeneratedSecurityGroups, &out.GeneratedSecurityGroups + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EKSClusterConfigStatus. +func (in *EKSClusterConfigStatus) DeepCopy() *EKSClusterConfigStatus { + if in == nil { + return nil + } + out := new(EKSClusterConfigStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodeGroup) DeepCopyInto(out *NodeGroup) { + *out = *in + if in.DiskSize != nil { + in, out := &in.DiskSize, &out.DiskSize + *out = new(int64) + **out = **in + } + if in.InstanceType != nil { + in, out := &in.InstanceType, &out.InstanceType + *out = new(string) + **out = **in + } + if in.Labels != nil { + in, out := &in.Labels, &out.Labels + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Ec2SshKey != nil { + in, out := &in.Ec2SshKey, &out.Ec2SshKey + *out = new(string) + **out = **in + } + if in.SourceSecurityGroups != nil { + in, out := &in.SourceSecurityGroups, &out.SourceSecurityGroups + *out = make([]*string, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(string) + **out = **in + } + } + } + if in.DesiredSize != nil { + in, out := &in.DesiredSize, &out.DesiredSize + *out = new(int64) + **out = **in + } + if in.MaxSize != nil { + in, out := &in.MaxSize, &out.MaxSize + *out = new(int64) + **out = **in + } + if in.MinSize != nil { + in, out := &in.MinSize, &out.MinSize + *out = new(int64) + **out = **in + } + if in.Subnets != nil { + in, out := &in.Subnets, &out.Subnets + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Tags != nil { + in, out := &in.Tags, &out.Tags + *out = make(map[string]*string, len(*in)) + for key, val := range *in { + var outVal *string + if val == nil { + (*out)[key] = nil + } else { + in, out := &val, &outVal + *out = new(string) + **out = **in + } + (*out)[key] = outVal + } + } + if in.Version != nil { + in, out := &in.Version, &out.Version + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroup. +func (in *NodeGroup) DeepCopy() *NodeGroup { + if in == nil { + return nil + } + out := new(NodeGroup) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_list_types.go b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_list_types.go new file mode 100644 index 00000000..6672bd95 --- /dev/null +++ b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_list_types.go @@ -0,0 +1,42 @@ +/* +Copyright 2019 Wrangler Sample Controller 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 main. DO NOT EDIT. + +// +k8s:deepcopy-gen=package +// +groupName=ke.cattle.io +package v1 + +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +) + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EKSClusterConfigList is a list of EKSClusterConfig resources +type EKSClusterConfigList struct { + metav1.TypeMeta `json:",inline"` + metav1.ListMeta `json:"metadata"` + + Items []EKSClusterConfig `json:"items"` +} + +func NewEKSClusterConfig(namespace, name string, obj EKSClusterConfig) *EKSClusterConfig { + obj.APIVersion, obj.Kind = SchemeGroupVersion.WithKind("EKSClusterConfig").ToAPIVersionAndKind() + obj.Name = name + obj.Namespace = namespace + return &obj +} diff --git a/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_register.go b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_register.go new file mode 100644 index 00000000..ee7b6175 --- /dev/null +++ b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1/zz_generated_register.go @@ -0,0 +1,60 @@ +/* +Copyright 2019 Wrangler Sample Controller 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 main. DO NOT EDIT. + +// +k8s:deepcopy-gen=package +// +groupName=ke.cattle.io +package v1 + +import ( + ke "github.com/rancher/eks-controller/pkg/apis/ke.cattle.io" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/runtime/schema" +) + +var ( + EKSClusterConfigResourceName = "eksclusterconfigs" +) + +// SchemeGroupVersion is group version used to register these objects +var SchemeGroupVersion = schema.GroupVersion{Group: ke.GroupName, Version: "v1"} + +// Kind takes an unqualified kind and returns back a Group qualified GroupKind +func Kind(kind string) schema.GroupKind { + return SchemeGroupVersion.WithKind(kind).GroupKind() +} + +// Resource takes an unqualified resource and returns a Group qualified GroupResource +func Resource(resource string) schema.GroupResource { + return SchemeGroupVersion.WithResource(resource).GroupResource() +} + +var ( + SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) + AddToScheme = SchemeBuilder.AddToScheme +) + +// Adds the list of known types to Scheme. +func addKnownTypes(scheme *runtime.Scheme) error { + scheme.AddKnownTypes(SchemeGroupVersion, + &EKSClusterConfig{}, + &EKSClusterConfigList{}, + ) + metav1.AddToGroupVersion(scheme, SchemeGroupVersion) + return nil +} diff --git a/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/zz_generated_register.go b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/zz_generated_register.go new file mode 100644 index 00000000..b534e140 --- /dev/null +++ b/vendor/github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/zz_generated_register.go @@ -0,0 +1,24 @@ +/* +Copyright 2019 Wrangler Sample Controller 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 main. DO NOT EDIT. + +package ke + +const ( + // Package-wide consts from generator "zz_generated_register". + GroupName = "ke.cattle.io" +) diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 42ad1814..d948e96e 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -93,7 +93,7 @@ type Transport struct { // send in the initial settings frame. It is how many bytes // of response headers are allowed. Unlike the http2 spec, zero here // means to use a default limit (currently 10MB). If you actually - // want to advertise an ulimited value to the peer, Transport + // want to advertise an unlimited value to the peer, Transport // interprets the highest possible value here (0xffffffff or 1<<32-1) // to mean no limit. MaxHeaderListSize uint32 @@ -227,6 +227,7 @@ type ClientConn struct { br *bufio.Reader fr *Framer lastActive time.Time + lastIdle time.Time // time last idle // Settings from peer: (also guarded by mu) maxFrameSize uint32 maxConcurrentStreams uint32 @@ -736,7 +737,8 @@ func (cc *ClientConn) idleStateLocked() (st clientConnIdleState) { } st.canTakeNewRequest = cc.goAway == nil && !cc.closed && !cc.closing && maxConcurrentOkay && - int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 + int64(cc.nextStreamID)+2*int64(cc.pendingRequests) < math.MaxInt32 && + !cc.tooIdleLocked() st.freshConn = cc.nextStreamID == 1 && st.canTakeNewRequest return } @@ -746,6 +748,16 @@ func (cc *ClientConn) canTakeNewRequestLocked() bool { return st.canTakeNewRequest } +// tooIdleLocked reports whether this connection has been been sitting idle +// for too much wall time. +func (cc *ClientConn) tooIdleLocked() bool { + // The Round(0) strips the monontonic clock reading so the + // times are compared based on their wall time. We don't want + // to reuse a connection that's been sitting idle during + // VM/laptop suspend if monotonic time was also frozen. + return cc.idleTimeout != 0 && !cc.lastIdle.IsZero() && time.Since(cc.lastIdle.Round(0)) > cc.idleTimeout +} + // onIdleTimeout is called from a time.AfterFunc goroutine. It will // only be called when we're idle, but because we're coming from a new // goroutine, there could be a new request coming in at the same time, @@ -1150,6 +1162,7 @@ func (cc *ClientConn) awaitOpenSlotForRequest(req *http.Request) error { } return errClientConnUnusable } + cc.lastIdle = time.Time{} if int64(len(cc.streams))+1 <= int64(cc.maxConcurrentStreams) { if waitingForConn != nil { close(waitingForConn) @@ -1638,6 +1651,7 @@ func (cc *ClientConn) streamByID(id uint32, andRemove bool) *clientStream { delete(cc.streams, id) if len(cc.streams) == 0 && cc.idleTimer != nil { cc.idleTimer.Reset(cc.idleTimeout) + cc.lastIdle = time.Now() } close(cs.done) // Wake up checkResetOrDone via clientStream.awaitFlowControl and diff --git a/vendor/modules.txt b/vendor/modules.txt index 5f5d1a9f..28ba983d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -68,6 +68,9 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util +# github.com/rancher/eks-controller v0.1.0-rc7.0.20200708232505-85ce7a9575f5 +github.com/rancher/eks-controller/pkg/apis/ke.cattle.io +github.com/rancher/eks-controller/pkg/apis/ke.cattle.io/v1 # github.com/rancher/lasso v0.0.0-20200515155337-a34e1e26ad91 github.com/rancher/lasso/pkg/cache github.com/rancher/lasso/pkg/client @@ -121,7 +124,7 @@ github.com/sirupsen/logrus github.com/spf13/pflag # golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 golang.org/x/crypto/ssh/terminal -# golang.org/x/net v0.0.0-20191112182307-2180aed22343 +# golang.org/x/net v0.0.0-20200202094626-16171245cfb2 golang.org/x/net/context golang.org/x/net/context/ctxhttp golang.org/x/net/http/httpguts