diff --git a/Makefile b/Makefile index e18287e9f..7d2091b75 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ commitSHA := $(shell git describe --dirty --always) dateStr := $(shell date +%s) +repo ?= github.com/awslab/aws-service-operator .PHONY: build build: @@ -13,6 +14,10 @@ release: dev-release: goreleaser --rm-dist --snapshot --skip-publish +.PHONY: test +test: + go test -v -cover -race $(repo)/... + .PHONY: tag tag: git tag -a ${VERSION} -s diff --git a/cmd/aws-service-operator/main.go b/cmd/aws-service-operator/main.go index 065b0d3b6..f63db91b6 100644 --- a/cmd/aws-service-operator/main.go +++ b/cmd/aws-service-operator/main.go @@ -2,10 +2,11 @@ package main import ( "fmt" - homedir "github.com/mitchellh/go-homedir" - + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/ec2metadata" + "github.com/aws/aws-sdk-go/aws/session" "github.com/awslabs/aws-service-operator/pkg/config" - + homedir "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" "github.com/spf13/viper" "os" @@ -13,14 +14,14 @@ import ( ) var ( - // cfgFile, kubeConfig, awsRegion all help support passed in flags into the server - cfgFile, kubeconfig, awsRegion, logLevel, logFile, resources, clusterName, bucket, accountID string + // cfgFile, masterURL, kubeConfig, awsRegion all help support passed in flags into the server + cfgFile, masterURL, kubeconfig, awsRegion, logLevel, logFile, resources, clusterName, bucket, accountID string // rootCmd represents the base command when called without any subcommands rootCmd = &cobra.Command{ Use: "aws-operator", Short: "AWS Operator manages your AWS Infrastructure using CRDs and Operators", - Long: `AWS Operator manages your AWS Infrastructure using CRDs and Operators. + Long: `AWS Operator manages your AWS Infrastructure using CRDs and Operators. With a single manifest file you can now model both the application and the resource necessary to run it.`, Run: func(c *cobra.Command, _ []string) { c.Help() @@ -39,16 +40,18 @@ func main() { func init() { rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "f", "Config file (default is $HOME/.aws-operator.yaml)") + rootCmd.PersistentFlags().StringVarP(&masterURL, "master-url", "u", "", "The address of the Kubernetes API server. Overrides any value in kubeconfig.") rootCmd.PersistentFlags().StringVarP(&kubeconfig, "kubeconfig", "k", "", "Path to local kubeconfig file (mainly used for development)") rootCmd.PersistentFlags().StringVarP(&awsRegion, "region", "r", "us-west-2", "AWS Region for resources to be created in") rootCmd.PersistentFlags().StringVarP(&logLevel, "loglevel", "l", "Info", "Log level for the CLI") rootCmd.PersistentFlags().StringVarP(&logFile, "logfile", "", "", "Log level for the CLI") - rootCmd.PersistentFlags().StringVarP(&resources, "resources", "", "s3bucket,dynamodb", "Comma delimited list of CRDs to deploy") + rootCmd.PersistentFlags().StringVarP(&resources, "resources", "", "cloudformationtemplates,dynamodb,ecrrepository,s3bucket,snssubscription,snstopic,sqsqueue", "Comma delimited list of CRDs to deploy") rootCmd.PersistentFlags().StringVarP(&clusterName, "cluster-name", "i", "aws-operator", "Cluster name for the Application to run as, used to label the Cloudformation templated to avoid conflict") rootCmd.PersistentFlags().StringVarP(&bucket, "bucket", "b", "aws-operator", "To configure the operator you need a base bucket to contain the resources") rootCmd.PersistentFlags().StringVarP(&accountID, "account-id", "a", "", "AWS Account ID, this is used to configure outputs and operate on the proper account.") viper.BindPFlag("config", rootCmd.PersistentFlags().Lookup("config")) + viper.BindPFlag("masterurl", rootCmd.PersistentFlags().Lookup("master-url")) viper.BindPFlag("kubeconfig", rootCmd.PersistentFlags().Lookup("kubeconfig")) viper.BindPFlag("region", rootCmd.PersistentFlags().Lookup("region")) viper.BindPFlag("loglevel", rootCmd.PersistentFlags().Lookup("loglevel")) @@ -83,22 +86,47 @@ func initConfig() { } } -func getConfig() (*config.Config, error) { - resourcesList := strings.Split(resources, ",") - config := &config.Config{ +func getConfig() (c *config.Config, err error) { + resourcesMap := map[string]bool{} + for _, r := range strings.Split(resources, ",") { + resourcesMap[r] = true + } + + ec2Session, err := session.NewSession() + metadata := ec2metadata.New(ec2Session) + if awsRegion == "" { + awsRegion, err = metadata.Region() + if err != nil { + return nil, err + } + } + + sess, err := session.NewSession(&aws.Config{Region: aws.String(awsRegion)}) + if err != nil { + return nil, err + } + + c = &config.Config{ Region: awsRegion, Kubeconfig: kubeconfig, + MasterURL: masterURL, + AWSSession: sess, LoggingConfig: &config.LoggingConfig{ File: logFile, Level: logLevel, FullTimestamps: true, DisableTimestamps: false, }, - Resources: resourcesList, + Resources: resourcesMap, ClusterName: clusterName, Bucket: bucket, AccountID: accountID, } - return config, nil + err = c.CreateContext(masterURL, kubeconfig) + if err != nil { + return nil, err + } + + return c, nil } diff --git a/code-generation/pkg/codegen/assets/aws-service-operator.yaml.templ b/code-generation/pkg/codegen/assets/aws-service-operator.yaml.templ index 5d78cc687..0b9b43c2b 100644 --- a/code-generation/pkg/codegen/assets/aws-service-operator.yaml.templ +++ b/code-generation/pkg/codegen/assets/aws-service-operator.yaml.templ @@ -26,7 +26,7 @@ items: - {{$elem.Name}} {{- end}} singular: {{$element.Spec.Resource.Plural}} - scope: Namespaced + scope: {{$element.Spec.Resource.Scope}} version: v1alpha1 {{end}} - kind: ClusterRole diff --git a/code-generation/pkg/codegen/assets/base.go.templ b/code-generation/pkg/codegen/assets/base.go.templ index e8c97a009..58db93fda 100644 --- a/code-generation/pkg/codegen/assets/base.go.templ +++ b/code-generation/pkg/codegen/assets/base.go.templ @@ -2,8 +2,6 @@ package base import ( "github.com/awslabs/aws-service-operator/pkg/config" - opkit "github.com/christopherhein/operator-kit" - awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1" {{- range $index, $element := .Items}} "github.com/awslabs/aws-service-operator/pkg/operators/{{$element.Spec.Resource.Name}}" {{- end}} @@ -11,29 +9,25 @@ import ( type base struct { config *config.Config - context *opkit.Context - awsClientset awsclient.ServiceoperatorV1alpha1Interface } func New( config *config.Config, - context *opkit.Context, - awsClientset awsclient.ServiceoperatorV1alpha1Interface, ) *base { return &base{ config: config, - context: context, - awsClientset: awsClientset, } } func (b *base) Watch(namespace string, stopCh chan struct{}) (err error) { {{- range $index, $element := .Items}} - {{$element.Spec.Resource.Name}}operator := {{$element.Spec.Resource.Name}}.NewOperator(b.config, b.context, b.awsClientset) - err = {{$element.Spec.Resource.Name}}operator.StartWatch(namespace, stopCh) - if err != nil { - return err - } + if b.config.Resources["{{$element.Spec.Resource.Name}}"] { + {{$element.Spec.Resource.Name}}operator := {{$element.Spec.Resource.Name}}.NewOperator(b.config) + err = {{$element.Spec.Resource.Name}}operator.StartWatch(namespace, stopCh) + if err != nil { + return err + } + } {{- end}} return nil diff --git a/code-generation/pkg/codegen/assets/operator.go.templ b/code-generation/pkg/codegen/assets/operator.go.templ index 61f9c4211..48ae4a120 100644 --- a/code-generation/pkg/codegen/assets/operator.go.templ +++ b/code-generation/pkg/codegen/assets/operator.go.templ @@ -9,8 +9,8 @@ import ( {{- if .Spec.IsCustomized}} metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/awslabs/aws-service-operator/pkg/helpers" - {{- end}} "reflect" + {{- end}} "github.com/awslabs/aws-service-operator/pkg/config" {{- if .Spec.Queue}} @@ -18,50 +18,27 @@ import ( corev1 "k8s.io/api/core/v1" "github.com/iancoleman/strcase" "strings" + awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1" {{- end}} - opkit "github.com/christopherhein/operator-kit" - apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" + "github.com/awslabs/aws-service-operator/pkg/operator" "k8s.io/client-go/tools/cache" - awsapi "github.com/awslabs/aws-service-operator/pkg/apis/service-operator.aws" awsV1alpha1 "github.com/awslabs/aws-service-operator/pkg/apis/service-operator.aws/v1alpha1" - awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1" {{- if .Spec.Customizations.Package}} "{{.Spec.Customizations.Package}}" {{- end}} ) -// Resource is the object store definition -var Resource = opkit.CustomResource{ - Name: "{{.Spec.Resource.Name}}", - Plural: "{{.Spec.Resource.Plural}}", - Group: awsapi.GroupName, - Version: awsapi.Version, - Scope: apiextensionsv1beta1.NamespaceScoped, - Kind: reflect.TypeOf(awsV1alpha1.{{.Spec.Kind}}{}).Name(), - ShortNames: []string{ -{{- if .Spec.Resource.Shortnames -}} - {{- range .Spec.Resource.Shortnames }} - "{{.Name}}", - {{- end}} -{{- end}} - }, -} - // Operator represents a controller object for object store custom resources type Operator struct { config *config.Config - context *opkit.Context - awsclientset awsclient.ServiceoperatorV1alpha1Interface topicARN string } // NewOperator create controller for watching object store custom resources created -func NewOperator(config *config.Config, context *opkit.Context, awsclientset awsclient.ServiceoperatorV1alpha1Interface) *Operator { +func NewOperator(config *config.Config) *Operator { return &Operator{ config: config, - context: context, - awsclientset: awsclientset, } } @@ -73,14 +50,13 @@ func (c *Operator) StartWatch(namespace string, stopCh chan struct{}) error { DeleteFunc: c.onDelete, } {{- if .Spec.Queue}} - queuectrl := queue.New(c.config, c.context, c.awsclientset, 1) + queuectrl := queue.New(c.config, c.config.AWSClientset, 1) c.topicARN, _, _, _ = queuectrl.Register("{{.Spec.Resource.Name}}", &awsV1alpha1.{{.Spec.Kind}}{}) go queuectrl.StartWatch(queue.HandlerFunc(QueueUpdater), stopCh) {{- end}} - restClient := c.awsclientset.RESTClient() - watcher := opkit.NewWatcher(Resource, namespace, resourceHandlers, restClient) - go watcher.Watch(&awsV1alpha1.{{.Spec.Kind}}{}, stopCh) + oper := operator.New("{{.Spec.Resource.Plural}}", namespace, resourceHandlers, c.config.AWSClientset.RESTClient()) + go oper.Watch(&awsV1alpha1.{{.Spec.Kind}}{}, stopCh) return nil } diff --git a/code-generation/pkg/codegen/templates.go b/code-generation/pkg/codegen/templates.go index 27543ce91..0aa01791c 100644 --- a/code-generation/pkg/codegen/templates.go +++ b/code-generation/pkg/codegen/templates.go @@ -73,7 +73,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _awsServiceOperatorYamlTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x55\x4d\x6f\xe3\x36\x10\xbd\xeb\x57\x0c\x92\x05\x0a\x14\x95\xbc\xee\xa9\x10\x92\x00\xa9\xed\x6e\x8d\x4d\x9d\xc0\xf6\xf6\xba\x3b\xa6\xc6\x32\x6b\x8a\x24\x48\xca\x5e\xaf\xe1\xff\x5e\x90\xfa\x88\x3f\x93\xa0\xdd\xd5\x49\x1c\x8e\xe6\xcd\x7b\x7c\x1c\x5d\xc3\x5d\xf5\x40\xff\x11\x46\x8f\x53\x18\xf4\x87\x53\x98\xfe\x39\x9c\xc0\x1f\xc3\x87\x01\xdc\xb4\x4f\x74\x0d\xd3\x05\xb7\x30\xe7\x82\x80\x5b\xc0\xd2\xa9\x9c\x24\x19\x74\x94\xc1\x8a\x23\x7c\xc1\xb5\x8d\x95\xf6\x11\x65\xa0\xd9\xfb\x12\x5d\xc3\x70\x0e\x1b\x55\xfe\x94\x81\xe0\x4b\x02\xb7\x20\x60\x0b\x94\x39\x01\xca\x8d\x5b\x70\x99\x03\xce\x54\xe9\xc0\xb5\x00\x05\x2e\x09\x28\xe3\xce\x82\x53\xe1\x8b\xc4\x51\xa1\x45\x74\x5d\x37\x20\x43\x50\x2f\xf3\x0e\x53\x19\xe5\x24\x3b\x68\x2d\x39\x0b\x19\x37\xc4\x9c\x32\x9b\x24\x8a\x50\xf3\xbf\xc9\x58\xae\x64\x0a\xab\x6e\xb4\xe4\x32\x4b\xe1\x81\x5b\x17\x71\x47\x85\x4d\xa3\x18\xaa\xd8\x08\x0b\xb2\x1a\x19\x45\x00\x47\x1f\x01\x14\xe4\x30\x43\x87\x69\x04\x00\x20\xb1\xa0\x14\x3c\x55\x4b\x66\xc5\x19\xb5\x94\xa3\xed\xd6\x04\x56\xef\xb8\xcc\xe8\xeb\x2f\xf0\x8e\x04\x15\x24\x1d\xa4\xb7\x90\x0c\x3d\xe2\x6e\x17\xc5\x07\x00\xa8\x39\x7d\x75\x24\xfd\xca\x26\xcb\xdf\x6c\xc2\x55\x67\xd5\x9d\x91\x43\x0f\x5d\x75\xd7\x2b\xad\x53\xc5\x98\xac\x2a\x0d\xa3\x3e\xcd\xb9\xe4\x8e\x2b\x79\xa1\xb7\xed\xb6\x01\x4e\x26\x9a\x58\xd2\x7c\x98\x3c\x89\xd2\xa0\xd8\xed\x92\xe3\xce\x13\x5c\xdb\x08\xc0\x6a\x62\x55\xa1\xdc\xa8\x52\xa7\x70\x21\xaf\x02\xb2\x55\x6a\xd3\xe4\x31\xea\x47\x2e\xb3\xdd\xae\x4e\x11\xdc\xba\x8f\x2f\xa4\x85\x33\xa9\x52\x75\x68\xf2\x0d\x2c\xea\x7c\xbb\x50\xc6\x8d\xf6\xfb\xd9\x6e\x63\x38\x73\x10\xfe\x14\x2e\x94\x9c\xf8\x1a\x81\x53\x5b\x36\x6e\x1a\x48\x7c\xed\x36\xec\x6b\xd3\x1e\x31\xcb\x65\x5e\x0a\x34\x6f\xed\xd7\x32\xa5\x69\xcf\x6f\x59\x88\xae\x9e\xfd\x86\x42\x2f\xb0\x1b\x6d\xb7\x15\x4a\x63\xd0\x9e\x28\xad\x23\x33\x56\xe2\xd8\xa2\x66\x86\x2c\xc1\xd2\x2d\x94\xe1\xdf\xd0\xdb\xe2\xd4\x46\x6f\x76\x30\x80\x29\x45\xa5\x64\xf0\xe9\x07\xef\x83\x5a\xd8\x18\xae\xae\xc2\x8b\xa9\x99\xb5\x71\x4b\xcc\x90\xb3\xf5\x4a\xab\xac\x79\x65\x4a\xce\x79\x5e\xa0\xb6\x6d\x66\x00\xb4\x0d\xeb\x59\x5b\x23\x27\x57\xbf\x89\xc6\x0b\x31\xac\xd1\xb1\x45\x53\xcb\x10\x3a\xaa\x17\x19\x09\x6a\x17\xa5\xce\xaa\x9d\x33\x2d\x9f\xbb\x5f\xe7\x49\xb0\x70\xc9\x9a\x70\xd6\x5e\xb2\xef\xd7\xeb\x99\xf6\x2e\x5e\xb0\x93\xf6\xae\x7e\xbe\x3a\x6d\xc4\x07\x5b\x8b\x4c\xaa\x5a\xf7\x8c\xa9\x52\xba\xff\x35\xc8\xda\x2b\xee\x2d\x7a\x21\xe7\x9c\x35\x7f\xe7\x32\xe3\x32\xff\xc1\x0e\x55\x82\xc6\x34\xaf\x32\x1b\x45\x5f\x40\x89\x9e\x67\xd4\xe1\x2d\x7a\x05\xc7\x96\xb3\x7f\x88\xb9\xfa\x32\x5c\xd0\xf8\xfb\xc9\xd8\x27\x2d\xd4\xc6\xcf\x8f\x23\xf9\x50\x6b\xfb\xdf\x94\x7a\x1d\x7d\x7f\xe6\x1b\xd2\x82\x33\xb4\x29\x74\xc3\x3a\xfc\x6f\xd1\x51\x33\x56\x0f\x81\x83\xf8\x52\x2a\x17\xa4\xb6\xcf\x41\x00\x8e\x45\x82\x05\x7e\x53\x12\xd7\x36\x61\xaa\xe8\xf8\x23\x4b\x01\x8d\x4c\x71\x6d\x53\x8e\x45\x9a\xde\xdc\xf7\x7a\x8f\x9f\x46\xd3\xcf\xc3\xfe\x5d\xea\xf7\x3b\x17\x49\x84\x1f\x08\xce\x48\x1c\xa0\xa0\xd6\x2f\x10\xdf\x27\x16\x56\x07\x07\x37\x7a\x59\x35\xff\x30\x25\x1d\x72\x49\x66\x0f\x34\x7e\x4d\xee\x9a\x7f\x81\x79\x95\x55\x27\x35\x39\x67\x29\xa6\xab\xf7\xc9\xfb\xa4\x1b\x87\xc1\xff\xeb\x71\x99\xa7\x52\x88\x27\x25\x38\xdb\xa4\x70\x2f\xd6\xb8\xb1\xfb\x12\x98\xfc\x40\x92\x66\xa2\x90\x39\x0a\xc6\x31\xab\x9c\x1f\x7b\x02\xb7\x37\xbd\x87\x4f\x93\xe9\x60\xfc\x79\x74\xff\xd7\xe0\xee\x24\xd7\x50\xce\x95\xbc\xbd\x19\x0f\x3e\x0c\x1f\x47\xa7\xfb\x58\x89\x18\xf3\xec\x76\xff\x14\xff\x0d\x00\x00\xff\xff\xa4\x51\xdf\x46\x4b\x0a\x00\x00") +var _awsServiceOperatorYamlTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xb4\x55\xdd\x6f\xdb\x36\x10\x7f\xd7\x5f\x71\x48\x0a\x0c\x18\x26\xa5\xde\xd3\x20\x24\x01\x32\xdb\xeb\x8c\x66\x4e\x60\xbb\x7b\x6d\xcf\xd4\x59\xe6\x4c\x91\x04\x49\xd9\x75\x0d\xff\xef\x03\xa9\x8f\xf8\x3b\xc1\xd6\xea\x49\x3c\x9e\xee\xf7\xc1\xe3\xe9\x1a\xee\xab\x07\x7a\x4f\x30\x7c\x9a\x40\xbf\x37\x98\xc0\xe4\xcf\xc1\x18\xfe\x18\x3c\xf6\xe1\xb6\x7d\xa2\x6b\x98\xcc\xb9\x85\x19\x17\x04\xdc\x02\x96\x4e\xe5\x24\xc9\xa0\xa3\x0c\x96\x1c\xe1\x0b\xae\x6c\xac\xb4\x8f\x28\x03\xcd\xde\x97\xe8\x1a\x06\x33\x58\xab\xf2\xa7\x0c\x04\x5f\x10\xb8\x39\x01\x9b\xa3\xcc\x09\x50\xae\xdd\x9c\xcb\x1c\x70\xaa\x4a\x07\xae\x05\x28\x70\x41\x40\x19\x77\x16\x9c\x0a\x5f\x24\x8e\x0a\x2d\xa2\xeb\x9a\x80\x0c\x41\xbd\xc8\x6f\x98\xca\x28\x27\x79\x83\xd6\x92\xb3\x90\x71\x43\xcc\x29\xb3\x4e\xa2\x08\x35\xff\x9b\x8c\xe5\x4a\xa6\xb0\xec\x44\x0b\x2e\xb3\x14\x1e\xb9\x75\x11\x77\x54\xd8\x34\x8a\xa1\x8a\x0d\xb1\x20\xab\x91\x51\x04\x70\xf0\x11\x40\x41\x0e\x33\x74\x98\x46\x00\x00\x12\x0b\x4a\xc1\x4b\xb5\x64\x96\x9c\x51\x2b\x39\xda\x6c\x4c\x50\xf5\x8e\xcb\x8c\xbe\xfe\x02\xef\x48\x50\x41\xd2\x41\x7a\x07\xc9\xc0\x23\x6e\xb7\x51\xbc\x07\x80\x9a\xd3\x57\x47\xd2\xaf\x6c\xb2\xf8\xcd\x26\x5c\xdd\x2c\x3b\x53\x72\xe8\xa1\x2b\x76\xdd\xd2\x3a\x55\x8c\xc8\xaa\xd2\x30\xea\xd1\x8c\x4b\xee\xb8\x92\x67\xb8\x6d\x36\x0d\x70\x32\xd6\xc4\x92\xe6\xc3\xe4\x59\x94\x06\xc5\x76\x9b\x1c\x32\x4f\x70\x65\x23\x00\xab\x89\x55\x85\x72\xa3\x4a\x9d\xc2\x99\xbc\x0a\xc8\x56\xa9\x0d\xc9\x43\xd4\x8f\x5c\x66\xdb\x6d\x9d\x22\xb8\x75\x1f\x2f\xa4\x85\x33\xa9\x52\x75\x20\xf9\x06\x15\x75\xbe\x9d\x2b\xe3\x86\xbb\x7c\x36\x9b\x18\x4e\x1c\x84\x3f\x85\x33\x25\xc7\xbe\x46\xd0\xd4\x96\x8d\x1b\x02\x89\xaf\xdd\x86\x7d\x6d\xda\x11\x66\xb9\xcc\x4b\x81\xe6\xad\x7c\x2d\x53\xfa\xd2\x11\x8d\xfd\x7e\x9d\xbb\x7c\xe9\x42\x14\x7a\x8e\x9d\x68\xb3\xa9\xb0\x9b\xb6\xed\x8a\xd2\x3a\x32\x23\x25\x0e\x1b\xd7\x4c\x91\x25\x58\xba\xb9\x32\xfc\x1b\xfa\x66\x39\x6e\xae\x37\xf7\x35\x80\x29\x45\xe5\x6f\xe8\xde\x0f\xbe\x3b\x6a\xbb\x63\xb8\xba\x0a\x2f\xa6\x96\xd0\xc6\x2d\x31\x43\xce\xd6\x2b\xad\xb2\xe6\x95\x29\x39\xe3\x79\x81\xda\xb6\x99\x01\xd0\x36\xaa\xa7\x6d\x8d\x9c\x5c\xfd\x26\x9a\x0e\x89\x61\x85\x8e\xcd\x9b\x5a\x86\xd0\x51\xbd\xc8\x48\x50\xbb\x28\x75\x56\xed\x9c\xa0\x7c\xea\xd6\x9d\x16\xc1\xc2\xd5\x6b\xc2\x59\x7b\xf5\xbe\x1f\xd7\x13\xf4\xce\x5e\xbb\x23\x7a\x57\x3f\x5f\x1d\x13\xf1\xc1\xb6\x45\xc6\x55\xad\x07\xc6\x54\x29\xdd\xff\x1a\x6f\xed\xc5\xf7\x83\xf2\x4c\xce\xa9\xd6\xfc\x9d\xcb\x8c\xcb\xfc\x07\x77\xa8\x12\x34\xa2\x59\x95\xd9\x38\x7a\x01\x25\x7a\x99\x5c\xfb\xb7\xe8\x15\x1c\x5b\x4e\xff\x21\xe6\xea\xcb\x70\xc6\xe3\xef\x67\x63\x8f\xb4\x50\x6b\x3f\x28\x0e\xec\x43\xad\xed\x7f\x73\xea\x75\xf4\xdd\x3f\x81\x21\x2d\x38\x43\x9b\x42\x27\xac\xc3\x5f\x18\x1d\x35\xc3\x76\x1f\x38\x98\x2f\xa5\x72\xc1\x6a\xfb\x12\x04\xe0\x58\x24\x58\xe0\x37\x25\x71\x65\x13\xa6\x8a\x1b\x7f\x64\x29\xa0\x91\x29\xae\x6c\xca\xb1\x48\xd3\xdb\x87\x6e\xf7\xe9\xd3\x70\xf2\x79\xd0\xbb\x4f\xfd\xfe\xcd\x59\x11\xe1\xb7\x82\x53\x12\x7b\x28\xa8\xf5\x05\xe1\xbb\xc2\xc2\x6a\xef\xe0\x86\x97\x5d\xf3\x0f\x53\xd2\x21\x97\x64\x76\x40\xe3\xd7\xec\xae\xf5\x17\x98\x57\x59\x75\x52\x93\x73\x52\x62\xba\x7c\x9f\xbc\x4f\x3a\x71\x18\xfc\xbf\x1e\x96\x79\x2e\x85\x78\x56\x82\xb3\x75\x0a\x0f\x62\x85\x6b\xbb\x6b\x81\xc9\xf7\x2c\x69\x26\x0a\x99\x83\x60\x1c\xb3\xaa\xf3\x63\x2f\xe0\xee\xb6\xfb\xf8\x69\x3c\xe9\x8f\x3e\x0f\x1f\xfe\xea\xdf\x1f\xe5\x1a\xca\xb9\x92\x77\xb7\xa3\xfe\x87\xc1\xd3\xf0\x78\x1f\x2b\x13\x63\x9e\xdd\xed\x9e\xe2\xbf\x01\x00\x00\xff\xff\x99\x8e\x4a\xab\x61\x0a\x00\x00") func awsServiceOperatorYamlTemplBytes() ([]byte, error) { return bindataRead( @@ -88,12 +88,12 @@ func awsServiceOperatorYamlTempl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "aws-service-operator.yaml.templ", size: 2635, mode: os.FileMode(436), modTime: time.Unix(1538901344, 0)} + info := bindataFileInfo{name: "aws-service-operator.yaml.templ", size: 2657, mode: os.FileMode(436), modTime: time.Unix(1539666667, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _baseGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x9c\x93\xcf\x8a\xdb\x30\x10\xc6\xcf\xd6\x53\x4c\x97\xa5\xd8\x8b\x23\xb3\xd7\xc0\x9e\x72\xda\x4b\x0a\x0d\xb4\x67\x45\x99\xd8\x22\xb6\x24\x46\x4a\xbc\xc5\xe8\xdd\x8b\x64\x2b\xfb\x07\x96\x74\x7b\x1a\xcf\xd8\xa3\xef\x9b\x9f\xc6\x56\xc8\x93\x68\x11\xf6\xc2\x21\x63\x6a\xb0\x86\x3c\x94\x0c\xe0\xae\x55\xbe\x3b\xef\xb9\x34\x43\x23\x46\xd7\x8b\xbd\x8b\x71\xe5\x90\x2e\x4a\xe2\xca\x58\x24\xe1\x0d\x35\xf6\xd4\x36\xd2\xe8\xa3\x6a\xef\x18\x80\xb1\x27\xe5\xdf\x35\xcb\x8e\x94\xf3\xc6\x76\x48\x1d\x2a\xdd\xe4\xc6\xd5\x49\xf9\xd8\x21\x46\x27\x7b\x85\xda\x7f\x51\x32\xf5\x2c\xc1\xa1\x6f\x2e\x48\x4e\x19\x8d\x87\xc6\xff\xb1\x78\x68\x3e\x76\x71\x31\xba\xe6\xf2\x28\x7a\xdb\x89\xc7\x28\x3c\x4d\x2b\x20\xa1\x5b\x84\x7b\xa5\x0f\xf8\x52\xc3\x3d\xf6\x38\x44\x27\xeb\x27\xe0\xcf\x1e\x07\x17\xc2\x57\x51\xe4\xc4\x35\xd3\x94\xcf\xe3\x3b\x8b\x92\xff\x44\x67\xce\x24\x91\x6f\xc5\x80\x21\x64\x0b\xa8\x0f\x21\xb0\x8a\xb1\x68\x3b\xdd\x03\x38\x4f\x67\xe9\x61\x62\x00\x33\x59\x78\x98\x23\xdf\xa4\x30\xd7\x3d\xbe\x78\x78\x48\xc0\x63\x3d\xa6\x33\xce\x4d\x66\xf2\xca\x96\xef\x66\xaf\xd9\xdd\xaf\x85\xc3\xb3\xf6\x48\x47\x21\x91\x05\xc6\x8e\x67\x2d\x61\x8b\x63\xf9\x99\x6e\xfd\xa9\x70\xfd\xff\xca\x35\xab\xe0\x21\x8d\x1d\xe7\x25\xf4\x67\xd2\xf0\x3d\x16\x62\x9e\x9d\xac\x97\x58\xe7\x5a\x54\x5d\xe7\x87\xb9\xfa\xd6\xc0\xfa\x5d\x16\xdf\x87\xeb\x88\xe5\x7e\x16\xac\xe0\xb7\xf0\xb2\x2b\xb5\x18\xd0\x59\x21\x13\x78\xa5\xdb\x1a\xe2\xbe\x6e\x3a\x90\x9d\xd0\xcb\x65\x4c\xa1\x82\x12\x89\x00\x89\x0c\x55\xc9\xeb\x3f\x2f\xd0\x8d\x4d\xc8\x68\x62\xd7\x8d\x4f\xf9\x16\xc7\x1f\xcb\xe7\x65\xdc\xc8\xc4\x04\xd2\x53\x02\x01\x7b\xfe\x76\xf0\x8a\x15\xd1\xf4\xcd\x73\xaf\x3f\xc9\xce\x0b\xf2\x1f\xb0\x64\x1e\x15\x2b\xd4\x31\x02\x80\x6f\x4f\xa0\x55\x0f\x13\x2b\xae\x37\x86\x44\xac\x08\xac\x78\x5d\x69\x56\x2c\xaf\xb4\xea\x59\xf8\x1b\x00\x00\xff\xff\x8e\xb1\x71\xd6\x69\x04\x00\x00") +var _baseGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x52\xc1\x6a\x1b\x31\x10\x3d\x7b\xbe\xe2\xd5\x84\xb2\x1b\x6c\xf9\x1e\xc8\x29\xa7\x5e\x5c\x68\x0e\x3d\x94\x1e\x64\x65\xbc\x16\xf1\x4a\x62\xa4\xad\x5b\x16\xfd\x7b\x91\xd6\x4a\xa1\x50\xdc\x9c\x86\x11\x6f\xde\xbc\xf7\x46\x41\x9b\x57\x3d\x30\x0e\x3a\x32\x91\x1d\x83\x97\x84\x8e\x80\xf5\x60\xd3\x69\x3a\x28\xe3\xc7\x9d\xbe\xc4\xb3\x3e\xc4\x52\xb7\x91\xe5\x87\x35\xbc\xf5\x81\x45\x27\x2f\xbb\xf0\x3a\xec\x8c\x77\x47\x3b\xac\x09\x98\xe7\x2d\x44\xbb\x81\x71\x67\xdd\x0b\xff\xdc\xe0\x8e\xcf\x3c\xb2\x4b\x78\x78\x84\xfa\x94\x78\x8c\x39\xbf\x97\xbf\x35\x71\x37\xcf\x8d\x4f\x3d\x07\x36\xea\x0b\x47\x3f\x89\x61\xb5\xd7\x23\xe7\xdc\x24\xb0\x7b\xc9\x99\x7a\xa2\xf4\x2b\x2c\xe6\x10\x93\x4c\x26\x61\x26\x60\x91\x8b\xfb\xa5\xaa\xa7\x5a\x28\x13\x1d\x27\x67\xb0\xe7\x4b\xf7\x2f\xd0\x86\x7a\xdc\x57\xba\xc2\x23\x9c\x26\x71\xf8\x58\x1e\x4a\xdf\x86\x1e\xae\x75\x43\x40\x7e\xe3\xed\x0e\xcb\x68\x8f\xaf\x3a\x99\x53\xe7\xf4\xc8\x31\x68\x53\xa5\x59\x37\x6c\x10\x93\x0f\x4f\x27\x98\x93\x76\x57\xb9\x73\xee\xd1\xb1\x08\x58\xc4\x4b\x5f\xb7\xfe\x77\xc4\xf6\x88\x92\x6f\x95\xdf\x72\x8a\xdf\xd6\xb7\x22\xfc\x8e\xc5\xcb\x0d\x5c\xbb\x49\x59\x7a\x03\xaa\xf6\x7c\xf9\x7c\x85\x77\x4d\x52\x4f\xc0\xaa\x58\xbb\x39\xde\x36\xa9\xe7\xa4\x25\xfd\x15\x5e\x4b\xad\xd2\xd9\x63\x09\x0a\x1f\x1e\xe1\xec\xb9\xda\x58\xbd\x5d\x89\x45\x4a\x9f\xeb\x4d\x56\x7f\x3e\x09\xad\xae\x00\x67\xcf\x94\x7f\x07\x00\x00\xff\xff\x18\xc5\x20\xc3\x10\x03\x00\x00") func baseGoTemplBytes() ([]byte, error) { return bindataRead( @@ -108,7 +108,7 @@ func baseGoTempl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "base.go.templ", size: 1129, mode: os.FileMode(420), modTime: time.Unix(1538901919, 0)} + info := bindataFileInfo{name: "base.go.templ", size: 784, mode: os.FileMode(420), modTime: time.Unix(1539668351, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -133,7 +133,7 @@ func cftGoTempl() (*asset, error) { return a, nil } -var _operatorGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\x6d\x73\xdb\x36\xf2\x7f\x4d\x7e\x0a\x94\xff\x36\x25\x53\x85\xfc\xe7\xdd\x8d\xe7\x7c\x1d\xd7\x76\x53\x4f\x53\xdb\x67\x3b\xcd\x8b\x4c\x26\x85\xc9\x95\xc4\x98\x02\x58\x00\xb2\xe2\xaa\xfa\xee\x37\x8b\x05\x28\x50\x96\x14\xa9\xc9\xf4\x6e\xee\x9a\xc9\x8c\x49\x60\xb1\xd8\x87\xdf\x3e\x00\x54\x51\xb0\x7f\xd0\x3f\x76\x72\xc1\xce\x2f\x6e\xd8\xe9\xc9\xd9\x0d\xbb\xf9\xe1\xec\x9a\x7d\x7f\xf6\xf2\x94\xfd\xbd\xfb\x17\x17\x05\xbb\x19\xd7\x9a\x0d\xeb\x06\x58\xad\x19\x9f\x1a\x39\x02\x01\x8a\x1b\xa8\xd8\x7d\xcd\xd9\x2f\x7c\xa6\x9f\xc9\x16\x47\xa4\x62\x7e\xee\x17\x5c\x79\x36\x64\x0f\x72\xfa\x75\xc5\x9a\xfa\x0e\x98\x19\x03\x2b\xc7\x5c\x8c\x80\x71\xf1\x60\xc6\xb5\x18\x31\x7e\x2b\xa7\x86\x99\x6e\x87\x09\xbf\x03\x06\x55\x6d\x34\x33\xd2\xae\xc8\x0d\x4c\xda\x06\xb9\x91\x08\xc2\x8e\xb6\x77\xa3\xa2\x94\x15\x8c\x40\x14\x5c\x6b\x30\x9a\x55\xb5\x82\xd2\x48\xf5\x90\xc7\x71\xcb\xcb\x3b\x3e\x02\x36\x9f\xe7\xd7\x2d\x94\xf9\x15\x68\x39\x55\x25\xe4\xe7\x7c\x02\x8b\x45\x1c\xd7\x93\x56\x2a\xc3\xd2\x38\x9a\xcf\x9f\xb1\x7a\xc8\x88\xee\x4c\x1f\x4f\xb5\x91\x93\xfa\x37\xa8\x16\x8b\x38\x62\x13\x30\xfc\xfe\x39\x4b\xee\xfe\xa6\xf3\x5a\x16\xbc\xad\x27\xbc\x1c\xd7\x02\xd4\x43\x81\x32\xf0\xb6\xd6\x05\x12\x15\xf7\xcf\x93\x38\x4a\x46\xb5\x19\x4f\x6f\xf3\x52\x4e\x0a\x3e\xd3\x0d\xbf\xd5\xf8\xf7\x99\x06\x75\x5f\x97\xd0\x99\xc9\xae\x1d\x43\xd3\x82\xd2\x09\xc9\x00\xc2\xee\x98\x28\x18\x36\x50\x9a\x24\xde\x93\x5b\x29\xc5\xb0\x1e\x25\x2b\x0a\xfd\x73\x0a\x53\x54\x98\x31\xc6\xf6\x62\xf7\x2b\x2e\x4c\xec\xba\x52\x2a\xe8\xdb\xa0\xc0\x21\xab\xf1\x2a\xdf\x9a\x8b\x52\x36\x30\xe1\xa2\xd0\x46\x95\x5c\x3b\x1e\x89\x36\xaa\x16\xa3\x15\x65\x65\x7b\x57\x9b\xde\xfa\x72\xac\x6a\x6d\x64\x3b\x06\x35\x86\x5a\x14\x5e\xa6\x67\x77\xb5\x49\xe2\x88\xb7\x35\x7c\x30\x20\x74\x2d\x85\xbe\x7f\x7e\x0b\x86\xf7\x04\x5b\x4e\x3e\x43\xcf\x80\xba\x07\xb5\xf4\x53\x8f\xa0\x70\xcb\xd1\x6b\x8e\x41\xd9\xd4\x20\xcc\xb3\x91\x2c\x8c\x94\x8d\x2e\x4a\x5e\x8e\x01\x1d\xc1\x67\x9a\xb7\xf5\x7e\x06\xb4\x3b\xae\xce\xe4\x7c\x86\x26\xe0\x33\xfd\xf3\x73\xde\xb4\x63\x94\xfe\xb3\x30\x2d\xee\x1d\x3f\xe2\x4e\x9a\xec\xc7\x9b\xd6\xb8\x3f\x1a\x4c\x71\x0f\x0a\x2d\x05\x55\x61\x1e\x5a\xa8\x3e\xba\x6f\x0f\x78\x3e\x8e\xb8\x41\x63\xe7\x97\x14\x90\x16\x89\x89\x8f\xca\x4d\x34\x3d\x90\x64\x31\xc6\xbe\x0f\x60\x4c\x41\x18\xff\xf2\xf6\x3d\x94\x86\x69\x23\x15\xb0\x0a\x86\xb5\xa8\x91\x49\x7c\xcf\xd5\x92\xf6\x90\x59\x80\xb9\x7d\xfc\xf0\x3c\x8e\x30\x0b\x1c\x30\xfa\x97\x6c\xc8\x11\xc9\x20\x8e\x2e\x9b\xa9\xe2\xcd\xc1\x06\x3a\x9a\x25\xca\x17\x4a\x4e\x5b\xc7\x92\xd0\x92\xdb\x21\xe4\x35\x88\xa3\x9f\xc9\x94\x07\xc1\xb4\x1b\x1a\xc4\xd1\x75\x29\x5b\x2f\xce\x3a\x80\x5b\x81\x74\xcb\x4b\xb0\x94\xd5\x20\x8e\x7e\xac\x45\xe5\x15\x70\x09\x23\xbf\x79\x68\xe1\x62\x98\x06\xd8\xca\xbd\xc8\x48\xbe\x58\xcc\x17\x99\x65\x95\x66\xb8\xe9\x58\x2a\x63\x19\x1f\xb0\x37\x6f\x29\x3a\xe7\x71\xcf\x85\x9d\xa2\x96\x56\x20\x2d\x7b\x86\x61\x8b\x54\xca\xe6\xf1\xcd\x84\x48\x17\xa1\xcd\x96\xd6\x5c\xfa\x34\x48\x01\x8b\x41\xbc\xb0\x1e\xbe\xf0\x15\x44\x41\xab\x40\x23\x06\x19\x67\xa5\x14\x46\xc9\xa6\x01\xe5\x5d\x3e\x94\xaa\xef\xfd\xd2\x7a\x97\x29\x27\x84\x8e\x11\xad\x4b\x76\xda\xa8\x69\x69\xd8\x3c\x8e\x28\x43\x3a\xab\x3d\xa5\xb7\xfc\xd8\xfe\xb1\x93\x06\x3e\x18\x37\xe9\x70\x43\x63\x41\x44\x69\x30\xac\x7b\xc9\xaf\x29\x20\x7c\x3c\x78\xb3\x9f\x09\x03\x6a\xc8\x4b\x88\x23\x23\xdb\xba\x3c\xba\x3a\xb7\x5c\xc9\xc8\x4e\xdd\x73\x98\x75\x22\x96\x0a\xb8\x81\x50\x57\x54\x72\xc6\x4d\x69\x6b\xe4\x56\x6d\xdd\xe2\x2a\x1e\x4e\x45\x19\x72\x4d\x9d\xba\x7d\x45\x07\xcc\x2b\xda\xd7\x71\xc0\xfe\xa0\x8e\x19\x7b\xda\xe9\x31\x8f\x23\x05\x66\xaa\x04\x7b\xe2\xc7\xe6\x71\xe4\xec\xee\xe1\x4a\x6f\x03\x1a\xc7\xad\x0f\xba\x71\x2b\x48\x1c\xf5\xcc\x7d\xd0\x13\x6c\x10\x47\x0b\x67\xc0\x6b\xc3\x95\x79\x8d\x36\x22\x4b\x81\xb6\x56\xab\x85\x36\x5c\xa0\x61\xe4\x90\x5d\x90\xe5\xae\xd7\x5b\x8e\x8b\x8a\xf1\xd2\x68\x26\x6d\x4f\x31\x21\x13\xa6\xe5\x52\xa3\x2c\xd8\x25\x15\x3e\x0a\x9d\x23\x07\xe8\x91\xf6\x78\x6c\x7b\x1a\x07\xb3\xf9\x22\x63\xa0\x94\xb7\x05\xed\xf4\x03\x17\x55\x03\x4a\xb3\x83\x43\x66\x4b\x4a\x17\x30\xa7\xf7\x20\x8c\x9b\xfe\x7e\x2a\x4a\x8d\xe6\x3a\xaa\x2a\x7c\xb6\x66\x29\x73\x29\x8e\x2a\x8c\xf8\xe8\x55\x5b\x71\x03\x34\x83\xc3\xf4\x8e\x33\x27\xd0\x40\x38\x43\xef\xd6\x54\xeb\x9b\x81\xc8\x16\xf7\xd2\xa8\x06\x45\xb2\x2f\xf9\x39\xcc\xd2\x32\x2f\x3d\x48\x72\xef\x0e\x56\xe6\x3d\x07\xb0\xe7\x59\x1c\x95\xb9\x07\xf6\x80\xbd\xa3\xff\xcc\x31\x42\xae\xf9\x15\x8c\x6a\x6d\x40\xa5\x9b\x93\x2b\x7b\xb2\x35\x51\xc5\xd1\x48\x06\x0c\x03\x37\x90\xb8\x81\xd1\x52\xab\x16\x99\x43\x65\xde\x2b\x59\x98\x6f\xac\x2f\xcc\x31\x15\x45\xf4\x42\x4f\xa7\xfc\xea\xf4\xfa\x86\x26\xd3\x2c\x8e\x08\x4d\x0a\xe9\x28\x44\xce\x61\xf6\x9a\xc6\x52\xaf\xc6\x80\x75\x68\x18\xb0\x55\x3f\xdb\x11\xb7\x1b\x29\xe2\x58\xe6\xa4\xc1\x56\xcd\x97\xf2\x77\xc1\x24\xea\x06\x31\xbf\xd6\x95\x45\xc1\x42\xf5\xd9\xac\x6e\x1a\x66\xb8\xeb\xb6\x27\xa0\x35\x1f\x61\x64\x28\x39\xb1\x23\xd6\x7a\x16\xf9\xad\x92\x25\x68\x1d\x20\x3f\x64\xb4\x29\x7b\x4c\xf4\x88\x3d\x25\x17\xfc\x44\xcc\xbf\x93\xd5\x43\x00\xfa\x46\x8e\x46\x64\x3c\xb7\xf2\xa5\x1d\x88\x23\xac\xcc\x68\xb4\xc0\x74\x3e\x23\x46\xf5\x10\x19\xe7\x76\x6f\x7e\xdb\x00\x32\x8a\x90\x8c\x1d\xda\x09\x6f\x76\x04\x8f\x9b\x21\x06\x34\xdd\xd5\xc7\x38\x5a\x30\x68\x34\xad\x27\xff\x5e\x23\x66\xdf\xa1\x3c\xcb\x9c\x76\x0e\xb3\xef\xa5\x22\x95\x9c\xa2\x84\x01\xfb\x98\xc5\x51\x17\xba\x7a\x80\x9a\x59\x6d\x3c\xb7\xce\x63\x54\xfe\x09\xcf\x69\x92\x64\xf9\xcb\x5a\x9b\x94\x0e\x0c\xf6\xf9\xa2\xb5\x7d\x8d\x45\x33\xaa\x88\x9c\xbe\x38\x44\x77\x5a\xf9\x9c\xa9\xf2\xd7\xb5\x19\x9f\xa2\xf9\x52\x50\x2a\xcb\xe9\x31\x21\x83\x8e\xc0\x18\x2c\x01\x9b\x7b\x0f\xe4\xed\x81\x02\x4a\xc5\x11\x46\x7d\x84\x99\xf0\xdd\x12\x99\xa8\x00\x15\xec\x4e\xb1\xfc\xcc\xc0\x44\x93\x20\xf5\xb0\x1b\xc7\x48\x33\x53\x8d\x7f\xca\xbb\xb3\x13\x76\x48\x16\xbe\xe4\x4a\x43\xe5\x3c\xfe\x26\xa1\xd9\x2a\x79\x4b\xeb\xbd\xab\x54\x18\xe4\xdd\x84\xf7\x54\x6f\xd6\xb9\x8b\xa4\xc5\x36\x20\xb6\x28\xb0\x8c\xbe\x38\x64\x49\xc2\x9e\x3c\x09\x80\x42\x43\xb8\x19\x17\x42\x1a\x6a\x18\x51\xab\x09\x6f\xdf\x10\x8a\xba\x1e\x26\x8a\x22\x27\xe0\x49\x72\xb0\x55\xfa\xc1\x92\x16\x65\xda\x42\x6d\xa7\x1d\xbd\xf7\x01\xf6\x5b\xeb\x97\xf4\x28\xec\xaa\x05\x21\x60\x0b\x2d\xd9\x3d\x79\x8b\x16\x4f\xae\x2e\x5e\xbe\xfc\xee\xe8\xf8\xc7\x77\xc7\x17\x3f\x5d\xbe\x3c\xbd\x39\x25\xdd\x23\x79\xfb\xbe\x03\x64\x65\xb3\xbc\x95\x2e\xf5\x69\x7b\x25\xbe\x06\x5b\xb5\xcf\x9c\xeb\x57\x61\xd9\x47\x93\x15\x3d\xf2\x41\x02\xa5\x54\x15\xa8\xfc\x88\xbc\x00\x95\xad\x60\xc3\xd4\x0a\x16\xb8\x66\xe0\x0e\x8d\xb9\x9d\x47\x3b\xbc\xe6\x4a\xb8\xa2\x69\x8f\x85\xf9\x8d\x3c\xe6\x13\x68\x52\x77\x30\xcc\x6f\xe4\x4b\x39\x03\x95\xee\x60\xa3\x2c\x5b\xab\x59\x9f\xec\x0a\xb8\x96\x82\xd4\x74\x59\x61\x0f\x0f\x9c\x9c\xa2\xd9\xb7\xd9\x7f\x6a\x13\x25\x2d\xfa\x63\x0e\xd8\x41\x89\x9d\x88\x42\x4d\xff\x47\x1c\x1a\xa1\x8e\x87\xac\x16\xa5\x82\x09\x08\x73\x25\x9b\xe6\x96\x97\x77\xc7\x72\x2a\xcc\x26\x6f\xec\x61\x9f\xa0\x8c\xfc\xe5\xf4\xc0\xe9\xe7\x52\x4d\x78\xf3\x6f\x0a\xe2\x98\xca\x44\xaf\x2b\x0a\x7a\xbc\x35\xdd\xbb\x6d\x9e\x51\x2d\x56\xfb\xf3\x0a\x76\xe8\xf3\x38\xb2\xc5\x43\xde\xbe\xcf\xd3\xa7\x9b\xbb\xb1\x2c\x3f\x01\x68\x8f\x65\xfb\x90\x62\x3b\xe6\x1a\x30\x21\xcd\xfa\x3b\x8e\xa3\xaa\xb2\xf7\x1b\xf5\x90\x69\x5f\x47\xfb\xea\xd8\xd4\x92\xb0\xdf\x7f\xdf\x4a\xb0\x26\xf7\xd8\xb3\xc0\xd0\xf6\xae\xfd\x46\x1d\x7d\xd4\x35\xe3\x99\xa5\x93\x53\xd3\x4e\xcd\xb2\x71\x19\x9a\xfc\xd8\x9e\x11\xa9\x56\x10\xd1\x2a\x62\xdc\x19\x2c\xef\x35\x6d\x6b\x5b\x93\xa1\xef\x4d\xec\xc1\x73\x6d\x73\x42\x3d\x11\xfb\xfa\x2b\xfd\x75\x32\x60\xda\xbe\x67\xb1\xbf\xad\x40\xef\xd9\x17\xba\x95\x5c\xdd\xf3\x4c\x0c\xe5\x30\x4d\x78\x55\x41\xb5\x95\x35\x9b\xd5\x66\xcc\xb4\x6b\x54\x7a\x9b\x0d\x5c\x67\x99\x3e\x25\x63\xb8\x76\xa6\xca\xb2\x6d\x5b\xde\xd7\x30\x63\xdc\xb0\xb1\x31\xad\x3e\x28\x8a\x52\x0a\x2d\x1b\xc0\xb3\x42\xce\x27\xfc\x37\x29\xe8\x8a\xb2\x91\xd3\x6a\x88\x81\x80\x6e\x2f\xc6\x72\x02\xdf\xfe\x5f\x61\xe5\x28\x2a\x30\xbc\x6e\xbe\x25\xa1\xaa\xc3\xaf\x74\xb2\x45\x94\x38\x8a\xde\x91\x9b\x56\x13\xcb\xd2\xbd\x5e\x9d\x65\xd3\xb4\x91\xe1\x80\x25\xc7\x57\xa7\x47\x37\xa7\xef\xce\xce\xdf\x5d\x5e\x5d\xbc\xb8\x3a\xbd\xbe\x4e\x06\x2c\x49\x36\xf4\x9f\xbb\x78\xdb\x3b\xdb\xca\x87\xce\xd6\x14\xbe\x14\x90\xe8\x43\x3a\x66\x35\x1a\xe8\x66\x68\x73\x64\x84\x6a\xf5\x4e\x67\x9b\x62\x97\x8e\x22\xa9\x6c\xaa\x0b\x4c\x4c\x02\x66\x17\x6b\x22\x59\x4a\x1b\xca\x96\x68\xf7\x68\x8e\x84\x5d\x46\x3c\xf7\x49\x02\x36\x01\xec\x17\xbc\x68\x69\xca\x44\x42\x66\xd6\x66\x1f\xcf\x25\xa4\xbb\x4f\x27\xee\x4b\x41\x7e\xa6\xad\xb3\x8f\xe5\xa4\xc5\xe6\x2f\x95\x1b\x24\x19\xb0\x21\x6f\x34\x64\xd8\x44\x7f\xe1\xef\x07\x51\x8d\xd3\x5f\xa7\xbc\xc1\x65\x5e\x47\x4c\xea\x8b\xc5\x00\x75\xea\x0f\x65\xdb\xb2\x8e\x94\x3b\xa5\x9d\x57\x1e\xd4\xe5\x9d\x53\xfd\xb3\x24\x9e\x0e\x8b\x1f\xcf\x0e\x02\x66\xac\xe5\x8a\x4f\x34\xfb\xea\x9b\x7b\x7b\xee\x95\x4d\x85\xcf\x89\xd5\x99\xa2\x4b\x48\x54\x69\xdf\x0c\x45\x21\xbb\x4b\x8e\x72\x12\xb8\x14\xd5\x6d\xfb\x5f\x92\xa3\xa4\xd7\xc7\x3d\x7c\x34\x4b\xbd\xba\x3c\xf9\xd3\xb3\x14\x63\x3b\xa4\x29\x1f\x74\x2b\x48\x47\xe8\xee\x90\xae\xe8\xda\xed\x4f\xeb\x36\x68\x3b\xd4\x66\x97\xc6\x20\x0a\xc2\xf2\x24\x38\x39\x66\xf1\x1a\x9b\xef\x15\x8d\xf6\x1c\xba\x47\x1b\xe0\x3b\x53\x6a\xe6\x36\xc0\x9c\x0e\xb7\xdb\x63\x2b\xe4\xb9\x83\x73\xbd\xbd\xb6\x95\xa1\x78\xdb\xc7\x60\xeb\xf4\xad\x27\x8e\x47\xb7\x65\xf6\x3a\xc3\xdf\x16\xaf\x5e\x7b\xed\x72\x69\xf6\x09\x77\x58\xaa\xbb\xaa\xdc\xed\x06\x6b\x79\x4c\xca\x5f\x80\x49\xe9\x50\xe3\x6e\xb3\x5e\x40\xef\x32\xeb\x31\x62\x3e\xdb\x55\x56\x78\x6a\x71\xf7\xb6\x96\x0a\xc3\xc2\xde\x62\xf9\x55\x61\x2d\x0f\x89\x1c\xf3\xd0\x3b\xc1\xdd\xd3\x06\x8a\x6f\x9e\xc7\xf1\x32\xcf\xed\x6e\x28\xd7\xa1\x84\xdc\xff\xa8\x79\xba\xd4\xe5\x99\xad\x31\xc7\xca\x85\xb0\x05\xe4\x9a\x13\xe9\x7e\x30\x1c\x74\x2d\x74\xf0\x8e\xdd\x8c\x7f\x55\xf6\x0c\xd6\x81\x76\x5b\x0a\x1b\x10\xa4\xb3\xbf\x30\xbd\x06\xd3\xa2\x6e\x06\x9f\x04\xec\xf5\x3d\xa7\x73\xd7\x2e\xc4\x74\x9a\xb6\xe1\x80\x0f\xeb\x97\x74\x37\xbf\x1e\x17\xd4\xf4\x6e\x6a\x41\x75\xbf\xe1\xb4\xe5\x23\xa8\x47\x0e\x81\xe1\x46\xbe\xd6\x53\x63\xa0\x7b\x1d\x23\x3a\x85\x86\xd3\x4f\xbf\x34\x77\x1b\x24\xfe\xf2\x20\xf8\x6e\xfd\x65\xab\x64\x8b\x9b\x92\xdf\x2e\x5c\x8f\x52\x8e\x61\xc2\xf3\x4b\x25\x5b\x50\xa6\xf6\x5f\xb1\x5d\x51\xb0\x6b\xf2\x1b\x98\xb4\x0d\x37\xfe\x07\x42\xd1\x7c\x4e\xe3\x3f\xc2\x03\xe2\xdf\x22\xda\xdb\x6a\x49\x9b\x26\x9e\xce\x8d\xd1\x37\x30\x4f\x78\xc2\x0d\x9f\x5f\xdc\xbe\x3f\x58\x31\xd4\xb1\xfb\x72\x4a\x66\x5c\x84\x5f\x26\xac\xcb\x9c\xdc\x9e\xf7\xb5\xfd\x06\x69\x25\x61\x87\xac\x27\x99\x53\xc3\xd7\xc8\x3d\xd8\x38\x2b\xbe\x79\xa4\x81\x25\x48\xde\x7a\xce\xa2\x5a\xee\xe2\x3e\xed\xff\x67\x27\xd5\x7e\x3c\xee\x07\x71\xd2\x49\x3f\x88\xf2\xa8\xaa\xec\x2f\x4f\x78\xe3\x63\x4d\xaf\x45\xfd\x5e\x70\xc6\x2e\xc8\xeb\x80\x9b\x84\x2a\x78\x3c\x07\xf5\xa0\x0f\x9a\xb0\x3a\x3c\xfe\x48\xf0\x69\xc5\xe1\xaf\xf4\xff\x99\xd2\xff\x96\x1c\xe9\xf2\xa3\x0b\x9b\x5d\xfa\xf5\xb5\x3b\x2c\xd7\xbf\xe6\xb5\x79\x25\x4c\xdd\x58\x16\xc4\xad\xa2\xf2\xd2\x83\x0f\x2d\xf6\xd0\xd9\x0e\xee\x47\x30\xd2\x6c\xdb\xd1\x86\xa1\xf5\x02\x74\xfc\x89\x20\x08\xae\xce\x08\x06\xfe\x4e\x6d\x57\x20\x3c\xea\xc1\xba\x5f\x97\xad\xab\xd9\x78\xa2\x58\x1e\x21\xd6\x18\xd0\xff\xa2\x06\x8b\x8b\xf6\x8f\x07\x87\xcb\x1f\x61\x2d\xe6\x73\x97\x40\x83\x7a\x15\x7e\xc9\xdd\x89\x75\x77\x80\x84\x5f\x97\xab\xed\xdd\x0e\x4b\x4e\x3f\x18\x50\x82\x2c\x94\x10\xe9\x97\x6a\xe5\x84\x15\x94\x31\xba\x3d\x0e\x17\xb9\x7d\xd2\xe0\xb0\xb9\xf6\xa6\x32\x09\x19\x87\x0c\x6c\xf5\x9b\xcf\xd3\x5a\x54\xf0\x21\x90\xef\x52\x2a\xa3\xd9\xff\x67\xf6\x61\x81\xfe\xe8\x4c\x74\xc8\x78\xdb\x82\xa8\x52\x3f\x82\x0c\x56\xc5\xee\x1d\xe8\xfa\x8f\xbb\xfa\xa4\xe3\xb8\x95\xee\x90\x79\x31\xbc\xb7\x3e\xee\x78\x82\xf0\x4f\xbc\xc5\x6d\xc8\x74\x13\x7c\xf9\x4c\xce\xef\xb1\x5f\xe7\x53\xec\x32\x36\x7e\x33\x0f\xb6\xab\x0d\x4c\x90\x6e\xb9\xde\xae\xf4\xbf\xe8\xb3\xf3\xd4\x55\x24\x07\xac\x1b\xf8\x99\x37\x53\xf7\x43\xbf\x7e\x13\xb0\x13\xba\x3a\xe1\x3f\x8a\xa9\xf5\x7a\x65\xfe\xe7\x7d\xd6\xa2\x1d\x56\x96\x63\xbb\xa0\x65\x77\xef\x6d\x05\x49\x40\xe9\xab\x1f\x4a\xd0\x01\x65\xf7\xae\xa8\x97\xbb\x56\xfa\xa2\x1d\x72\x95\xbf\xcb\x7c\xf4\xad\xec\x5f\x01\x00\x00\xff\xff\xe9\xd1\x82\xa9\x01\x30\x00\x00") +var _operatorGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\x6d\x73\xdb\x36\xf2\x7f\x4d\x7e\x0a\x94\xff\x36\x25\x53\x85\xfc\xe7\xdd\x4d\xe6\x7c\x1d\x57\x56\x5b\x4f\x5d\xdb\x67\x3b\xcd\x8b\x4c\xc6\x85\xc9\x95\xc4\x98\x04\x58\x00\xb2\xea\xaa\xfa\xee\x37\x8b\x05\x28\x52\x96\x14\xa9\xc9\xf4\x6e\xee\x9a\xc9\x8c\x48\x3c\x2c\xf6\xe1\xb7\x0f\x58\x3a\xcb\xd8\x3f\xe8\x1f\x3b\xb9\x60\xe7\x17\x37\x6c\x74\x72\x7a\xc3\x6e\xbe\x3f\xbd\x66\xdf\x9e\x9e\x8d\xd8\xdf\xdb\x7f\x61\x96\xb1\x9b\x69\xa9\xd9\xb8\xac\x80\x95\x9a\xf1\x99\x91\x13\x10\xa0\xb8\x81\x82\x3d\x94\x9c\xfd\xcc\xe7\xfa\x85\x6c\x70\x44\x2a\xe6\xe7\x7e\xc6\x9d\xa7\x63\xf6\x28\x67\x5f\x16\xac\x2a\xef\x81\x99\x29\xb0\x7c\xca\xc5\x04\x18\x17\x8f\x66\x5a\x8a\x09\xe3\x77\x72\x66\x98\x69\x4f\xa8\xf9\x3d\x30\x28\x4a\xa3\x99\x91\x76\x47\x6a\xa0\x6e\x2a\xa4\x46\x2c\x08\x3b\xda\xdc\x4f\xb2\x5c\x16\x30\x01\x91\x71\xad\xc1\x68\x56\x94\x0a\x72\x23\xd5\x63\x1a\x86\x0d\xcf\xef\xf9\x04\xd8\x62\x91\x5e\x37\x90\xa7\x57\xa0\xe5\x4c\xe5\x90\x9e\xf3\x1a\x96\xcb\x30\x2c\xeb\x46\x2a\xc3\xe2\x30\x58\x2c\x5e\xb0\x72\xcc\x68\xdd\xa9\x1e\xce\xb4\x91\x75\xf9\x1b\x14\xcb\x65\x18\xb0\x1a\x0c\x7f\x78\xc9\xa2\xfb\xbf\xe9\xb4\x94\x19\x6f\xca\x9a\xe7\xd3\x52\x80\x7a\xcc\x90\x07\xde\x94\x3a\xc3\x45\xd9\xc3\xcb\x28\x0c\xa2\x49\x69\xa6\xb3\xbb\x34\x97\x75\xc6\xe7\xba\xe2\x77\x1a\x7f\x5f\x68\x50\x0f\x65\x0e\xad\x9a\xec\xde\x29\x54\x0d\x28\x8d\xdb\x14\x8c\x2b\xc8\x4d\x44\xec\x80\xc0\xc3\x0f\xa4\x96\x4b\x31\x2e\x27\xd1\x9a\x40\xff\x9c\xc1\x0c\x05\x66\x8c\xb1\x83\xc8\xfd\x82\x1b\x23\xbb\x2f\x97\x0a\xfa\x3a\xc8\x70\xc8\x4a\xbc\x4e\xb7\xe4\x22\x97\x15\xd4\x5c\x64\xda\xa8\x9c\x6b\x47\x23\xd2\x46\x95\x62\x82\xc2\x06\x7c\xae\xf3\xaa\x04\x61\x0e\xe3\x88\xf6\xb8\x1f\x0d\x26\x7b\x00\xa5\x4b\x29\xa0\xc8\xcc\x63\x03\x45\xb6\xbe\x2b\xe5\x73\x9d\x3d\xbc\xe4\x55\x33\xe5\x2f\x7b\xaa\x3d\x4c\xb3\xfe\x05\x0d\xe5\x74\x40\x4c\xbc\x98\xc8\xcc\x48\x59\xe9\x2c\xe7\xf9\x14\xa2\x30\x44\xd9\x7e\x72\x27\x1e\x26\x9d\x05\xd2\x3e\x12\xb4\xa6\xf5\x48\xe5\xa6\x94\x42\xa7\x97\x04\x79\x6b\xeb\xc8\xe3\x7e\xdb\x9a\x9e\x36\x92\x10\xbd\xeb\xc2\x7b\xb0\x82\x46\x81\x46\x1d\x33\xce\x72\x29\x8c\x92\x55\x05\x8a\xc9\xbb\xf7\x90\x1b\x36\x96\xed\xa3\x36\x52\x01\xcb\xed\x19\x4c\x39\x17\xd3\x21\x5a\x63\x45\x4e\x1b\x35\xcb\x0d\x5b\x84\x01\x21\x94\xd1\xbf\xe7\xf4\x96\x0e\xed\x4f\x18\x18\xd9\x94\xf9\xf1\xd5\xb9\x9d\x24\xb0\x84\x4b\xcb\xd8\x39\xcc\x5b\x62\xb9\x02\x6e\xa0\xcb\x15\xb2\x33\xe7\x26\xb7\xd1\x64\x27\x5f\x6e\x73\x11\x8e\x67\x22\xef\x52\x8d\x1d\x63\x7d\x96\x12\xf6\xbc\x3d\x76\x11\x06\x0a\xcc\x4c\x09\xf6\xcc\x8f\x2d\xc2\xc0\x09\xf4\xca\x49\x44\x6f\x83\x30\x58\x3a\xc6\xaf\x0d\x57\xe6\x0d\xf2\x46\x1c\x82\xb6\xdc\x96\x42\x1b\x2e\x90\x21\x39\x66\x17\xc4\xf1\xf5\x66\x8e\xb9\x28\x18\xcf\x8d\x66\xd2\x46\xbd\x9a\x58\x8f\xf3\x15\x6b\x49\xe7\x94\x58\xf0\x1a\x74\xc3\x73\x70\x0a\x1c\xa0\x26\x9a\xe1\xd4\x46\x5d\x67\x88\xc5\x32\x61\xa0\x94\x17\x8a\x4e\xfa\x9e\x8b\xa2\x02\xa5\xd9\xab\x23\x66\xa1\xdc\x06\xcc\xd1\x03\x08\xe3\xa6\xbf\x9d\x89\x5c\xa3\xdc\xc7\x45\x81\xcf\x56\xf0\x3c\x95\xe2\xb8\x28\x06\x61\x10\xbc\x6e\x0a\x6e\x80\x66\x70\x98\xde\x71\xe6\x04\x2a\xe8\xce\xd0\xbb\x55\xd5\xe6\x70\x15\xd8\xf0\x93\x1b\x55\x21\x4b\xf6\x25\x3d\x87\x79\x9c\xa7\x4e\xcb\xcc\x3f\xa5\xc7\x6f\xae\x87\x3e\x24\x0c\xd8\xcb\x24\x0c\xf2\xd4\x83\x69\xc0\x6e\xe9\x3f\x73\x44\x90\x62\x7a\x05\x93\x52\x1b\x50\x71\xb4\x25\x3d\x44\x03\xf6\xac\xe3\xc8\xa9\x5f\xf6\x43\x89\xfe\xb2\x58\x26\x61\x30\x91\x1d\x82\x1d\x13\x10\xab\x1d\x85\xc5\x56\x24\x52\x85\x4a\xbc\x45\x92\x7e\xa0\x47\x7f\x47\x41\x5b\xbf\x47\x59\x9f\x72\x77\x59\xcd\x14\xaf\x2c\x7f\xad\xa9\x07\x6c\xdd\x88\x5b\x74\x93\x5e\x8d\xae\x6f\xe8\x2d\x4e\x48\x02\x3c\x2e\x25\xbe\x77\xca\xbb\xe2\xba\xf5\x03\x51\x56\x88\xf2\x8d\xc6\xcb\x32\xd6\x15\x9a\xcd\xcb\xaa\x62\x86\xbb\x0a\xa0\x06\xad\xf9\x04\x7d\x41\xc9\xda\x8e\x58\x9d\x59\xac\x37\x4a\xe6\xa0\x75\x07\xeb\x5d\x42\x9b\xfd\x74\xc0\x6a\x3d\x61\xcf\x49\xf1\x3f\x12\xf1\x6f\x64\xf1\xd8\x81\x79\x25\x27\x13\x52\xb0\xdb\x79\x66\x07\xc2\xe0\x81\x2b\xab\xc9\x8e\x3e\x7d\xec\x09\xca\x31\x12\x4e\xed\xd9\xfc\xae\x02\x24\x14\xe0\x32\x76\x64\x27\xbc\x55\x10\x32\x6e\x86\x08\xd0\xf4\xb9\x7f\x0f\x83\x25\x83\x4a\xd3\x7e\xca\x1b\xd7\x88\xd4\x5b\xe4\xa7\x4d\x85\x68\xf1\x6f\xa5\x22\x91\x9c\xa0\x64\x31\x0a\x46\x61\xd0\x3a\xab\x1e\xa0\x64\x56\x1a\x4f\xad\xb5\x18\x21\x84\x50\x1c\x47\x51\x92\x9e\x95\xda\xc4\x54\xc4\xd8\xe7\x8b\xc6\x66\x02\x8b\x61\x14\x11\x29\x7d\x76\x84\xe6\xb4\xfc\x39\x55\xa5\x6f\x4a\x33\x1d\xa1\xfa\x62\x50\x2a\x49\xe9\x31\x22\x85\x4e\xc0\x18\x0c\xb6\xdb\xe1\x89\xb4\x3d\x50\x40\xa9\x30\x40\x3f\x0f\x30\xf6\xdd\xae\xe0\x8a\x02\x28\x5b\x0c\xb6\x82\xa5\xa7\x06\x6a\x4d\x8c\x94\xe3\x76\x1c\xfd\xcb\xcc\x34\xfe\xe4\xf7\xa7\x27\xec\x88\x34\x7c\xc9\x95\x86\xc2\x59\xfc\x6d\x44\xb3\x45\xf4\x8e\xf6\x7b\x53\xa9\xae\x6b\xb7\x13\xde\x52\xbd\x59\x67\x2e\xe2\x76\x89\xc1\xc9\xa2\xc0\x12\xfa\xec\x88\x45\x11\x7b\xf6\xac\x03\x14\x1a\xc2\xc3\xb8\x10\xd2\x50\x8a\x45\xa9\x6a\xde\xbc\x25\x14\xbd\xa3\x1f\xcb\x90\x63\xf0\x24\x7a\xb5\x93\xfb\xc1\x6a\x2d\xf2\xb4\x63\xb5\x9d\x76\xeb\xbd\x0d\x6e\x1e\x9b\x2d\x5b\x7a\x2b\xec\xae\x25\x21\x60\xc7\x5a\xd2\x7b\xf4\x0e\x35\x1e\x5d\x5d\x9c\x9d\x7d\x73\x3c\xfc\xe1\x76\x78\xf1\xe3\xe5\xd9\xe8\x66\x44\xb2\x07\xf2\xee\x7d\x0b\xc8\xc2\xc6\x75\xcb\x5d\xec\x03\xf5\x9a\x7f\x0d\x76\x4a\x9f\x38\xd3\xaf\xc3\xb2\x8f\x26\xcb\x7a\xe0\x9d\x04\x72\xa9\x0a\x50\xe9\x31\x59\x01\x0a\x9b\xb3\xc6\xb1\x65\xac\x63\x9a\x81\x2b\x64\x53\x3b\x8f\x7a\x78\xc3\x95\x70\x69\xd2\x96\xaa\xe9\x8d\x1c\xf2\x1a\xaa\xd8\x15\xab\xe9\x8d\x3c\x93\x73\x50\xf1\x1e\x3a\x4a\x92\x8d\x92\xf5\x97\x5d\x01\xd7\x52\x90\x98\x2e\x2a\x1c\x60\x81\x93\x11\xaa\x7d\x97\xfe\x67\x36\x50\xd2\xa6\x3f\x66\x80\x3d\x84\xd8\x6b\x51\x57\xd2\xff\x11\x83\x06\x28\xe3\x11\x2b\x45\xae\xa0\x06\x61\xae\x64\x55\xdd\xf1\xfc\x7e\x28\x67\xc2\x6c\xb3\xc6\x01\xfa\xe9\xa4\x91\xbf\x8c\xde\x31\xfa\xb9\x54\x35\xaf\xfe\x4d\x4e\x1c\x52\x9a\xe8\x55\x45\x9d\xca\x6e\x43\xbd\x6e\xcb\x65\x14\x8b\x95\xc2\x80\x1a\xf3\x1c\xb0\x26\x5f\x84\x81\x4d\x1e\xf2\xee\x7d\x1a\x3f\xdf\x5e\x8d\x25\xe9\x09\x40\x33\x94\xcd\x63\x8c\xe5\x98\x2b\xc0\x84\x34\x9b\x6f\x85\xc7\x45\x61\x6f\x84\xe5\x98\x69\x9f\x47\xfb\xe2\xd8\xd0\x12\xb1\xdf\x7f\xdf\xb9\x60\x43\xec\xb1\xd5\xff\xd8\x20\xd3\xfd\xd2\xdc\x56\xa0\xbe\x04\x4f\xec\x3a\x39\x33\xcd\xcc\xac\x0a\x97\xb1\x49\x87\xf6\x36\x46\xb9\x82\x16\xad\x23\xc6\x5d\xab\xd2\x5e\xd1\xb6\xb1\x34\x19\xfb\xda\xc4\x5e\xf1\x36\x16\x27\x54\x13\xb1\x2f\xbf\xd0\x5f\x46\x03\xa6\xed\x7b\xe2\x8e\x20\xeb\xd9\x17\xea\x94\xac\x9f\x79\x2a\xc6\x72\x1c\x47\xbc\x28\xa0\xd8\x49\x9a\xcd\x4b\x33\x65\xda\x15\x2a\xbd\xc3\x06\xae\xb2\x8c\x9f\x93\x32\x5c\x39\x53\x24\xc9\xae\x23\x1f\x4a\x98\x33\x6e\xd8\xd4\x98\x46\xbf\xca\xb2\x5c\x0a\x2d\x2b\x48\xf9\x5c\xa7\xbc\xe6\xbf\x49\x61\xdb\x0b\x79\x25\x67\xc5\x18\x1d\x01\xcd\x9e\x4d\x65\x0d\x5f\xff\x5f\x66\xf9\xc8\x0a\x30\xbc\xac\xbe\x26\xa6\x8a\xa3\x2f\x74\xb4\x83\x95\x30\x08\x6e\xc9\x4c\xeb\x81\x65\x65\x5e\x2f\xce\xaa\x68\xda\x4a\x70\xc0\xa2\xe1\xd5\xe8\xf8\x66\x74\x7b\x7a\x7e\x7b\x79\x75\xf1\xdd\xd5\xe8\xfa\x3a\x1a\xb0\x28\xda\x52\x7f\xee\x63\x6d\x6f\x6c\xcb\x1f\x1a\x5b\x93\xfb\x92\x43\xa2\x0d\xe9\x72\x55\x69\x7b\x95\xdc\xd2\x0b\xb1\x9e\xd1\x15\xab\x77\x27\xdb\xe6\xbb\x74\x15\x89\x65\x55\x5c\x60\x60\x12\x30\xbf\xd8\xe0\xc9\x52\x5a\x57\xb6\x8b\xf6\xf7\xe6\x40\xd8\x6d\x44\xf3\x90\x20\x60\x03\xc0\x61\xce\x8b\x9a\xa6\x48\x24\x64\x62\x75\xf6\xe1\x58\x42\xb2\xfb\x70\xe2\xba\x97\xe9\xa9\xb6\xc6\x1e\xca\xba\xc1\xe2\x2f\x96\x5b\x38\x19\xb0\x31\xaf\x34\x24\x58\x44\x7f\xe6\xfa\x9d\x56\x8c\xd1\x2f\x33\x5e\xe1\x36\x2f\x23\x06\xf5\xe5\x72\x80\x32\xf5\x87\x92\x5d\x51\x47\xca\xbd\xc2\xce\x6b\x0f\xea\xfc\xde\x89\xfe\x49\x02\x4f\x8b\xc5\x0f\x47\x07\x01\x73\xd6\x70\xc5\x6b\xcd\xbe\xf8\xea\xc1\xde\x7b\x65\x55\xe0\x73\x64\x65\x26\xef\x12\x12\x45\x3a\x34\x42\x91\xcb\xee\x13\xa3\x1c\x07\x2e\x44\xb5\xc7\xfe\x97\xc4\x28\xe9\xe5\x71\x0f\x1f\x8c\x52\xaf\x2f\x4f\xfe\xf4\x28\xc5\xd8\x1e\x61\xca\x3b\xdd\x1a\xd2\x11\xba\x7b\x84\x2b\x6a\xb4\xfd\x69\xd5\x06\x1d\x87\xd2\xec\x53\x18\x04\x1d\xb7\x3c\xe9\xdc\x1c\x93\x70\x83\xce\x0f\xf2\x46\x7b\x0f\x3d\xa0\x0c\xf0\x95\x29\x15\x73\x5b\x60\x4e\x97\xdb\xdd\xbe\xd5\xa5\xb9\x87\x71\xbd\xbe\x76\xa5\xa1\x70\xd7\x07\x2a\x6b\xf4\x9d\x37\x8e\x27\xdd\x32\xdb\xce\xf0\xfd\xe1\xf5\xb6\xd7\x3e\x4d\xb3\x8f\xe8\x61\xf9\x76\xcb\xbe\x1d\xac\xd5\x35\x29\xfd\x0e\x4c\x4c\x97\x1a\xd7\xcd\xfa\x0e\x7a\xcd\xac\xa7\x88\xf9\x64\xad\xac\xee\xad\x85\x8a\x7d\x5a\x85\x6e\x61\xbb\x58\x7e\x57\x37\x97\x77\x17\x39\xe2\x5d\xeb\x74\x7a\x4f\x5b\x56\x7c\xf5\x32\x0c\x57\x71\x6e\x7f\x45\xb9\x0a\xa5\x4b\xfd\x8f\xaa\xa7\x0d\x5d\x9e\xd8\x06\x75\xac\x35\x84\x2d\x20\x37\xdc\x48\x0f\x83\xe1\xa0\x2d\xa1\x3b\xef\x58\xcd\xf8\x57\x65\xef\x60\x2d\x68\x77\x85\xb0\x01\x41\x3a\xf9\x0b\xd3\x1b\x30\x2d\xca\x6a\xf0\x51\xc0\xde\x5c\x73\x3a\x73\xed\xb3\x98\x6e\xd3\xd6\x1d\xf0\x61\xf3\x96\xb6\xf3\xeb\x71\x41\x45\xef\xb6\x12\x54\xf7\x0b\x4e\x9b\x3e\x3a\xf9\xc8\x21\xb0\x7b\x90\xcf\xf5\x54\x18\xe8\x5e\xc5\x88\x46\xa1\xe1\xf8\xe3\x9b\xe6\xee\x80\xc8\x37\x0f\x6c\xac\xa7\x36\xf8\xe7\x8d\x92\x0d\x1e\x4a\x76\xbb\x70\x35\x4a\x3e\x85\x9a\xa7\x97\x4a\x36\xa0\x4c\x09\x9a\x61\x3e\xf1\x99\xd8\xee\x49\x6f\xa0\x6e\x2a\x6e\xfc\x1f\x2d\x04\x8b\x05\x8d\xff\x00\x8f\x88\x7f\x8b\x68\xaf\xab\xd5\xda\x38\xf2\xeb\xdc\x18\x7d\xf9\xf2\x0b\x4f\xb8\xe1\x8b\x8b\xbb\xf7\xaf\xd6\x14\x35\x74\x1f\x3d\x49\x8d\xcb\xee\x97\x09\x6b\x32\xc7\xb7\xa7\x7d\x6d\xbf\x3a\x5a\x4e\xd8\x11\xeb\x71\xe6\xc4\xf0\x39\xf2\x00\x32\x4e\x8b\x6f\x9f\x48\x60\x17\x44\xef\x3c\x65\x51\xac\x4e\xa1\xe7\xe5\x7f\x76\x50\xed\xfb\xe3\x61\x10\x27\x99\xf4\xa3\xc8\x8f\x8b\xa2\xc4\x28\xc2\x2b\xef\x6b\x7a\x23\xea\x0f\x82\x33\x56\x41\x5e\x06\x3c\xa4\x2b\x82\xc7\x73\x27\x1f\xf4\x41\xd3\xcd\x0e\x4f\x3f\x12\x7c\x5c\x72\xf8\x2b\xfc\x7f\xa2\xf0\xbf\x23\x46\xba\xf8\xe8\xdc\x66\x9f\x7a\x7d\xe3\x09\xab\xfd\x6f\x78\x69\x5e\x0b\x53\x56\x96\x04\x51\x2b\x28\xbd\xf4\xe0\x43\x9b\x3d\x74\x76\x83\xfb\x09\x8c\x34\xdb\x75\xb5\x61\xa8\xbd\x0e\x3a\xfe\x44\x10\x74\x5a\x67\x04\x03\xdf\x53\xdb\x17\x08\x4f\x6a\x30\xf7\x4d\x75\x73\xce\xc6\x1b\xc5\xea\x0a\xb1\x41\x81\xe9\x35\xfd\xe1\x11\x26\x17\xed\x1f\x5f\x1d\xb1\xb7\xfe\x03\xe6\x72\xb1\x70\x01\xb4\x93\xaf\xba\x5f\x72\xf7\x22\xdd\x5e\x20\xe1\x97\xd5\x6e\xdb\xdb\x61\xd1\xe8\x57\x03\x4a\x90\x86\x22\x5a\xfa\xb9\x5a\xbb\x61\x75\xd2\x18\x75\x8f\xbb\x9b\xdc\x39\x71\xe7\xb2\xb9\xb1\x53\x19\x75\x09\x77\x09\xd8\xec\xb7\x58\xc4\xa5\x28\xe0\xd7\x0e\x7f\x97\x52\x19\xcd\xfe\x3f\xb1\x0f\x4b\xb4\x47\xab\xa2\x23\xc6\x9b\x06\x44\x11\xfb\x11\x24\xb0\xce\x76\xef\x42\xd7\x7f\xdc\xd7\x26\x2d\xc5\x9d\xeb\x8e\x98\x67\xc3\x5b\xeb\xc3\x86\x27\x08\xff\xc8\x1b\x3c\x86\x54\x57\xe3\xcb\x27\x32\x7e\x8f\xfc\x26\x9b\x62\x95\xb1\xf5\x9b\x79\xe7\xb8\xd2\x40\x8d\xeb\x56\xfb\xed\x4e\x9b\xde\xd1\xa2\x38\x4f\x55\x45\xf4\x8a\xb5\x03\x3f\xf1\x6a\x66\xed\xba\x5e\x04\xec\x85\xae\x96\xf9\x0f\x62\x6a\xb3\x5c\x89\xff\x93\x37\xab\xd1\x16\x2b\xab\xb1\x7d\xd0\xb2\xbf\xf5\x76\x82\xa4\xb3\xd2\x67\x3f\xe4\xa0\x05\xca\xfe\x55\x51\x2f\x76\xad\xd5\x45\x7b\xc4\x2a\xdf\xcb\x7c\xf2\xad\xec\x5f\x01\x00\x00\xff\xff\x42\xb2\x54\x80\x95\x2c\x00\x00") func operatorGoTemplBytes() ([]byte, error) { return bindataRead( @@ -148,7 +148,7 @@ func operatorGoTempl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "operator.go.templ", size: 12289, mode: os.FileMode(436), modTime: time.Unix(1538901658, 0)} + info := bindataFileInfo{name: "operator.go.templ", size: 11413, mode: os.FileMode(436), modTime: time.Unix(1539669055, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -246,11 +246,11 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ "aws-service-operator.yaml.templ": awsServiceOperatorYamlTempl, - "base.go.templ": baseGoTempl, - "cft.go.templ": cftGoTempl, - "operator.go.templ": operatorGoTempl, - "template_functions.go.templ": template_functionsGoTempl, - "types.go.templ": typesGoTempl, + "base.go.templ": baseGoTempl, + "cft.go.templ": cftGoTempl, + "operator.go.templ": operatorGoTempl, + "template_functions.go.templ": template_functionsGoTempl, + "types.go.templ": typesGoTempl, } // AssetDir returns the file names below a certain @@ -292,13 +292,14 @@ type bintree struct { Func func() (*asset, error) Children map[string]*bintree } + var _bintree = &bintree{nil, map[string]*bintree{ "aws-service-operator.yaml.templ": &bintree{awsServiceOperatorYamlTempl, map[string]*bintree{}}, - "base.go.templ": &bintree{baseGoTempl, map[string]*bintree{}}, - "cft.go.templ": &bintree{cftGoTempl, map[string]*bintree{}}, - "operator.go.templ": &bintree{operatorGoTempl, map[string]*bintree{}}, - "template_functions.go.templ": &bintree{template_functionsGoTempl, map[string]*bintree{}}, - "types.go.templ": &bintree{typesGoTempl, map[string]*bintree{}}, + "base.go.templ": &bintree{baseGoTempl, map[string]*bintree{}}, + "cft.go.templ": &bintree{cftGoTempl, map[string]*bintree{}}, + "operator.go.templ": &bintree{operatorGoTempl, map[string]*bintree{}}, + "template_functions.go.templ": &bintree{template_functionsGoTempl, map[string]*bintree{}}, + "types.go.templ": &bintree{typesGoTempl, map[string]*bintree{}}, }} // RestoreAsset restores an asset under the given directory @@ -347,4 +348,3 @@ func _filePath(dir, name string) string { cannonicalName := strings.Replace(name, "\\", "/", -1) return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) } - diff --git a/code-generation/pkg/codegen/types.go b/code-generation/pkg/codegen/types.go index a109bef69..1a74b4f4b 100644 --- a/code-generation/pkg/codegen/types.go +++ b/code-generation/pkg/codegen/types.go @@ -56,6 +56,7 @@ type SpecResource struct { Name string `yaml:"name",json:"name"` Plural string `yaml:"plural",json:"plural"` Shortnames []Shortname `yaml:"shortNames",json:"shortNames"` + Scope string `yaml:"scope",json:"scope"` } // Shortname defines the shortnames the crd will listen to diff --git a/models/cloudformationtemplate.yaml b/models/cloudformationtemplate.yaml index f0633a5f3..a3d6bb9e0 100644 --- a/models/cloudformationtemplate.yaml +++ b/models/cloudformationtemplate.yaml @@ -16,6 +16,7 @@ spec: - name: cfn - name: cfns - name: cloudformation + scope: Namespaced body: schema: title: CloudFormationTemplate diff --git a/models/dynamodb.yaml b/models/dynamodb.yaml index 4ca6e0682..5b1347ffd 100644 --- a/models/dynamodb.yaml +++ b/models/dynamodb.yaml @@ -16,6 +16,7 @@ spec: - name: dynamo - name: dynamotable - name: dynamotables + scope: Namespaced body: schema: title: DynamoDB diff --git a/models/ecrrepository.yaml b/models/ecrrepository.yaml index b94248530..0671991c7 100644 --- a/models/ecrrepository.yaml +++ b/models/ecrrepository.yaml @@ -13,6 +13,7 @@ spec: shortNames: - name: ecr - name: repository + scope: Namespaced body: schema: type: object diff --git a/models/s3bucket.yaml b/models/s3bucket.yaml index 520dd5126..1e781eaae 100644 --- a/models/s3bucket.yaml +++ b/models/s3bucket.yaml @@ -14,6 +14,7 @@ spec: - name: s3 - name: bucket - name: buckets + scope: Namespaced body: schema: type: object diff --git a/models/snssubscription.yaml b/models/snssubscription.yaml index f75081426..5eb1ddbb9 100644 --- a/models/snssubscription.yaml +++ b/models/snssubscription.yaml @@ -12,6 +12,7 @@ spec: plural: snssubscriptions shortNames: - name: subscription + scope: Namespaced body: schema: type: object diff --git a/models/snstopic.yaml b/models/snstopic.yaml index 213f8ec97..61acca14f 100644 --- a/models/snstopic.yaml +++ b/models/snstopic.yaml @@ -14,6 +14,7 @@ spec: - name: sns - name: topic - name: topics + scope: Namespaced body: schema: type: object diff --git a/models/sqsqueue.yaml b/models/sqsqueue.yaml index a98cf18d9..74f9e7c93 100644 --- a/models/sqsqueue.yaml +++ b/models/sqsqueue.yaml @@ -14,6 +14,7 @@ spec: - name: sqs - name: queue - name: queues + scope: Namespaced body: schema: type: object diff --git a/pkg/config/types.go b/pkg/config/types.go index c9093c987..9b1fb375c 100644 --- a/pkg/config/types.go +++ b/pkg/config/types.go @@ -1,11 +1,13 @@ package config import ( + "fmt" "github.com/aws/aws-sdk-go/aws/session" awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1" - opkit "github.com/christopherhein/operator-kit" "github.com/sirupsen/logrus" + "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/record" ) @@ -13,13 +15,14 @@ import ( type Config struct { Region string Kubeconfig string + MasterURL string AWSSession *session.Session AWSClientset awsclient.ServiceoperatorV1alpha1Interface + KubeClientset kubernetes.Interface RESTConfig *rest.Config - Context *opkit.Context LoggingConfig *LoggingConfig Logger *logrus.Entry - Resources []string + Resources map[string]bool ClusterName string Bucket string AccountID string @@ -33,3 +36,33 @@ type LoggingConfig struct { DisableTimestamps bool FullTimestamps bool } + +func getKubeconfig(masterURL, kubeconfig string) (*rest.Config, error) { + if kubeconfig != "" { + return clientcmd.BuildConfigFromFlags(masterURL, kubeconfig) + } + return rest.InClusterConfig() +} + +func (c *Config) CreateContext(masterURL, kubeconfig string) error { + config, err := getKubeconfig(masterURL, kubeconfig) + if err != nil { + return fmt.Errorf("failed to get k8s config. %+v", err) + } + + clientset, err := kubernetes.NewForConfig(config) + if err != nil { + return fmt.Errorf("failed to get k8s client. %+v", err) + } + + awsclientset, err := awsclient.NewForConfig(config) + if err != nil { + return fmt.Errorf("failed to create object store clientset. %+v", err) + } + + c.AWSClientset = awsclientset + c.KubeClientset = clientset + c.RESTConfig = config + + return nil +} diff --git a/pkg/helpers/config_map.go b/pkg/helpers/configmap.go similarity index 90% rename from pkg/helpers/config_map.go rename to pkg/helpers/configmap.go index 1bd1e50a5..2d78a03bb 100644 --- a/pkg/helpers/config_map.go +++ b/pkg/helpers/configmap.go @@ -26,7 +26,7 @@ func CreateConfigMap(config *config.Config, resource interface{}, svcName string Data: cmData, } - newConfigMap, err := config.Context.Clientset.CoreV1().ConfigMaps(svcNamespace).Create(configMap) + newConfigMap, err := config.KubeClientset.CoreV1().ConfigMaps(svcNamespace).Create(configMap) if err != nil { logger.WithError(err).Error("error creating configmap") } diff --git a/pkg/helpers/service.go b/pkg/helpers/service.go index 87a1b1240..51c189182 100644 --- a/pkg/helpers/service.go +++ b/pkg/helpers/service.go @@ -31,7 +31,7 @@ func CreateExternalNameService(config *config.Config, resource interface{}, svcN }, } - newService, err := config.Context.Clientset.CoreV1().Services(svcNamespace).Create(service) + newService, err := config.KubeClientset.CoreV1().Services(svcNamespace).Create(service) if err != nil { logger.WithError(err).Error("error creating service") } diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go new file mode 100644 index 000000000..c1cd8133a --- /dev/null +++ b/pkg/operator/operator.go @@ -0,0 +1,33 @@ +package operator + +import ( + "k8s.io/apimachinery/pkg/fields" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/client-go/rest" + "k8s.io/client-go/tools/cache" +) + +type operator struct { + plural string + namespace string + handlers cache.ResourceEventHandlerFuncs + client rest.Interface +} + +func New(plural, namespace string, handlers cache.ResourceEventHandlerFuncs, client rest.Interface) *operator { + return &operator{ + plural: plural, + namespace: namespace, + handlers: handlers, + client: client, + } +} + +func (o *operator) Watch(obj runtime.Object, done <-chan struct{}) error { + source := cache.NewListWatchFromClient(o.client, o.plural, o.namespace, fields.Everything()) + _, controller := cache.NewInformer(source, obj, 5, o.handlers) + + go controller.Run(done) + <-done + return nil +} diff --git a/pkg/queue/queue.go b/pkg/queue/queue.go index 894be03a3..ee05ed6f7 100644 --- a/pkg/queue/queue.go +++ b/pkg/queue/queue.go @@ -9,7 +9,6 @@ import ( awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1" "github.com/awslabs/aws-service-operator/pkg/config" "github.com/awslabs/aws-service-operator/pkg/helpers" - opkit "github.com/christopherhein/operator-kit" "os" "strings" ) @@ -71,10 +70,9 @@ func (m *MessageBody) IsComplete() bool { } // New will initialize the Queue object for watching -func New(config *config.Config, context *opkit.Context, awsclientset awsclient.ServiceoperatorV1alpha1Interface, timeout int) *Queue { +func New(config *config.Config, awsclientset awsclient.ServiceoperatorV1alpha1Interface, timeout int) *Queue { return &Queue{ config: config, - context: context, awsclientset: awsclientset, timeout: int64(timeout), } diff --git a/pkg/queue/types.go b/pkg/queue/types.go index ad076b89c..af06d7caa 100644 --- a/pkg/queue/types.go +++ b/pkg/queue/types.go @@ -3,14 +3,12 @@ package queue import ( awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1" "github.com/awslabs/aws-service-operator/pkg/config" - opkit "github.com/christopherhein/operator-kit" ) // Queue wraps the config object for updating type Queue struct { config *config.Config queueURL string - context *opkit.Context awsclientset awsclient.ServiceoperatorV1alpha1Interface timeout int64 } diff --git a/pkg/server/server.go b/pkg/server/server.go index 4c8aed837..d5ec30ee9 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -1,24 +1,18 @@ package server import ( - "fmt" - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/ec2metadata" - "github.com/aws/aws-sdk-go/aws/session" - "time" + // "fmt" + // "github.com/aws/aws-sdk-go/aws" + // "github.com/aws/aws-sdk-go/aws/ec2metadata" + // "github.com/aws/aws-sdk-go/aws/session" awsscheme "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/scheme" - awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1" + //awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1" "github.com/awslabs/aws-service-operator/pkg/config" opBase "github.com/awslabs/aws-service-operator/pkg/operators/base" - opkit "github.com/christopherhein/operator-kit" corev1 "k8s.io/api/core/v1" - apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" - "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" - "k8s.io/client-go/rest" - "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/record" ) @@ -36,87 +30,19 @@ func (c *Server) Run(stopChan chan struct{}) { config := c.Config logger := config.Logger logger.Info("getting kubernetes context") - context, restConfig, kubeclientset, awsClientset, err := createContext(config.Kubeconfig) - if err != nil { - logger.Fatalf("failed to create context. %+v\n", err) - } - config.Context = context - config.AWSClientset = awsClientset - config.RESTConfig = restConfig - - // TODO: Figure out how to get the node tag so I can store the - // `KubernetesCluster` attribute so that all resources can be cleaned up - // using that tag. Also we can create an inventory of all aws resources that - // are modifiable at any time and deletable using the kubectl cli - - region := "" - ec2Session, err := session.NewSession() - metadata := ec2metadata.New(ec2Session) - if config.Region == "" { - region, _ = metadata.Region() - } else { - region = config.Region - } - - logger.Infof("region: %+v", region) - - sess, err := session.NewSession(&aws.Config{ - Region: aws.String(region), - }) - if err != nil { - logger.Infof("error creating AWS session '%s'\n", err) - } - config.AWSSession = sess awsscheme.AddToScheme(scheme.Scheme) eventBroadcaster := record.NewBroadcaster() eventBroadcaster.StartLogging(logger.Infof) - eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: kubeclientset.CoreV1().Events("")}) + eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: config.KubeClientset.CoreV1().Events("")}) recorder := eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: controllerName}) config.Recorder = recorder // start watching the aws operator resources logger.Info("Watching the resources") - operators := opBase.New(config, context, awsClientset) - err = operators.Watch(corev1.NamespaceAll, stopChan) + operators := opBase.New(config) // TODO: remove context and Clientset + err := operators.Watch(corev1.NamespaceAll, stopChan) if err != nil { - logger.Infof("error watching operators '%s'\n", err) - } -} - -func getConfig(kubeconfig string) (*rest.Config, error) { - if kubeconfig != "" { - return clientcmd.BuildConfigFromFlags("", kubeconfig) - } - return rest.InClusterConfig() -} - -func createContext(kubeconfig string) (*opkit.Context, *rest.Config, kubernetes.Interface, awsclient.ServiceoperatorV1alpha1Interface, error) { - config, err := getConfig(kubeconfig) - if err != nil { - return nil, nil, nil, nil, fmt.Errorf("failed to get k8s config. %+v", err) - } - - clientset, err := kubernetes.NewForConfig(config) - if err != nil { - return nil, nil, nil, nil, fmt.Errorf("failed to get k8s client. %+v", err) - } - - apiExtClientset, err := apiextensionsclient.NewForConfig(config) - if err != nil { - return nil, nil, nil, nil, fmt.Errorf("failed to create k8s API extension clientset. %+v", err) - } - - awsclientset, err := awsclient.NewForConfig(config) - if err != nil { - return nil, nil, nil, nil, fmt.Errorf("failed to create object store clientset. %+v", err) - } - - context := &opkit.Context{ - Clientset: clientset, - APIExtensionClientset: apiExtClientset, - Interval: 500 * time.Millisecond, - Timeout: 60 * time.Second, + logger.Infof("error watching operators '%s'\n", err) } - return context, config, clientset, awsclientset, nil }