diff --git a/cmd/aws-service-operator/main.go b/cmd/aws-service-operator/main.go index d5039e42d..c7f4504fd 100644 --- a/cmd/aws-service-operator/main.go +++ b/cmd/aws-service-operator/main.go @@ -9,6 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/session" "github.com/awslabs/aws-service-operator/pkg/config" + "github.com/awslabs/aws-service-operator/pkg/logger" + "github.com/awslabs/aws-service-operator/pkg/queue" + goVersion "github.com/christopherhein/go-version" homedir "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" "github.com/spf13/viper" @@ -90,7 +93,14 @@ func initConfig() { } } -func getConfig() (c *config.Config, err error) { +func getConfig() (c config.Config, err error) { + loggingConfig := config.LoggingConfig{ + File: logFile, + Level: logLevel, + FullTimestamps: true, + DisableTimestamps: false, + } + resourcesMap := map[string]bool{} for _, r := range strings.Split(resources, ",") { resourcesMap[r] = true @@ -101,37 +111,49 @@ func getConfig() (c *config.Config, err error) { if awsRegion == "" { awsRegion, err = metadata.Region() if err != nil { - return nil, err + return c, err } } sess, err := session.NewSession(&aws.Config{Region: aws.String(awsRegion)}) if err != nil { - return nil, err + return c, err } - c = &config.Config{ - Region: awsRegion, - Kubeconfig: kubeconfig, - MasterURL: masterURL, - AWSSession: sess, - LoggingConfig: &config.LoggingConfig{ - File: logFile, - Level: logLevel, - FullTimestamps: true, - DisableTimestamps: false, - }, + awsclientset, kubeclientset, restconfig, err := config.CreateContext(masterURL, kubeconfig) + if err != nil { + return c, err + } + + logger, err := logger.Configure(loggingConfig) + if err != nil { + return c, err + } + + queueURL, queueARN, err := queue.RegisterQueue(sess, clusterName, "cloudformation") + if err != nil { + return c, err + } + + c = config.Config{ + Region: awsRegion, + Kubeconfig: kubeconfig, + MasterURL: masterURL, + Logger: logger, + Version: goVersion.New(version, commit, date), + AWSSession: sess, + LoggingConfig: loggingConfig, + AWSClientset: awsclientset, + KubeClientset: kubeclientset, + RESTConfig: restconfig, + Recorder: config.CreateRecorder(logger, kubeclientset), Resources: resourcesMap, ClusterName: clusterName, Bucket: bucket, AccountID: accountID, DefaultNamespace: defaultNamespace, + QueueURL: queueURL, + QueueARN: queueARN, } - - err = c.CreateContext(masterURL, kubeconfig) - if err != nil { - return nil, err - } - return c, nil } diff --git a/cmd/aws-service-operator/server.go b/cmd/aws-service-operator/server.go index 1baca2308..de95ac75f 100644 --- a/cmd/aws-service-operator/server.go +++ b/cmd/aws-service-operator/server.go @@ -6,7 +6,6 @@ import ( "os/signal" "syscall" - "github.com/awslabs/aws-service-operator/pkg/logger" "github.com/awslabs/aws-service-operator/pkg/server" "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -22,12 +21,6 @@ var serverCmd = &cobra.Command{ logrus.Fatalf("%s", err) } - logger, err := logger.Configure(config.LoggingConfig) - if err != nil { - logrus.Fatalf("Failed to configure logging: '%s'" + err.Error()) - } - config.Logger = logger - ctx, cancel := context.WithCancel(context.Background()) signalChan := make(chan os.Signal, 1) signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM) @@ -35,7 +28,7 @@ var serverCmd = &cobra.Command{ go server.New(config).Run(ctx) <-signalChan - logger.Info("shutdown signal received, exiting...") + config.Logger.Info("shutdown signal received, exiting...") cancel() }, } diff --git a/code-generation/pkg/codegen/assets/base.go.templ b/code-generation/pkg/codegen/assets/base.go.templ index e35f93cd6..9cd86d639 100644 --- a/code-generation/pkg/codegen/assets/base.go.templ +++ b/code-generation/pkg/codegen/assets/base.go.templ @@ -10,7 +10,7 @@ import ( ) type base struct { - config *config.Config + config config.Config queueManager *queuemanager.QueueManager {{- range $index, $element := .Items}} {{$element.Spec.Resource.Name}} *{{$element.Spec.Resource.Name}}.Operator @@ -18,7 +18,7 @@ type base struct { } func New( - config *config.Config, + config config.Config, queueManager *queuemanager.QueueManager, ) *base { return &base{ diff --git a/code-generation/pkg/codegen/assets/cft.go.templ b/code-generation/pkg/codegen/assets/cft.go.templ index dee10cc70..1a156f2de 100644 --- a/code-generation/pkg/codegen/assets/cft.go.templ +++ b/code-generation/pkg/codegen/assets/cft.go.templ @@ -15,7 +15,7 @@ import ( ) // New generates a new object -func New(config *config.Config, {{.Spec.Resource.Name}} *awsV1alpha1.{{.Spec.Kind}}, topicARN string) *Cloudformation { +func New(config config.Config, {{.Spec.Resource.Name}} *awsV1alpha1.{{.Spec.Kind}}, topicARN string) *Cloudformation { return &Cloudformation{ {{.Spec.Kind}}: {{.Spec.Resource.Name}}, config: config, @@ -25,7 +25,7 @@ func New(config *config.Config, {{.Spec.Resource.Name}} *awsV1alpha1.{{.Spec.Kin // Cloudformation defines the {{.Spec.Resource.Name}} cfts type Cloudformation struct { - config *config.Config + config config.Config {{.Spec.Kind}} *awsV1alpha1.{{.Spec.Kind}} topicARN string } diff --git a/code-generation/pkg/codegen/assets/operator.go.templ b/code-generation/pkg/codegen/assets/operator.go.templ index 1ccaa4cac..5ff114016 100644 --- a/code-generation/pkg/codegen/assets/operator.go.templ +++ b/code-generation/pkg/codegen/assets/operator.go.templ @@ -33,13 +33,13 @@ import ( // Operator represents a controller object for object store custom resources type Operator struct { - config *config.Config + config config.Config topicARN string queueManager *queuemanager.QueueManager } // NewOperator create controller for watching object store custom resources created -func NewOperator(config *config.Config, queueManager *queuemanager.QueueManager) *Operator { +func NewOperator(config config.Config, queueManager *queuemanager.QueueManager) *Operator { {{- if .Spec.Queue}} queuectrl := queue.New(config, config.AWSClientset, 10) topicARN, _ := queuectrl.Register("{{.Spec.Resource.Name}}") @@ -69,7 +69,7 @@ func (c *Operator) StartWatch(ctx context.Context, namespace string) { {{- if .Spec.Queue}} // QueueUpdater will take the messages from the queue and process them -func QueueUpdater(config *config.Config, msg *queuemanager.MessageBody) error { +func QueueUpdater(config config.Config, msg *queuemanager.MessageBody) error { logger := config.Logger var name, namespace string if msg.Updatable { @@ -198,7 +198,7 @@ func (c *Operator) onDelete(obj interface{}) { {{- if .Spec.IsCustomized}} -func incrementRollbackCount(config *config.Config, name string, namespace string) error { +func incrementRollbackCount(config config.Config, name string, namespace string) error { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.{{.Spec.PluralName}}(namespace).Get(name, metav1.GetOptions{}) @@ -218,7 +218,7 @@ func incrementRollbackCount(config *config.Config, name string, namespace string return nil } -func updateStatus(config *config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.{{.Spec.Kind}}, error) { +func updateStatus(config config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.{{.Spec.Kind}}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.{{.Spec.PluralName}}(namespace).Get(name, metav1.GetOptions{}) @@ -264,7 +264,7 @@ func updateStatus(config *config.Config, name string, namespace string, stackID return resourceCopy, nil } -func deleteStack(config *config.Config, name string, namespace string, stackID string) (*awsV1alpha1.{{.Spec.Kind}}, error) { +func deleteStack(config config.Config, name string, namespace string, stackID string) (*awsV1alpha1.{{.Spec.Kind}}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.{{.Spec.PluralName}}(namespace).Get(name, metav1.GetOptions{}) @@ -283,7 +283,7 @@ func deleteStack(config *config.Config, name string, namespace string, stackID s return resource, err } -func syncAdditionalResources(config *config.Config, s *awsV1alpha1.{{.Spec.Kind}}) (err error) { +func syncAdditionalResources(config config.Config, s *awsV1alpha1.{{.Spec.Kind}}) (err error) { clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.{{.Spec.PluralName}}(s.Namespace).Get(s.Name, metav1.GetOptions{}) if err != nil { diff --git a/code-generation/pkg/codegen/assets/template_functions.go.templ b/code-generation/pkg/codegen/assets/template_functions.go.templ index faf31ba20..479860a34 100644 --- a/code-generation/pkg/codegen/assets/template_functions.go.templ +++ b/code-generation/pkg/codegen/assets/template_functions.go.templ @@ -25,13 +25,13 @@ func New() Helpers { type Helpers struct { KubernetesResourceName func(string) (string) {{- range $index, $element := .Items }} - Get{{$element.Spec.Kind}}ByName func(*config.Config, string, string) (interface{}, error) + Get{{$element.Spec.Kind}}ByName func(config.Config, string, string) (interface{}, error) {{- end}} } {{- range $index, $element := .Items }} // Get{{$element.Spec.Kind}}ByName will find the resource by name -func Get{{$element.Spec.Kind}}ByName(config *config.Config, name string, namespace string) (interface{}, error) { +func Get{{$element.Spec.Kind}}ByName(config config.Config, name string, namespace string) (interface{}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.{{$element.Spec.PluralName}}(namespace).Get(name, metav1.GetOptions{}) diff --git a/code-generation/pkg/codegen/templates.go b/code-generation/pkg/codegen/templates.go index 66ffaf28b..40d4407c6 100644 --- a/code-generation/pkg/codegen/templates.go +++ b/code-generation/pkg/codegen/templates.go @@ -93,7 +93,7 @@ func awsServiceOperatorYamlTempl() (*asset, error) { return a, nil } -var _baseGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x93\xbf\xae\x9b\x30\x14\x87\xe7\xf8\x29\x8e\xa2\xab\x0a\x10\x98\x1d\xb5\x53\xbb\x74\x68\xaa\xf6\x0e\x1d\xaa\x0e\xc6\xf7\xc4\x17\x25\xd8\xd4\x3e\x34\x54\xc8\xef\x5e\xd9\x40\x43\x86\x2b\x92\xe9\xc4\xff\x7f\xdf\x97\x43\x27\xe4\x49\x28\x84\x5a\x38\x64\xac\x69\x3b\x63\x09\x12\x06\xb0\x97\x46\x13\x0e\xb4\x0f\xbf\x55\x43\xaf\x7d\xcd\xa5\x69\x4b\x71\x71\x67\x51\xbb\x50\x0b\x87\xf6\x4f\x23\xb1\x30\x1d\x5a\x41\xc6\x96\xdd\x49\x95\xd2\xe8\x63\xa3\x1e\x3e\xf6\xbb\xc7\x1e\x5b\xa1\x85\x42\x1b\x0e\x8f\x63\x01\x56\x68\x85\xf0\xd4\xe8\x17\x1c\x72\x78\xc2\x33\xb6\xa8\x09\xaa\x0f\xc0\x3f\x13\xb6\xce\xfb\x47\x5f\x59\x06\xae\x1c\xc7\xe5\x3e\xfe\xdc\xa1\xe4\xdf\xd1\x99\xde\x4a\xe4\x07\xd1\xa2\xf7\x4b\x04\xd4\x2f\xde\xb3\x94\x31\xfa\xdb\x4d\x96\xc0\x91\xed\x25\xc1\xc8\x00\x26\x56\xc8\xa6\xca\x3f\xc6\xc2\x00\x22\xcc\x97\x09\x06\xb2\x35\x1a\xff\xb6\x5a\x7a\x04\x73\x23\x2f\x64\x1b\x1b\xf8\xd7\x19\xfd\x06\xcc\x33\x76\xec\xb5\x84\x03\x5e\x92\xb7\x78\xf2\xfb\x81\x72\x96\x42\x16\x25\x05\x3b\x16\xa9\xb7\x1a\xde\x85\x89\x30\x5e\xee\xaf\xe6\x9a\xc7\xb9\xf5\xd5\xd5\xcd\x68\x5a\xbf\xdb\xd0\xa6\xa3\x6a\x6b\x03\x3f\xe0\x65\xd1\x94\xcc\x19\x6f\x12\xa5\xd7\x48\x93\x3f\x80\xab\xc3\xa4\x9e\xd8\x53\xf8\x21\x48\xbe\x26\x92\x06\x98\x3f\xa2\x60\x32\xd4\x1c\xb4\x68\xd1\x75\x42\xc6\x36\x6a\xb4\x4a\xa3\xa9\xbb\x19\x9b\x23\x84\x4e\x8f\xff\xce\x12\xde\xfd\xdc\x6f\x35\xf3\xaf\xf8\xca\x4e\x19\xa8\xf9\x96\x83\x67\x12\x96\xfe\x13\xac\x12\xa7\x91\x76\x77\x85\x67\xbb\xf7\x85\xa4\x81\x7f\x32\x1a\x93\x94\xf9\x7f\x01\x00\x00\xff\xff\x51\xa9\xcf\x48\x4c\x04\x00\x00") +var _baseGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x93\x3f\xcf\x9b\x30\x10\x87\xe7\xf8\x53\x9c\xa2\x57\x15\x44\x60\x76\xd4\x4e\xed\xd2\xa1\xa9\xda\x77\xe8\x50\x75\x30\xce\xc5\x41\x09\x36\xb5\x8f\x86\x0a\xf9\xbb\x57\x36\xd0\x90\xe1\x15\xc9\x74\xf1\xff\xdf\xf3\xe4\x68\x85\x3c\x0b\x85\x50\x09\x87\x8c\xd5\x4d\x6b\x2c\x41\xc2\x00\xb6\xd2\x68\xc2\x9e\xb6\xe1\xb7\xaa\xe9\xd4\x55\x5c\x9a\xa6\x10\x57\x77\x11\x95\x0b\x35\x77\x68\xff\xd4\x12\x73\xd3\xa2\x15\x64\x6c\xd1\x9e\x55\x21\x8d\x3e\xd6\xea\xe9\x63\xbf\x3b\xec\xb0\x11\x5a\x28\xb4\xe1\xf0\x30\xe4\x60\x85\x56\x08\x2f\xb5\x3e\x60\x9f\xc1\x0b\x5e\xb0\x41\x4d\x50\x7e\x00\xfe\x99\xb0\x71\xde\x3f\xfb\xca\x3c\x70\xc5\x30\xcc\xf7\xf1\xd7\x16\x25\xff\x8e\xce\x74\x56\x22\xdf\x8b\x06\xbd\x9f\x23\xa0\x3e\x78\xcf\x52\xc6\xe8\x6f\x3b\x5a\x02\x47\xb6\x93\x04\x03\x03\x18\x59\xa7\xc2\x3f\xc6\xc2\x00\x22\xcb\x97\x91\x05\x76\x4b\x32\xfe\x6d\xb1\xf4\x0c\xe5\x4a\x5c\xd8\xad\x6c\xe0\x5f\x27\xf2\x3b\x2e\xcf\xd8\xb1\xd3\x12\xf6\x78\x4d\xde\xc0\xc9\x1e\xe7\xc9\x58\x0a\xbb\xa8\x28\xb8\xb1\x48\x9d\xd5\xf0\x2e\x4c\x84\xf1\x7c\x7d\x39\xd5\x2c\xce\x2d\xaf\x2e\xef\x46\xe3\xfa\xc3\x82\x56\x15\x95\x6b\x1b\xf8\x1e\xaf\xb3\xa5\x64\xca\x78\x97\x28\xbd\x45\x1a\xf5\x01\xdc\x14\x26\xd5\xc8\x9e\xc2\x0f\x41\xf2\x94\x48\xea\x61\xfa\x84\x82\xc9\x50\x33\xd0\xa2\x41\xd7\x0a\x19\x9b\xa8\xd6\x2a\x8d\xa6\x1e\x66\xac\x8f\x10\xfa\x3c\xfe\x3b\x73\x78\xf7\x73\xbb\xd6\xca\xbf\xe2\x2b\x1b\x65\xa0\xe2\x6b\x0e\x5e\x49\x58\xfa\x4f\xb0\x48\x9c\x46\xda\xcd\x0d\x9e\x6d\xde\xe7\x92\x7a\xfe\xc9\x68\x4c\x52\xe6\xff\x05\x00\x00\xff\xff\x59\xfb\x37\x1f\x4a\x04\x00\x00") func baseGoTemplBytes() ([]byte, error) { return bindataRead( @@ -108,12 +108,12 @@ func baseGoTempl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "base.go.templ", size: 1100, mode: os.FileMode(436), modTime: time.Unix(1543370651, 0)} + info := bindataFileInfo{name: "base.go.templ", size: 1098, mode: os.FileMode(436), modTime: time.Unix(1543405073, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _cftGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x59\x6d\x6f\x9b\xc8\x13\x7f\x0d\x9f\x62\xfe\x56\xd5\x3f\x44\x0e\xbe\xbe\xb5\x2e\x27\xf5\x9a\x3e\x44\xad\x92\x2a\x76\xdb\x17\x51\xd4\xae\x61\x8c\xb7\xc1\x2c\xc7\x2e\xf1\xf9\x2c\xbe\xfb\x69\x1f\x30\x0b\x36\x76\xdc\xf6\xda\xeb\xc9\xa8\x95\x61\x99\xf9\xcd\xe3\xce\xec\x84\xc1\x00\x7e\xd3\x17\x9c\x5f\xc1\xe5\xd5\x18\x9e\x9f\x5f\x8c\x61\xfc\xea\x62\x04\x2f\x2e\xde\x3c\x87\x5f\xd7\x97\x3b\x18\xc0\x78\x46\x39\x4c\x69\x82\x40\x39\x90\x42\xb0\x18\x53\xcc\x89\xc0\x08\xee\x29\x81\x4f\x64\xc1\x4f\x59\x26\x57\x58\x7e\x1a\xb2\x08\x63\x4c\x21\xcb\x59\x88\x9c\x7f\x92\x00\x17\x53\x58\xb2\xe2\xff\x11\x24\xf4\x0e\x41\xcc\x10\xc2\x19\x49\x63\x04\x92\x2e\xc5\x8c\xa6\x31\x90\x09\x2b\x04\x88\xb5\xa0\x39\xb9\x43\xc0\x88\x0a\x0e\x82\x29\x8e\x40\xe0\x3c\x4b\x24\x9a\xd6\x24\x55\xab\xd9\x5d\x3c\x30\x12\x07\x84\x73\x14\x1c\x22\x9a\x63\x28\x58\xbe\x0c\x5c\x37\x23\xe1\x1d\x89\x11\x56\xab\x60\x94\x61\x18\x5c\x23\x67\x45\x1e\x62\x70\x49\xe6\x58\x96\xae\x4b\xe7\x19\xcb\x05\x78\xae\xd3\xc3\x3c\x67\x39\xef\xb9\x4e\x2f\xa6\x62\x56\x4c\x82\x90\xcd\x07\x64\xc1\xe5\xff\x53\x1e\xdd\x9d\xc6\x4c\xde\xee\x26\xe0\x98\xdf\xd3\x10\x07\x61\xc2\x8a\x68\xca\xf2\x39\x11\x94\xa5\x3d\xd7\x21\x0b\xfe\xfe\x09\x49\xb2\x19\x79\x02\x2d\xfe\x84\x4c\x0c\x86\x66\x5e\xfb\x72\x20\xad\x23\x19\xe5\x83\xf6\x9b\x40\x8a\xbd\x37\x78\x9b\x1a\xed\x46\x0c\x59\x3a\xa5\xf1\xa1\x5c\x33\x4c\x32\x94\xfe\xf1\x5d\x19\x84\x4b\x5c\x40\x95\x06\x1c\x08\xa4\xb8\x00\x36\xf9\x8c\xa1\x70\xa7\x45\x1a\xca\xf7\x9e\x16\x04\x27\xfa\x37\x78\xa6\x7e\xfa\x5d\xc1\x80\x13\xcb\x47\x41\x45\xf4\x9a\xa6\x51\x59\xf6\x41\xb0\x8c\x86\x4f\xaf\x2f\x81\x8b\x9c\xa6\xb1\x0f\x27\xcf\x1a\x2e\x86\x95\xeb\xe4\x28\x8a\x3c\x85\xc7\xcd\x37\x2b\xd7\x71\x9a\x68\xc3\x2e\x15\xfa\xae\xe3\x68\x65\x87\x8e\xbc\xf4\x7d\xdf\x05\x80\xb5\x02\x43\xd0\x57\xf5\xdc\x77\x9d\xd2\x2d\x95\x4f\x5a\x1a\x45\x38\xa5\x29\x72\x95\xa7\x5d\x36\x87\x53\xc1\x5d\xb1\xcc\xb0\xcd\xcc\x45\x5e\x84\x42\x5a\x65\xbc\x58\x5d\x4d\x6f\xba\x2d\xd3\x76\x39\xd1\xad\x95\x36\x58\xda\x97\x46\xfb\x91\x20\xe1\x9d\x54\x0b\xb4\x1f\xb5\xe2\xa9\x5c\x60\x53\x75\xcf\x25\x05\x4c\x08\xc7\x08\x98\xde\x7f\xad\xad\xaf\x54\x52\xf1\xf7\x78\x3b\x42\x7e\x2d\xc1\xf3\x8d\x68\x2b\x6a\x26\xbf\x82\x9a\x88\x07\x95\xa9\x49\xc1\x05\xe6\x72\xb1\x0f\xbd\x0e\x57\xf6\xfa\xc0\x5b\x06\x07\x9a\x63\xeb\x32\xcf\x48\x88\xbe\x31\xfd\x25\x8a\xab\x42\x64\x85\xe0\xc6\x76\xcb\x5c\x66\x5e\x4c\x73\x36\x57\xcb\xe7\xc8\xc3\x9c\x4e\x50\x29\xca\x21\x24\x49\xd2\x6d\x72\x8d\xec\xf9\xe0\xcd\x49\x76\xa3\x0d\xbf\xd5\x3f\x7d\x50\x55\xc7\x97\x7e\xa8\x04\x0d\xcf\x60\x83\x6e\x55\xba\x0e\x47\xae\x5e\xae\xdd\xf2\xf4\xc3\x68\x84\x9c\x53\x96\xba\x0e\xbf\x0f\xe5\xbb\x66\xd9\x09\xe4\x26\x94\x6c\xbe\xeb\x3a\xca\x9a\x8b\xb4\x12\xd1\xa2\x6c\x1a\xa5\xc8\xe4\xbe\x59\x07\x43\x66\x3d\x59\xc8\xe8\x48\x75\x3c\x3b\x4c\xbe\xaf\xb6\x40\x65\x80\x32\x49\xe9\x79\x1f\xb6\x60\xbd\xc7\x96\x12\xbe\xeb\xd0\xa9\xa2\xfd\xdf\x19\xa4\x34\x91\x2e\xa8\x72\x21\xa5\x89\x82\x91\xb8\x8e\x2c\x36\x4c\x00\x2f\x72\x04\x3a\xd5\x3d\x82\x72\xc0\x7b\xd9\x64\x18\xe7\x74\x92\xa0\xc2\x4a\x30\xf5\xb4\x0e\x5a\x3b\xee\x4b\xe8\x27\xdb\x80\x59\xce\x95\x73\x7a\x29\xd3\x61\xae\x02\x8f\x11\x2c\xa8\x98\x81\x98\x11\x61\x12\x40\xee\x80\x9e\xaf\x4d\x9c\xb2\x1c\x3e\xf6\x65\x4e\x48\x0b\x73\xd5\xc3\x1a\x22\x6f\x7e\xb9\x0d\xaa\x54\x92\x72\x4d\x50\x6f\x4e\x58\x21\xcc\x8b\xd7\xb8\xbc\x85\x33\xb0\x56\xde\x93\xa4\x40\x2d\xc0\xe8\x69\xd8\xb4\x13\x4c\x71\xc9\x91\x08\xed\x48\x58\xd0\x24\x81\x50\x2d\x58\x99\x6a\x14\x47\xe0\x45\x96\x25\x14\x23\xc8\x48\x4e\xe6\xbc\x3b\x3b\x2d\x4c\x99\x9e\x5a\x2a\x9c\xb4\x72\xc3\xa2\xba\xb2\x42\x5c\x67\xee\x57\x66\x66\x38\x55\xad\x5d\x1a\x33\x3c\x5b\xd7\x81\x97\x28\x94\xba\x2f\x2a\x9e\xb1\x21\x5a\xd7\x85\xc3\x6a\x41\xf5\x38\x5e\x66\x58\x96\xc1\x76\xec\x8e\x82\xf1\x60\x5e\x53\x55\xf6\xed\x36\xcb\xa3\x87\x6f\x35\xa7\x12\xf8\xee\xfa\xcd\xd0\xa6\xac\xfd\xa8\xc8\x2e\x99\xa0\x53\x1a\x2a\x89\x4f\xaf\x2f\xf9\x10\x6e\x6e\x4f\x4c\x39\x71\x1d\xc7\x69\xc8\xa8\x1a\x83\xe2\x2c\xfb\x55\x32\x6a\xaf\xaa\xa6\x60\x85\x46\xab\xff\x56\x26\x97\xd7\xbb\xb6\x88\xba\x6a\xb0\x5f\x63\xbd\xc7\x5c\xe6\xc5\x5e\x38\x43\xb7\x0d\xb1\x45\xe2\xbb\x4e\x5a\xb9\xbe\x13\x76\x1d\x9c\x2e\x15\x4d\xe4\x9c\xb0\xee\x35\x9d\x60\x56\x3f\x52\x70\x9b\x6d\xca\x77\x57\xab\x53\x53\x1f\x1e\x09\x96\x49\x28\x2d\xf2\x77\x16\x2d\x83\x51\x38\xc3\x39\x09\xde\xe6\xb2\x75\x0a\x8a\xbc\x2c\x65\x23\x3f\x95\xf5\x6d\xcb\xaa\xc1\x49\x91\xcb\x23\xb7\x84\x6a\xd0\xd4\xac\x26\x33\xe8\x5f\x18\x69\x5e\x29\x3b\x78\x8d\xcb\xb2\x5c\xad\x0c\xbf\x7e\x94\x94\x12\xa9\x57\xaf\x57\x69\x55\x96\x3d\x8d\x88\x09\xc7\x87\xc3\xc8\x7f\x65\x19\x5c\x4d\x3e\x07\xab\xd5\xa3\xc6\x7e\x31\x00\x23\x75\xa4\x51\x7c\x2a\x02\xf5\xa3\x62\xed\xd5\x82\xd3\x7d\xea\xab\x8a\xb9\xee\x34\x55\x90\x6a\xf3\xbd\x3d\x3a\xf7\xd7\x3c\xe7\x44\x90\xd5\xd5\xe4\xf3\x50\xa5\xc5\xa3\xe6\xa1\x53\x9f\xb1\x86\x50\x57\x9c\x57\x9a\x6d\xb8\xe6\x97\x85\xcc\x2f\x77\x35\x33\xab\x2d\xca\x6d\x05\xb0\x43\xb7\xce\x94\xdb\x0c\x93\xa2\xef\xf5\xad\x73\x93\xdc\xca\x74\xba\xdc\x65\xbb\xf2\x9b\xef\xb7\xdc\x6c\x87\x5a\x25\x92\x87\x7f\xa8\xb4\x55\x01\x84\x9e\x5d\x07\x7a\x7e\x3b\x34\xbb\x74\x56\x18\x7b\x15\xde\xf0\xbc\x2e\x1a\x7e\x43\xb7\x07\x65\xb9\xc9\x47\xa7\x2d\x7b\x67\x4e\x5b\x4c\x07\x25\xf1\xfe\xac\x3d\x28\x4d\x7f\x70\x5e\x7e\xe3\x98\x6e\xb8\x61\x5b\xd6\xa9\xdb\xfa\xce\x75\xd4\x81\x05\x05\xe6\xaa\x6b\xde\xdc\xb6\x8f\x22\x6f\xab\xf7\xf2\x40\x6c\x11\x9f\x01\xc9\x32\x4c\x23\xaf\x5e\xeb\x83\x9d\xb6\xfe\xc3\xc9\xeb\xb6\xb2\x8f\x23\xb5\xfa\xc6\x3e\xda\xf0\x07\x35\x87\xbd\x8a\xed\xa8\x16\xdd\x75\xe2\x10\x50\xbf\x2b\xd8\xd6\x19\x29\x18\xa1\x58\xc7\x96\x5b\x50\x7e\xeb\x18\x32\x26\xf1\x66\x6e\x8e\x49\xfc\xa5\xe7\x90\xfd\x78\x5f\x76\x10\xe9\xc6\xfd\x92\x93\x48\x37\xda\x43\x8e\x22\xae\x23\x48\xdc\xb1\xa1\xc6\x44\xcd\x96\x8a\x60\x1d\x49\xf9\xd4\xdc\x3e\x63\x12\xfb\xbb\xa9\x6a\x7f\x76\x10\xda\xae\xe9\x20\x69\x5a\xec\x6f\xa6\xc8\x98\xc4\x5c\xd1\xfa\xae\x0b\x76\x01\x03\x3d\x6e\xda\xf3\x4c\x6b\xd6\xd4\x45\xcf\xcc\x52\xef\xb2\xa8\x39\x4b\x15\x6a\x41\x0d\x4f\xf8\x27\xe5\x82\xa6\xb1\x1e\xaa\xba\x67\x27\x0b\xc3\xd3\xec\xd1\xae\x3f\xbe\x74\x8f\x57\x16\xd0\xcf\x33\x5e\x19\x8b\x0f\x99\xaa\x0e\x66\x79\xe0\x30\x65\xf9\xef\x38\x4c\x1d\x87\xa9\xe3\x30\xf5\x6f\x18\xa6\xcc\x66\xff\x0e\x47\xd5\xe3\x04\xf5\x4f\x4c\x50\xf0\x5f\x9a\xa0\xbe\x5f\x32\x1e\xe7\xa6\xe3\xdc\x74\x9c\x9b\x8e\x73\xd3\x4f\x36\x37\xd9\xb3\xcc\xae\xb9\xe9\x1c\x13\x6c\xcc\x4d\x91\x5a\xa8\xbf\x41\x75\x8f\x4b\x16\xab\xe7\x83\xf7\x4d\x27\x9c\x7d\x9f\x36\xd7\x92\xf5\x7c\x50\x6e\xf8\xc7\xfe\xe6\x6c\x0f\x08\xd2\x5b\x1f\x6d\x47\xd9\x56\xec\x72\xd4\x07\x42\xc5\xbb\x54\xd0\x44\x91\x6a\xae\xe8\x50\x97\x6d\x05\xf9\xee\xce\xfb\xea\xef\xc2\x60\xf9\x6f\x9b\x49\xcf\xd8\x3c\x93\xbf\x9d\x0e\xfd\x3b\x00\x00\xff\xff\xdd\xfa\xa4\x1b\xae\x24\x00\x00") +var _cftGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x59\x6d\x6f\x9b\xc8\x13\x7f\x0d\x9f\x62\xfe\x56\xd5\x3f\x44\x0e\xbe\xbe\xb5\x2e\x27\xf5\x9a\x3e\x44\xad\x92\x2a\x76\xdb\x17\x51\xd4\xae\x61\x8c\xb7\xc1\x2c\xc7\x2e\xf1\xf9\x2c\xbe\xfb\x69\x1f\x30\x0b\x36\x76\xdc\xf6\xda\xeb\xc9\xa8\x95\x61\x99\xf9\xcd\xe3\xce\xec\x84\xc1\x00\x7e\xd3\x17\x9c\x5f\xc1\xe5\xd5\x18\x9e\x9f\x5f\x8c\x61\xfc\xea\x62\x04\x2f\x2e\xde\x3c\x87\x5f\xd7\x97\x3b\x18\xc0\x78\x46\x39\x4c\x69\x82\x40\x39\x90\x42\xb0\x18\x53\xcc\x89\xc0\x08\xee\x29\x81\x4f\x64\xc1\x4f\x59\x26\x57\x58\x7e\x1a\xb2\x08\x63\x4c\x21\xcb\x59\x88\x9c\x7f\x92\x00\x17\x53\x58\xb2\xe2\xff\x11\x24\xf4\x0e\x41\xcc\x10\xc2\x19\x49\x63\x04\x92\x2e\xc5\x8c\xa6\x31\x90\x09\x2b\x04\x88\xb5\xa0\x39\xb9\x43\xc0\x88\x0a\x0e\x82\x29\x8e\x40\xe0\x3c\x4b\x24\x9a\xd6\x24\x55\xab\xd9\x5d\x3c\x30\x12\x07\x84\x73\x14\x1c\x22\x9a\x63\x28\x58\xbe\x0c\x5c\x37\x23\xe1\x1d\x89\x11\x56\xab\x60\x94\x61\x18\x5c\x23\x67\x45\x1e\x62\x70\x49\xe6\x58\x96\xae\x4b\xe7\x19\xcb\x05\x78\xae\xd3\xc3\x3c\x67\x39\xef\xb9\x4e\x2f\xa6\x62\x56\x4c\x82\x90\xcd\x07\x64\xc1\xe5\xff\x53\x1e\xdd\x9d\xc6\x4c\xde\xee\x26\xe0\x98\xdf\xd3\x10\x07\x61\xc2\x8a\x68\xca\xf2\x39\x11\x94\xa5\x3d\xd7\x21\x0b\xfe\xfe\x09\x49\xb2\x19\x79\x02\x2d\xfe\x84\x4c\x0c\x86\x66\x5e\xfb\x72\x20\xad\x23\x19\xe5\x83\xf6\x9b\x40\x8a\xbd\x37\x78\x9b\x1a\xed\x46\x0c\x59\x3a\xa5\xf1\xa1\x5c\x33\x4c\x32\x94\xfe\xf1\x5d\x19\x84\x4b\x5c\x40\x95\x06\x1c\x08\xa4\xb8\x00\x36\xf9\x8c\xa1\x70\xa7\x45\x1a\xca\xf7\x9e\x16\x04\xfa\x27\x78\xa6\x7e\xfa\x5d\xb1\x80\x13\xcb\x45\x41\x45\xf4\x9a\xa6\x51\x59\xf6\x41\xb0\x8c\x86\x4f\xaf\x2f\x81\x8b\x9c\xa6\xb1\x0f\x27\xcf\x1a\x1e\x86\x95\xeb\xe4\x28\x8a\x3c\x85\xc7\xcd\x37\x2b\xd7\x71\x9a\x68\xc3\x2e\x15\xfa\xae\xe3\x68\x65\x87\x8e\xbc\xf4\x7d\xdf\x05\x80\xb5\x02\x43\xd0\x57\xf5\xdc\x77\x9d\xd2\x2d\x95\x4b\x5a\x1a\x45\x38\xa5\x29\x72\x95\xa6\x5d\x36\x87\x53\xc1\x5d\xb1\xcc\xb0\xcd\xcc\x45\x5e\x84\x42\x5a\x65\x9c\x58\x5d\x0d\x67\xba\x2d\xcb\x76\xf9\xd0\xad\x75\x36\x50\xda\x95\x46\xf9\x91\x20\xe1\x9d\xd4\x0a\xb4\x1b\xb5\xde\xa9\x5c\x60\x53\x75\xcf\x25\x05\x4c\x08\xc7\x08\x98\xde\x7d\xad\x8d\xaf\x54\x52\xd1\xf7\x78\x3b\x40\x7e\x2d\xc1\xf3\x8d\x68\x2b\x68\x26\xbb\x82\x9a\x88\x07\x95\xa9\x49\xc1\x05\xe6\x72\xb1\x0f\xbd\x0e\x4f\xf6\xfa\xc0\x5b\x06\x07\x9a\x63\xeb\x32\xcf\x48\x88\xbe\x31\xfd\x25\x8a\xab\x42\x64\x85\xe0\xc6\x76\xcb\x5c\x66\x5e\x4c\x73\x36\x57\xcb\xe7\xc8\xc3\x9c\x4e\x50\x29\xca\x21\x24\x49\xd2\x6d\x72\x8d\xec\xf9\xe0\xcd\x49\x76\xa3\x0d\xbf\xd5\x3f\x7d\x50\x35\xc7\x97\x7e\xa8\x04\x0d\xcf\x60\x83\x6e\x55\xba\x0e\x47\xae\x5e\xae\xdd\xf2\xf4\xc3\x68\x84\x9c\x53\x96\xba\x0e\xbf\x0f\xe5\xbb\x66\xd1\x09\xe4\x16\x94\x6c\xbe\xeb\x3a\xca\x9a\x8b\xb4\x12\xd1\xa2\x6c\x1a\xa5\xc8\xe4\xb6\x59\x07\x43\x26\x3d\x59\xc8\xe8\x48\x75\x3c\x3b\x4c\xbe\xaf\x76\x40\x65\x80\x32\x49\xe9\x79\x1f\xb6\x60\xbd\xc7\x96\x12\xbe\xeb\xd0\xa9\xa2\xfd\xdf\x19\xa4\x34\x91\x2e\xa8\x72\x21\xa5\x89\x82\x91\xb8\x8e\x2c\x35\x4c\x00\x2f\x72\x04\x3a\xd5\x1d\x82\x72\xc0\x7b\xd9\x62\x18\xe7\x74\x92\xa0\xc2\x4a\x30\xf5\xb4\x0e\x5a\x3b\xee\x4b\xe8\x27\xdb\x80\x59\xce\x95\x73\x7a\x29\xd3\x61\xae\x02\x8f\x11\x2c\xa8\x98\x81\x98\x11\x61\x12\x40\xee\x80\x9e\xaf\x4d\x9c\xb2\x1c\x3e\xf6\x65\x4e\x48\x0b\x73\xd5\xc1\x1a\x22\x6f\x7e\xb9\x0d\xaa\x54\x92\x72\x4d\x50\x6f\x4e\x58\x21\xcc\x8b\xd7\xb8\xbc\x85\x33\xb0\x56\xde\x93\xa4\x40\x2d\xc0\xe8\x69\xd8\xb4\x13\x4c\x6d\xc9\x91\x08\xed\x48\x58\xd0\x24\x81\x50\x2d\x58\x99\x6a\x14\x47\xe0\x45\x96\x25\x14\x23\xc8\x48\x4e\xe6\xbc\x3b\x3b\x2d\x4c\x99\x9e\x5a\x2a\x9c\xb4\x72\xc3\xa2\xba\xb2\x42\x5c\x67\xee\x57\x66\x66\x38\x55\x8d\x5d\x1a\x33\x3c\x5b\xd7\x81\x97\x28\x94\xba\x2f\x2a\x9e\xb1\x21\x5a\xd7\x85\xc3\x6a\x41\xf5\x38\x5e\x66\x58\x96\xc1\x76\xec\x8e\x82\xf1\x60\x5e\x53\x55\xf6\xed\x36\xcb\xa3\x87\x6f\x35\xa7\x12\xf8\xee\xfa\xcd\xd0\xa6\xac\xfd\xa8\xc8\x2e\x99\xa0\x53\x1a\x2a\x89\x4f\xaf\x2f\xf9\x10\x6e\x6e\x4f\x4c\x39\x71\x1d\xc7\x69\xc8\xa8\x1a\x83\xe2\x2c\xfb\x55\x32\x6a\xaf\xaa\xa6\x60\x85\x46\xab\xff\x56\x26\x97\xd7\xbb\xb6\x88\xba\x6a\xb0\x5f\x63\xbd\xc7\x5c\xe6\xc5\x5e\x38\x43\xb7\x0d\xb1\x45\xe2\xbb\x4e\x5a\xb9\xbe\x13\x76\x1d\x9c\x2e\x15\x4d\xe4\x9c\xb0\xee\x35\x9d\x60\x56\x3f\x52\x70\x9b\x6d\xca\x77\x57\xab\x53\x53\x1f\x1e\x09\x96\x49\x28\x2d\xf2\x77\x16\x2d\x83\x51\x38\xc3\x39\x09\xde\xe6\xb2\x75\x0a\x8a\xbc\x2c\x65\x23\x3f\x95\xf5\x6d\xcb\xaa\xc1\x49\x91\xcb\x03\xb7\x84\x6a\xd0\xd4\xac\x26\x33\xe8\x5f\x18\x69\x5e\x29\x3b\x78\x8d\xcb\xb2\x5c\xad\x0c\xbf\x7e\x94\x94\x12\xa9\x57\xaf\x57\x69\x55\x96\x3d\x8d\x88\x09\xc7\x87\xc3\xc8\x7f\x65\x19\x5c\x4d\x3e\x07\xab\xd5\xa3\xc6\x7e\x31\x00\x23\x75\xa2\x51\x7c\x2a\x02\xf5\xa3\x62\xed\xd5\x82\xd3\x7d\xea\xab\x8a\xb9\xee\x34\x55\x90\x6a\xf3\xbd\x3d\x3a\xf7\xd7\x3c\xe7\x44\x90\xd5\xd5\xe4\xf3\x50\xa5\xc5\xa3\xe6\x99\x53\x9f\xb1\x86\x50\x57\x9c\x57\x9a\x6d\xb8\xe6\x97\x85\xcc\x2f\x77\x35\x33\xab\x2d\xca\x6d\x05\xb0\x43\xb7\xce\x94\xdb\x0c\x93\xa2\xef\xf5\xad\x73\x93\xdc\xca\x74\xba\xdc\x65\xbb\xf2\x9b\xef\xb7\xdc\x6c\x87\x5a\x25\x92\x87\x7f\xa8\xb4\x55\x01\x84\x9e\x5d\x07\x7a\x7e\x3b\x34\xbb\x74\x56\x18\x7b\x15\xde\xf0\xbc\x2e\x1a\x7e\x43\xb7\x07\x65\xb9\xc9\x47\xa7\x2d\x7b\x67\x4e\x5b\x4c\x07\x25\xf1\xfe\xac\x3d\x28\x4d\x7f\x70\x5e\x7e\xe3\x98\x6e\xb8\x61\x5b\xd6\xa9\xdb\xfa\xce\x75\xd4\x81\x05\x05\xe6\xaa\x6b\xde\xdc\xb6\x8f\x22\x6f\xab\xf7\xf2\x40\x6c\x11\x9f\x01\xc9\x32\x4c\x23\xaf\x5e\xeb\x83\x9d\xb6\xfe\xc3\xc9\xeb\xb6\xb2\x8f\x23\xb5\xfa\xc6\x3e\xda\xf0\x07\x35\x87\xbd\x8a\xed\xa8\x16\xdd\x75\xe2\x10\x50\xbf\x2b\xd8\xd6\x19\x29\x18\xa1\x58\xc7\x96\x5b\x50\x7e\xeb\x18\x32\x26\xf1\x66\x6e\x8e\x49\xfc\xa5\xe7\x90\xfd\x78\x5f\x76\x10\xe9\xc6\xfd\x92\x93\x48\x37\xda\x43\x8e\x22\xae\x23\x48\xdc\xb1\xa1\xc6\x44\xcd\x96\x8a\x60\x1d\x49\xf9\xd4\xdc\x3e\x63\x12\xfb\xbb\xa9\x6a\x7f\x76\x10\xda\xae\xe9\x20\x69\x5a\xec\x6f\xa6\xc8\x98\xc4\x5c\xd1\xfa\xae\x0b\x76\x01\x03\x3d\x6e\xda\xf3\x4c\x6b\xd6\xd4\x45\xcf\xcc\x52\xef\xb2\xa8\x39\x4b\x15\x6a\x41\x0d\x4f\xf8\x27\xe5\x82\xa6\xb1\x1e\xaa\xba\x67\x27\x0b\xc3\xd3\xec\xd1\xae\x3f\xbe\x74\x8f\x57\x16\xd0\xcf\x33\x5e\x19\x8b\x0f\x99\xaa\x0e\x66\x79\xe0\x30\x65\xf9\xef\x38\x4c\x1d\x87\xa9\xe3\x30\xf5\x6f\x18\xa6\xcc\x66\xff\x0e\x47\xd5\xe3\x04\xf5\x4f\x4c\x50\xf0\x5f\x9a\xa0\xbe\x5f\x32\x1e\xe7\xa6\xe3\xdc\x74\x9c\x9b\x8e\x73\xd3\x4f\x36\x37\xd9\xb3\xcc\xae\xb9\xe9\x1c\x13\x6c\xcc\x4d\x91\x5a\xa8\xbf\x41\x75\x8f\x4b\x16\xab\xe7\x83\xf7\x4d\x27\x9c\x7d\x9f\x36\xd7\x92\xf5\x7c\x50\x6e\xf8\xc7\xfe\xe6\x6c\x0f\x08\xd2\x5b\x1f\x6d\x47\xd9\x56\xec\x72\xd4\x07\x42\xc5\xbb\x54\xd0\x44\x91\x6a\xae\xe8\x50\x97\x6d\x05\xf9\xee\xce\xfb\xea\xef\xc2\x60\xf9\x6f\x9b\x49\xcf\xd8\x3c\x93\xbf\x9d\x0e\xfd\x3b\x00\x00\xff\xff\xd3\x02\x8f\xa7\xac\x24\x00\x00") func cftGoTemplBytes() ([]byte, error) { return bindataRead( @@ -128,12 +128,12 @@ func cftGoTempl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "cft.go.templ", size: 9390, mode: os.FileMode(436), modTime: time.Unix(1538638943, 0)} + info := bindataFileInfo{name: "cft.go.templ", size: 9388, mode: os.FileMode(436), modTime: time.Unix(1543403773, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _operatorGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\x5f\x73\xdb\xb6\xb2\x7f\x26\x3f\x05\xca\xdb\xa6\x64\xaa\x90\xcd\xdb\x1d\xcf\xf5\xed\xb8\xb6\xda\x7a\xea\xd8\x3e\xb6\xd3\x3c\x64\x32\x29\x4c\xae\x24\xc6\x24\xc0\x02\x90\x15\x57\xd5\x77\x3f\xb3\x58\x80\x22\x65\x49\x96\x9a\x4c\xcf\x99\x73\xea\x17\xf1\x0f\xb0\xd8\xdd\xdf\x6f\x17\xbb\xa0\xb3\x8c\xfd\x3f\xfd\xb1\x93\x0b\x76\x7e\x71\xc3\x86\x27\xa7\x37\xec\xe6\xa7\xd3\x6b\xf6\xc3\xe9\xd9\x90\xfd\x5f\xfb\x17\x66\x19\xbb\x99\x94\x9a\x8d\xca\x0a\x58\xa9\x19\x9f\x1a\x39\x06\x01\x8a\x1b\x28\xd8\x7d\xc9\xd9\xaf\x7c\xa6\x5f\xc8\x06\x9f\x48\xc5\xfc\xbb\x5f\x71\xe6\xe9\x88\x3d\xc8\xe9\xd7\x05\xab\xca\x3b\x60\x66\x02\x2c\x9f\x70\x31\x06\xc6\xc5\x83\x99\x94\x62\xcc\xf8\xad\x9c\x1a\x66\xda\x15\x6a\x7e\x07\x0c\x8a\xd2\x68\x66\xa4\x9d\x91\x1a\xa8\x9b\x0a\xa5\x91\x0a\xc2\x3e\x6d\xee\xc6\x59\x2e\x0b\x18\x83\xc8\xb8\xd6\x60\x34\x2b\x4a\x05\xb9\x91\xea\x21\x0d\xc3\x86\xe7\x77\x7c\x0c\x6c\x3e\x4f\xaf\x1b\xc8\xd3\x2b\xd0\x72\xaa\x72\x48\xcf\x79\x0d\x8b\x45\x18\x96\x75\x23\x95\x61\x71\x18\x44\xb9\x14\x06\x3e\x9a\x28\x0c\xe6\xf3\x17\xac\x1c\x31\x9a\x72\xaa\x8f\xa7\xda\xc8\xba\xfc\x1d\x8a\xc5\x22\x0c\x58\x0d\x86\xdf\xbf\x64\xd1\xdd\xff\xea\xb4\x94\x19\x6f\xca\x9a\xe7\x93\x52\x80\x7a\xc8\x50\x1d\xde\x94\x3a\xc3\x41\xd9\xfd\xcb\x28\x0c\xa2\x71\x69\x26\xd3\xdb\x34\x97\x75\xc6\x67\xba\xe2\xb7\x1a\x7f\x5f\x68\x50\xf7\x65\x0e\xad\xc7\xec\xdc\x09\x54\x0d\x28\x8d\xd3\x14\x8c\x2a\xc8\xbd\x3a\x20\x70\xf1\x3d\xa5\xe5\x52\x8c\xca\x71\x14\x32\xb6\xd7\xb4\xdf\xa6\x30\x85\x9a\x0b\x3e\x06\x85\x93\x7b\xee\xf8\x07\xbe\x5c\x2c\x42\xc6\x72\xa9\xa0\xef\x87\x0c\x1f\x59\xab\xfb\x2b\x96\x5c\xe4\xb2\x42\x91\x99\x36\x2a\xe7\x1a\xec\x08\x6d\x54\x29\xc6\x68\x2c\x9f\xe9\xbc\x2a\x41\x98\xfd\x14\xa5\x39\xee\x47\x83\xc9\xee\x41\xe9\x52\x0a\x28\x32\xf3\xd0\x40\x91\xad\xce\x4a\xf9\x4c\x67\xf7\x2f\x79\xd5\x4c\xf8\xde\xd8\x58\xb7\xf4\xe0\xd8\x6f\xbe\xbf\xc1\x75\x9d\xcf\x48\xf3\x17\x63\x99\x19\x29\x2b\x9d\xe5\x3c\x9f\x40\x14\x5a\x87\xfc\xe2\xd4\xdc\xcf\x25\x96\x7c\x4f\x99\xdd\x03\xd4\xb3\x9b\x9b\x52\x0a\x9d\x5e\x52\xc4\x58\x84\x23\x1f\x36\x9b\xc6\xf4\xbc\x91\x84\x18\x9c\x17\x3e\x01\x28\x68\x14\x68\x04\x86\x71\x86\xb1\xa5\x64\x55\x81\x62\xf2\xf6\x03\xe4\x86\x8d\x64\x7b\xa9\x8d\x54\xc0\x72\xbb\x06\x53\x2e\x42\x75\x88\x10\x2e\xc5\x69\xa3\xa6\xb9\x61\xf3\x30\x20\x56\x33\xfa\x7b\x4e\x77\xe9\xb1\xfd\x09\x03\x23\x9b\x32\x3f\xba\x3a\xb7\x2f\x89\x60\x61\x60\x91\x7b\x45\x84\x66\xcf\xbb\xf4\x26\x3a\xbb\x57\xe1\xc2\x5a\x70\x0e\xb3\x76\xd5\x5c\x01\x37\xd0\x55\x1f\xf5\x9e\x71\x93\xdb\xac\xb5\xd5\x00\x37\xb9\x08\x47\x53\x91\x77\xa5\xc6\xce\x82\xbe\xee\x03\xb6\xa3\x9a\x09\x7b\xde\xea\x37\x5f\x01\xd3\x47\x27\x99\x9c\x1b\x55\xb1\x83\x43\x12\x9c\x9e\xc3\xcc\xad\x3c\x60\x6e\xe5\xa3\x37\xd7\xc7\x3e\x78\x06\xec\xe5\xb7\xc9\xd2\x81\x03\xf6\xbe\x9d\x8a\x72\xd2\x2b\x18\x97\xda\x80\x8a\xa3\x0d\xc9\x34\x4a\xfa\x9e\x4e\x8f\x8a\x22\x5e\x8a\xeb\xd9\xf3\x13\x17\x45\x05\xea\x87\xa9\xc8\x63\xab\xf3\xeb\xa6\xe0\x06\x54\x92\xf4\xd3\x9d\x02\x33\x55\x82\x3d\xf3\x06\xcf\xc3\xc0\xe1\x7f\xe0\x08\xe0\x2c\x0a\x83\x0d\x8e\x68\x0d\x3a\x60\xad\x2e\x6e\xb0\x0b\xe2\x9e\xd2\x07\x3d\x14\x06\x61\xb0\x70\xac\xb8\x36\x5c\x99\x37\x08\x3c\xc1\x0f\xda\x52\xa1\x14\xda\x70\x81\x68\xcb\x11\xbb\x20\x3a\x5c\xaf\xa7\x03\x17\x05\xe3\xb9\xd1\x4c\xda\xad\xab\x26\x5e\xc4\xf9\x12\xce\xa4\xb3\x4a\x9c\x9b\x8f\xcc\x6d\x49\xc8\x10\xfc\x1d\x30\xc1\x6b\xd0\x0d\xcf\xc1\x71\x3b\x41\x06\xf8\x25\x9c\x53\x35\xe2\x66\x33\x49\x8b\xd0\xf0\x1e\x84\xe9\xf8\x5c\xa3\x1f\x8f\x8a\x02\xaf\xad\x23\xf3\x54\x8a\xa3\xa2\x40\xcf\x10\x12\xf4\x06\x1f\xd3\x3d\xbe\x39\x81\x0a\xba\x6f\xe8\xde\xfa\x28\x0c\x30\xd7\xe0\xc2\x6d\xce\x41\xba\x3d\xa6\xca\x65\x35\x55\xbc\x5a\x2c\xa2\x8e\x2d\x03\xb6\x6a\xc1\x80\xe5\xe9\x1a\x8a\xa6\x57\xc3\xeb\x1b\xba\x8b\x91\x29\xb8\x56\x4a\xde\x7a\xd6\xc9\x98\xa9\x5f\xf5\xe7\x12\x11\x9e\x2f\x06\x2c\x37\x1f\xd3\x13\x29\x00\xa7\x2d\xc2\x70\x2d\x55\xb2\x8c\x75\xa9\xc8\x66\x65\x55\x31\xc3\x5d\xc1\x52\x83\xd6\x7c\x8c\xa8\x2b\x59\xdb\x27\x96\x28\x16\xd5\x46\xc9\x1c\xb4\xee\xa0\xda\x15\xb4\x29\xdc\x6b\x3d\x5e\x89\xf2\x57\xb4\xc6\xf7\xb2\x78\x48\x18\x28\x45\x01\x5e\xc9\xf1\x98\x7c\xeb\x04\x9c\xd9\x07\x61\x70\xcf\x95\x75\xe2\x63\x5a\x84\x41\x39\x42\xf9\xa9\x55\x81\xdf\x56\x80\x82\x02\x1c\xc6\x0e\xed\x0b\x0f\x08\x86\xae\x7b\x43\x02\xe8\xf5\xb9\xbf\x0f\x83\x05\x83\x4a\xd3\x7c\xda\xae\xae\x31\x57\xd8\xe4\xd0\x6e\xdb\x08\xf6\x0f\x52\x91\x65\xce\x5e\x02\xcb\x5e\x26\x61\xd0\x92\x54\x0f\xd0\x32\x6b\x8d\x97\xd6\xe2\x45\xe4\xa0\x6c\x12\x47\x51\x92\x9e\x95\xda\xc4\x54\x6f\xd9\xeb\x8b\xc6\x6e\x40\xf3\x05\x4a\x2c\x47\x56\xd2\x17\x87\x4c\x94\x95\xd5\xcf\xb9\x2a\x7d\x53\x9a\xc9\x10\xdd\x17\x83\x52\x49\x4a\x97\x11\x39\x74\x0c\xc6\x60\xea\xde\xcc\x4c\x94\xed\x13\x0f\x28\x15\x06\x01\x26\x09\x0c\xf6\xf7\x4b\xa6\xa2\x01\xca\x96\xb0\xad\x61\xe9\xa9\x81\x5a\x93\x22\xe5\xa8\x7d\x9e\x5e\x1b\x6e\xa6\x1a\x7f\xf2\xbb\xd3\x13\x76\x48\x1e\xbe\xe4\x4a\x43\xe1\x10\x7f\x1b\xd1\xdb\x22\x7a\x47\xf3\x3d\x54\xaa\x9b\x62\xdb\x17\x1e\xa9\xde\x5b\x07\x17\x69\xbb\xa0\xa0\x2c\x47\x96\x1a\xe8\xa3\x28\x62\xcf\x9e\x75\x88\x42\x8f\x70\x31\x2e\x84\x34\xb4\xb3\xa3\x55\x35\x6f\xde\x12\x8b\xde\xd1\x8f\x55\xc8\x29\x78\x12\x1d\x6c\xd5\x7e\xb0\x1c\x8b\x3a\x6d\x19\x6d\x5f\xbb\xf1\x1e\x83\x9b\x87\x66\xc3\x94\xde\x08\x3b\x6b\x41\x0c\xd8\x32\x96\xfc\x1e\xbd\x43\x8f\x47\x57\x17\x67\x67\xdf\x1f\x1d\xff\xfc\xfe\xf8\xe2\xd5\xe5\xd9\xf0\x66\x48\xb6\x07\xf2\xf6\x43\x4b\xc8\xc2\xe6\x33\xab\x5d\xbb\x51\xae\xc4\xd7\x60\xab\xf5\x89\x83\x7e\x95\x96\x7d\x36\x59\xd5\x03\x1f\x24\x90\x4b\x55\xe0\x66\x49\x28\x40\x61\x73\xf5\x28\xb6\x8a\x75\xa0\x19\xb8\x7a\x3b\xb5\xef\xd1\x0f\x6f\xb8\x12\xa5\x18\x0f\x98\xab\xa9\xd3\x1b\x79\xcc\x6b\xa8\x62\x57\x57\xa7\x37\xf2\x4c\xce\x40\xc5\x3b\xf8\x28\x49\xd6\x5a\xd6\x1f\x76\x05\x5c\x4b\x41\x66\xba\xac\xb0\x07\x02\x27\x43\x74\xfb\x36\xff\x4f\x6d\xbe\xa4\x49\x7f\x0e\x80\x1d\x8c\xd8\x69\x50\xd7\xd2\xff\x12\x40\x03\xb4\xf1\x90\x95\x22\x57\x50\x83\x30\x57\xb2\xaa\x6e\x79\x7e\x77\x2c\xa7\xc2\x6c\x42\x63\x0f\xff\x74\xb6\x91\xbf\x41\xef\x80\x7e\x2e\x55\xcd\xab\x7f\x51\x10\x87\xb4\x4d\x38\xc3\x44\x59\x85\x8b\xb0\x53\x7e\xaf\x29\x50\x6d\x99\x88\x66\xb1\x52\x18\x50\x23\x9e\xc3\x7c\x61\xab\x50\xbb\x79\xc8\xdb\x0f\x69\xfc\x7c\x73\x2d\x96\xa4\x27\x00\xcd\xb1\x6c\x1e\xe2\x24\x6c\x7b\x17\x21\xcd\xfa\x66\xf4\xa8\x28\x6c\x23\x5a\x8e\x98\xf6\xfb\x68\xdf\x1c\x9b\x5a\x22\xf6\xc7\x1f\x5b\x07\xac\xc9\x3d\xb6\xea\x1d\x19\x54\xda\x36\x46\xa9\xe7\x9e\x2d\x3e\x7d\xab\x90\xd8\x71\x72\x6a\x9a\xa9\x59\x16\x2e\x23\x93\x1e\xdb\xde\x8e\xf6\x0a\x1a\xb4\xca\x18\xd7\x9e\xa4\xbd\xa2\x6d\x6d\x69\x32\xf2\xb5\x89\x6d\x18\xd7\x16\x27\x54\x13\xb1\xaf\xbf\xd2\x5f\x47\x03\xa6\xed\x7d\xe2\x96\x20\xf4\xec\xcd\x22\x5c\xb7\xe6\xa9\x18\xc9\x51\x1c\xf1\xa2\x80\x62\xab\x68\x36\x2b\xcd\x84\x69\x57\xa8\xf4\x16\x1b\xb8\xca\x32\x7e\x4e\xce\x70\xe5\x4c\x91\x24\xdb\x96\xbc\x2f\x61\xc6\xb8\x61\x13\x63\x1a\x7d\x90\x65\xb9\x14\x5a\x56\x90\xf2\x99\x4e\x79\xcd\x7f\x97\xc2\x9e\x6a\xe4\x95\x9c\x16\x23\x0c\x04\x84\x3d\x9b\xc8\x1a\xbe\xfb\x9f\xcc\xea\x91\x15\x60\x78\x59\x7d\x47\x4a\x15\x87\x5f\xe9\x68\x8b\x2a\x61\x10\xbc\x27\x98\x56\x13\xcb\x12\x5e\x6f\xce\xb2\x68\xda\x28\x70\xc0\xa2\xe3\xab\xe1\xd1\xcd\xf0\xfd\xe9\xf9\xfb\xcb\xab\x8b\x1f\xaf\x86\xd7\xd7\xd1\x80\x45\xd1\x86\xfa\x73\x17\xb4\x3d\xd8\x56\x3f\x04\x5b\x53\xf8\x52\x40\x22\x86\xd4\x9c\x56\xda\xf6\xaf\x1b\x8e\x60\x6c\x64\x74\xcd\xea\x35\xce\x9b\x62\x97\x3a\x92\x58\x56\xc5\x05\x26\x26\x01\xb3\x8b\x35\x91\x2c\xa5\x0d\x65\x3b\x68\xf7\x68\x0e\x84\x9d\x46\x32\xf7\x49\x02\x36\x01\xec\x17\xbc\xe8\x69\xca\x44\x42\x26\xd6\x67\x4f\xe7\x12\xb2\xdd\xa7\x13\x77\xd0\x9a\x9e\x6a\x0b\xf6\xb1\xac\x1b\x2c\xfe\x62\xb9\x41\x93\x01\x1b\xf1\x4a\x43\x82\x45\xf4\x17\xee\x68\xd6\x9a\x31\xfc\x6d\xca\x2b\x9c\xe6\x6d\xc4\xa4\xbe\x58\x0c\xd0\xa6\xfe\xa3\x64\x5b\xd6\x91\x72\xa7\xb4\xf3\xda\x93\x3a\xbf\x73\xa6\x7f\x96\xc4\xd3\x72\xf1\xe9\xec\x20\x60\xc6\x1a\xae\x78\xad\xd9\x57\xdf\xdc\xdb\xf6\x57\x56\x05\x5e\x47\xd6\x66\x8a\x2e\x21\xd1\xa4\x7d\x33\x14\x85\xec\x2e\x39\xca\x69\xe0\x52\x54\xbb\xec\x7f\x48\x8e\x92\xde\x1e\x77\xf1\x64\x96\x7a\x7d\x79\xf2\x97\x67\x29\xfa\x2e\xf0\x44\x9a\xf2\x41\xb7\xc2\x74\xa4\xee\x0e\xe9\x8a\x0e\x98\xfe\xb2\x6a\x83\x96\x43\x6b\x76\x29\x0c\x82\x4e\x58\x9e\x74\x3a\xc7\x24\x5c\xe3\xf3\xbd\xa2\xd1\xf6\xa1\x7b\x94\x01\xbe\x32\xa5\x62\x6e\x03\xcd\xa9\xb9\xdd\x1e\x5b\x5d\x99\x3b\x80\xeb\xfd\xb5\x6d\x1b\x0a\xb7\x7d\x4b\xb3\xa0\x6f\xed\x38\x1e\x1d\x9a\xd9\xe3\x0c\x0a\x84\x75\xa7\xa1\x4f\x1f\x9a\x7d\xc2\x19\x96\x3f\x6e\xd9\xf5\x04\x6b\xd9\x26\xa5\x3f\x82\x89\xa9\xa9\x71\xa7\x59\x3f\x42\xef\x30\xeb\x31\x63\x3e\xdb\x51\x56\xb7\x6b\xa1\x62\x9f\x46\x61\x58\xd8\x53\x2c\x3f\xab\xbb\x97\x77\x07\x39\xe1\x5d\x74\x3a\x67\x4f\x1b\x46\x7c\xf3\x32\x0c\x97\x79\x6e\x77\x47\xb9\x0a\xa5\x2b\xfd\xcf\xba\xa7\x4d\x5d\x5e\xd8\x1a\x77\xf4\x5b\x1f\x22\xe4\x9a\x8e\x74\x3f\x1a\x0e\xda\x12\xba\x73\x8f\xd5\x8c\xbf\x55\xb6\x07\x6b\x49\xbb\x2d\x85\x0d\x88\xd2\xc9\xdf\x9c\x5e\xc3\x69\x51\x56\x83\x4f\x22\xf6\xfa\x9a\xd3\xc1\xb5\xcb\x60\xea\xa6\x6d\x38\xe0\xc5\xfa\x29\xed\xc9\xaf\xe7\x05\x15\xbd\x9b\x4a\x50\xdd\x2f\x38\xed\xf6\xd1\xd9\x8f\x1c\x03\xbb\x0b\xf9\xbd\x9e\x0a\x03\xdd\xab\x18\x11\x14\x7a\x1c\x7f\xfa\xa1\xb9\x5b\x20\xf2\x87\x07\x36\xd7\xd3\x31\xf8\x97\x8d\x92\x0d\x2e\x4a\xb8\x5d\xb8\x1a\x25\x9f\x40\xcd\xd3\x4b\x25\x1b\x50\xa6\x04\xcd\xec\x17\x37\xb7\x29\xd8\x39\xe9\x0d\xd4\x4d\xc5\x8d\xff\xff\x8a\x60\x3e\xa7\xe7\x3f\xc3\x03\xf2\xdf\x32\xda\xfb\x6a\x39\x36\x8e\xfc\x38\xf7\x0c\xec\x47\x25\x3f\xf0\x84\x1b\x3e\xbf\xb8\xfd\x70\xb0\xe2\xa8\x63\xf7\xf1\x90\xdc\xb8\xe8\x7e\x99\xb0\x90\x39\xbd\xbd\xec\x6b\xfb\xd5\xd9\x6a\xc2\x0e\x59\x4f\x33\xff\x11\xd1\xed\x91\x7b\x88\x71\x5e\x7c\xfb\xc8\x02\x3b\x20\x7a\xb7\xf2\x79\xb2\x73\xbd\xf8\xf7\x4e\xaa\xfd\x78\xdc\x8f\xe2\x64\x93\x7e\x10\xf9\x51\x51\x94\x98\x45\x78\xe5\x63\x4d\xaf\x65\xfd\x5e\x74\xc6\x2a\xc8\xdb\x80\x8b\x74\x4d\xf0\x7c\xee\xec\x07\x7d\xd2\x74\x77\x87\xc7\x1f\x09\x3e\x6d\x73\xf8\x3b\xfd\x7f\xa6\xf4\xbf\x25\x47\xba\xfc\xe8\xc2\x66\x97\x7a\x7d\xed\x0a\xcb\xf9\x6f\x78\x69\x5e\x0b\x53\x56\x56\x04\x49\x2b\x68\x7b\xe9\xd1\x87\x26\x7b\xea\x6c\x27\xf7\x23\x1a\x69\xb6\xad\xb5\x61\xe8\xbd\x0e\x3b\xfe\x42\x12\x74\x8e\xce\x88\x06\xfe\x4c\x6d\x57\x22\x3c\xaa\xc1\xdc\x37\xd5\xf5\x7b\x36\x76\x14\xcb\x16\x62\x8d\x03\xd3\x6b\xfa\x7f\x27\xdc\x5c\xb4\xbf\x3c\x38\x64\x6f\xfd\x07\xcc\xc5\x7c\xee\x12\x68\x67\xbf\xea\x7e\xc9\xdd\x49\x74\xdb\x40\xc2\x6f\xcb\xd9\xf6\x6c\x87\x45\xc3\x8f\x06\x94\x20\x0f\x45\x34\xf4\x4b\xb5\xd2\x61\x75\xb6\x31\x3a\x3d\xee\x4e\x72\xeb\xc4\x9d\x66\x73\xed\x49\x65\xd4\x15\xdc\x15\x60\x77\xbf\xf9\x3c\x2e\x45\x01\x1f\x3b\xfa\x5d\x4a\x65\x34\xfb\x36\xb1\x17\x0b\xc4\xa3\x75\xd1\x21\xe3\x4d\x03\xa2\x88\xfd\x13\x14\xb0\xaa\x76\xaf\xa1\xeb\x5f\xee\x8a\x49\x2b\x71\xeb\xb8\x43\xe6\xd5\xf0\x68\x3d\x0d\x3c\x51\xf8\x15\x6f\x70\x19\x72\x5d\x8d\x37\x9f\x09\xfc\x9e\xf8\x75\x98\x62\x95\xb1\xf1\x9b\x79\x67\xb9\xd2\x40\x8d\xe3\x96\xf3\xed\x4c\xbb\xbd\x23\xa2\xf8\x9e\xaa\x8a\xe8\x80\xb5\x0f\x7e\xe1\xd5\xd4\xe2\xba\x5a\x04\xec\xc4\xae\x56\xf9\x27\x39\xb5\xde\xae\xc4\xff\xa7\x9d\xf5\x68\xcb\x95\xe5\xb3\x5d\xd8\xb2\x3b\x7a\x5b\x49\xd2\x19\xe9\x77\x3f\xd4\xa0\x25\xca\xee\x55\x51\x2f\x77\xad\xd4\x45\x3b\xe4\x2a\x7f\x96\xf9\xe8\x5b\xd9\x3f\x03\x00\x00\xff\xff\xdb\xc3\xc9\xb8\x4b\x2d\x00\x00") +var _operatorGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5a\x5f\x73\xdb\xb6\xb2\x7f\x26\x3f\x05\xca\xdb\xa6\x64\xaa\x90\xcd\xdb\x1d\xcf\xf5\xed\xb8\xb6\xda\x7a\xea\xd8\x3e\xb6\xd3\x3c\x64\x32\x29\x4c\xae\x24\xc6\x24\xc0\x02\x90\x15\x57\xd5\x77\x3f\xb3\x58\x80\x22\x65\x49\x96\x9a\x4c\xcf\x99\x73\xea\x17\xf1\x0f\xb0\xd8\xdd\xdf\x6f\x17\xbb\xa0\xb3\x8c\xfd\x3f\xfd\xb1\x93\x0b\x76\x7e\x71\xc3\x86\x27\xa7\x37\xec\xe6\xa7\xd3\x6b\xf6\xc3\xe9\xd9\x90\xfd\x5f\xfb\x17\x66\x19\xbb\x99\x94\x9a\x8d\xca\x0a\x58\xa9\x19\x9f\x1a\x39\x06\x01\x8a\x1b\x28\xd8\x7d\xc9\xd9\xaf\x7c\xa6\x5f\xc8\x06\x9f\x48\xc5\xfc\xbb\x5f\x71\xe6\xe9\x88\x3d\xc8\xe9\xd7\x05\xab\xca\x3b\x60\x66\x02\x2c\x9f\x70\x31\x06\xc6\xc5\x83\x99\x94\x62\xcc\xf8\xad\x9c\x1a\x66\xda\x15\x6a\x7e\x07\x0c\x8a\xd2\x68\x66\xa4\x9d\x91\x1a\xa8\x9b\x0a\xa5\x91\x0a\xc2\x3e\x6d\xee\xc6\x59\x2e\x0b\x18\x83\xc8\xb8\xd6\x60\x34\x2b\x4a\x05\xb9\x91\xea\x21\x0d\xc3\x86\xe7\x77\x7c\x0c\x6c\x3e\x4f\xaf\x1b\xc8\xd3\x2b\xd0\x72\xaa\x72\x48\xcf\x79\x0d\x8b\x45\x18\x96\x75\x23\x95\x61\x71\x18\x44\xb9\x14\x06\x3e\x9a\x28\x0c\xe6\xf3\x17\xac\x1c\x31\x9a\x72\xaa\x8f\xa7\xda\xc8\xba\xfc\x1d\x8a\xc5\x22\x0c\x58\x0d\x86\xdf\xbf\x64\xd1\xdd\xff\xea\xb4\x94\x19\x6f\xca\x9a\xe7\x93\x52\x80\x7a\xc8\x50\x1d\xde\x94\x3a\xc3\x41\xd9\xfd\xcb\x28\x0c\xa2\x71\x69\x26\xd3\xdb\x34\x97\x75\xc6\x67\xba\xe2\xb7\x1a\x7f\x5f\x68\x50\xf7\x65\x0e\xad\xc7\xec\xdc\x09\x54\x0d\x28\x8d\xd3\x14\x8c\x2a\xc8\xbd\x3a\x20\x70\xf1\x3d\xa5\xe5\x52\x8c\xca\x71\x14\x32\xb6\xd7\xb4\xdf\xa6\x30\x85\x9a\x0b\x3e\x06\x85\x93\x7b\xee\xf8\x07\xbe\x5c\x2c\x42\xc6\x72\xa9\xa0\xef\x87\x0c\x1f\x59\xab\xfb\x2b\x96\x5c\xe4\xb2\x42\x91\x99\x36\x2a\xe7\x1a\xec\x08\x6d\x54\x29\xc6\x68\x2c\x9f\xe9\xbc\x2a\x41\x98\xfd\x14\xa5\x39\xee\x47\x83\xc9\xee\x41\xe9\x52\x0a\x28\x32\xf3\xd0\x40\x91\xad\xce\x4a\xf9\x4c\x67\xf7\x2f\x79\xd5\x4c\xf8\xde\xd8\x58\xb7\xf4\xe0\xd8\x6f\xbe\xbf\xc1\x75\x9d\xcf\x48\xf3\x17\x63\x99\x19\x29\x2b\x9d\xe5\x3c\x9f\x40\x14\x5a\x87\xfc\xe2\xd4\xdc\xcf\x25\x96\x7c\x4f\x99\xdd\x03\xd4\xb3\x9b\x9b\x52\x0a\x9d\x5e\x52\xc4\x58\x84\x23\x1f\x36\x9b\xc6\xf4\xbc\x91\x84\x18\x9c\x17\x3e\x01\x28\x68\x14\x68\x04\x86\x71\x86\xb1\xa5\x64\x55\x81\x62\xf2\xf6\x03\xe4\x86\x8d\x64\x7b\xa9\x8d\x54\xc0\x72\xbb\x06\x53\x2e\x42\x75\x88\x10\x2e\xc5\x69\xa3\xa6\xb9\x61\xf3\x30\x20\x56\x33\xfa\xa3\x9b\xf4\xd8\xfe\x84\x81\x91\x4d\x99\x1f\x5d\x9d\xdb\x77\xc4\xaf\x30\xb0\xc0\xbd\x22\x3e\xb3\xe7\x5d\x76\x13\x9b\xdd\xab\x70\x61\x0d\x38\x87\x59\xbb\x68\xae\x80\x1b\xe8\x6a\x8f\x6a\xcf\xb8\xc9\x6d\xd2\xda\xaa\xbf\x9b\x5c\x84\xa3\xa9\xc8\xbb\x52\x63\x67\x40\x4f\xf5\x01\xdb\x51\xcb\x84\x3d\x6f\xd5\x9b\xaf\x40\xe9\x63\x93\x2c\xce\x8d\xaa\xd8\xc1\x21\x09\x4e\xcf\x61\xe6\x16\x1e\xf8\x95\x8f\xde\x5c\x1f\xfb\xd0\x19\xb0\x97\xdf\x26\x4b\xff\x0d\xd8\xfb\x76\x2a\xca\x49\xaf\x60\x5c\x6a\x03\x2a\x8e\x36\xa4\xd2\x28\xe9\x3b\x3a\x3d\x2a\x8a\x78\x29\xae\x67\xcf\x4f\x5c\x14\x15\xa8\x1f\xa6\x22\x8f\xad\xce\xaf\x9b\x82\x1b\x50\x49\xd2\x4f\x76\x0a\xcc\x54\x09\xf6\xcc\x1b\x3c\x0f\x03\x87\xfe\x41\x0f\xfe\x41\x18\x6c\x70\x44\x6b\xd0\x01\x6b\x75\x71\x83\x5d\x08\xf7\x94\x3e\xe8\xa1\x30\x08\x83\x85\x23\xc5\xb5\xe1\xca\xbc\x41\xdc\x09\x7d\xd0\x96\x09\xa5\xd0\x86\x0b\x04\x5b\x8e\xd8\x05\xb1\xe1\x7a\x3d\x1b\xb8\x28\x18\xcf\x8d\x66\xd2\x6e\x5c\x35\xd1\x22\xce\x97\x70\x26\x9d\x55\xe2\xdc\x7c\x64\x6e\x43\x42\x86\xe0\xef\x80\x09\x5e\x83\x6e\x78\x0e\x8e\xda\x09\x32\xc0\x2f\xe1\x9c\xaa\x11\x37\x9b\x47\x5a\x84\x86\xf7\x20\x4c\xc7\xe7\x1a\xfd\x78\x54\x14\x78\x6d\x1d\x99\xa7\x52\x1c\x15\x05\x7a\x86\x90\xa0\x37\xf8\x98\xee\xf1\xcd\x09\x54\xd0\x7d\x43\xf7\xd6\x47\x61\x80\x99\x06\x17\x6e\x33\x0e\xd2\xed\x31\x55\x2e\xab\xa9\xe2\xd5\x62\x11\x75\x6c\x19\xb0\x55\x0b\x06\x2c\x4f\xd7\x50\x34\xbd\x1a\x5e\xdf\xd0\x5d\x8c\x4c\xc1\xb5\x52\xf2\xd6\xb3\x4e\xbe\x4c\xfd\xaa\x3f\x97\x88\xf0\x7c\x31\x60\xb9\xf9\x98\x9e\x48\x01\x38\x6d\x11\x86\x6b\xa9\x92\x65\xac\x4b\x45\x36\x2b\xab\x8a\x19\xee\xca\x95\x1a\xb4\xe6\x63\x44\x5d\xc9\xda\x3e\xb1\x44\xb1\xa8\x36\x4a\xe6\xa0\x75\x07\xd5\xae\xa0\x0d\xd1\x5e\xeb\xf1\x4a\x90\xbf\xa2\x25\xbe\x97\xc5\x43\xc2\x40\x29\x8a\xef\x4a\x8e\xc7\xe4\x5a\x27\xe0\xcc\x3e\x08\x83\x7b\xae\xac\x0f\x1f\xb3\x22\x0c\xca\x11\xca\x4f\xad\x06\xfc\xb6\x02\x14\x14\xe0\x30\x76\x68\x5f\x78\x3c\x30\x72\xdd\x1b\x12\x40\xaf\xcf\xfd\x7d\x18\x2c\x18\x54\x9a\xe6\xd3\x5e\x75\x8d\xa9\xc2\xe6\x86\x76\xcf\x46\xac\x7f\x90\x8a\x2c\x73\xe6\x12\x56\xf6\x32\x09\x83\x96\xa3\x7a\x80\x96\x59\x6b\xbc\xb4\x16\x2e\xe2\x06\x25\x93\x38\x8a\x92\xf4\xac\xd4\x26\xa6\x62\xcb\x5e\x5f\x34\x76\xf7\x99\x2f\x50\x62\x39\xb2\x92\xbe\x38\x64\xa2\xac\xac\x7e\xce\x55\xe9\x9b\xd2\x4c\x86\xe8\xbe\x18\x94\x4a\x52\xba\x8c\xc8\xa1\x63\x30\x06\x13\xf7\x66\x62\xa2\x6c\x9f\x77\x40\xa9\x30\x08\x30\x47\x60\xac\xbf\x5f\x12\x15\x0d\x50\xb6\x7e\x6d\x0d\x4b\x4f\x0d\xd4\x9a\x14\x29\x47\xed\xf3\xf4\xda\x70\x33\xd5\xf8\x93\xdf\x9d\x9e\xb0\x43\xf2\xf0\x25\x57\x1a\x0a\x87\xf8\xdb\x88\xde\x16\xd1\x3b\x9a\xef\xa1\x52\xdd\x0c\xdb\xbe\xf0\x48\xf5\xde\x3a\xb8\x48\xdb\x05\xc5\x64\x39\xb2\xd4\x40\x1f\x45\x11\x7b\xf6\xac\x43\x14\x7a\x84\x8b\x71\x21\xa4\xa1\x6d\x1d\xad\xaa\x79\xf3\x96\x58\xf4\x8e\x7e\xac\x42\x4e\xc1\x93\xe8\x60\xab\xf6\x83\xe5\x58\xd4\x69\xcb\x68\xfb\xda\x8d\xf7\x18\xdc\x3c\x34\x1b\xa6\xf4\x46\xd8\x59\x0b\x62\xc0\x96\xb1\xe4\xf7\xe8\x1d\x7a\x3c\xba\xba\x38\x3b\xfb\xfe\xe8\xf8\xe7\xf7\xc7\x17\xaf\x2e\xcf\x86\x37\x43\xb2\x3d\x90\xb7\x1f\x5a\x42\x16\x36\x9d\x59\xed\xda\x7d\x72\x25\xbe\x06\x5b\xad\x4f\x1c\xf4\xab\xb4\xec\xb3\xc9\xaa\x1e\xf8\x20\x81\x5c\xaa\x02\xf7\x4a\x42\x01\x0a\x9b\xaa\x47\xb1\x55\xac\x03\xcd\xc0\x15\xdb\xa9\x7d\x8f\x7e\x78\xc3\x95\x28\xc5\x78\xc0\x5c\x41\x9d\xde\xc8\x63\x5e\x43\x15\xbb\xa2\x3a\xbd\x91\x67\x72\x06\x2a\xde\xc1\x47\x49\xb2\xd6\xb2\xfe\xb0\x2b\xe0\x5a\x0a\x32\xd3\x65\x85\x3d\x10\x38\x19\xa2\xdb\xb7\xf9\x7f\x6a\xd3\x25\x4d\xfa\x73\x00\xec\x60\xc4\x4e\x83\xba\x96\xfe\x97\x00\x1a\xa0\x8d\x87\xac\x14\xb9\x82\x1a\x84\xb9\x92\x55\x75\xcb\xf3\xbb\x63\x39\x15\x66\x13\x1a\x7b\xf8\xa7\xb3\x8d\xfc\x0d\x7a\x07\xf4\x73\xa9\x6a\x5e\xfd\x8b\x82\x38\xa4\x6d\xc2\x19\x26\xca\x2a\x5c\x84\x9d\xea\x7b\x4d\x7d\x6a\xab\x44\x34\x8b\x95\xc2\x80\x1a\xf1\x1c\xe6\x0b\x5b\x84\xda\xcd\x43\xde\x7e\x48\xe3\xe7\x9b\x4b\xb1\x24\x3d\x01\x68\x8e\x65\xf3\x10\x27\x61\xdb\xba\x08\x69\xd6\x77\xa2\x47\x45\x61\xbb\xd0\x72\xc4\xb4\xdf\x47\xfb\xe6\xd8\xd4\x12\xb1\x3f\xfe\xd8\x3a\x60\x4d\xee\xb1\x45\xef\xc8\xa0\xd2\xb6\x2f\x4a\x3d\xf7\x6c\xed\xe9\x3b\x85\xc4\x8e\x93\x53\xd3\x4c\xcd\xb2\x70\x19\x99\xf4\xd8\x76\x76\xb4\x57\xd0\xa0\x55\xc6\xb8\xee\x24\xed\x15\x6d\x6b\x4b\x93\x91\xaf\x4d\x6c\xbb\xb8\xb6\x38\xa1\x9a\x88\x7d\xfd\x95\xfe\x3a\x1a\x30\x6d\xef\x13\xb7\x04\xa1\x67\x6f\x16\xe1\xba\x35\x4f\xc5\x48\x8e\xe2\x88\x17\x05\x14\x5b\x45\xb3\x59\x69\x26\x4c\xbb\x42\xa5\xb7\xd8\xc0\x55\x96\xf1\x73\x72\x86\x2b\x67\x8a\x24\xd9\xb6\xe4\x7d\x09\x33\xc6\x0d\x9b\x18\xd3\xe8\x83\x2c\xcb\xa5\xd0\xb2\x82\x94\xcf\x74\xca\x6b\xfe\xbb\x14\xf6\x48\x23\xaf\xe4\xb4\x18\x61\x20\x20\xec\xd9\x44\xd6\xf0\xdd\xff\x64\x56\x8f\xac\x00\xc3\xcb\xea\x3b\x52\xaa\x38\xfc\x4a\x47\x5b\x54\x09\x83\xe0\x3d\xc1\xb4\x9a\x58\x96\xf0\x7a\x73\x96\x45\xd3\x46\x81\x03\x16\x1d\x5f\x0d\x8f\x6e\x86\xef\x4f\xcf\xdf\x5f\x5e\x5d\xfc\x78\x35\xbc\xbe\x8e\x06\x2c\x8a\x36\xd4\x9f\xbb\xa0\xed\xc1\xb6\xfa\x21\xd8\x9a\xc2\x97\x02\x12\x31\xa4\xde\xb4\xd2\xb6\x7d\xdd\x70\xfe\x62\x23\xa3\x6b\x56\xaf\x6f\xde\x14\xbb\xd4\x90\xc4\xb2\x2a\x2e\x30\x31\x09\x98\x5d\xac\x89\x64\x29\x6d\x28\xdb\x41\xbb\x47\x73\x20\xec\x34\x92\xb9\x4f\x12\xb0\x09\x60\xbf\xe0\x45\x4f\x53\x26\x12\x32\xb1\x3e\x7b\x3a\x97\x90\xed\x3e\x9d\xb8\x53\xd6\xf4\x54\x5b\xb0\x8f\x65\xdd\x60\xf1\x17\xcb\x0d\x9a\x0c\xd8\x88\x57\x1a\x12\x2c\xa2\xbf\x70\xe7\xb2\xd6\x8c\xe1\x6f\x53\x5e\xe1\x34\x6f\x23\x26\xf5\xc5\x62\x80\x36\xf5\x1f\x25\xdb\xb2\x8e\x94\x3b\xa5\x9d\xd7\x9e\xd4\xf9\x9d\x33\xfd\xb3\x24\x9e\x96\x8b\x4f\x67\x07\x01\x33\xd6\x70\xc5\x6b\xcd\xbe\xfa\xe6\xde\x76\xbf\xb2\x2a\xf0\x3a\xb2\x36\x53\x74\x09\x89\x26\xed\x9b\xa1\x28\x64\x77\xc9\x51\x4e\x03\x97\xa2\xda\x65\xff\x43\x72\x94\xf4\xf6\xb8\x8b\x27\xb3\xd4\xeb\xcb\x93\xbf\x3c\x4b\xd1\x47\x81\x27\xd2\x94\x0f\xba\x15\xa6\x23\x75\x77\x48\x57\x74\xbe\xf4\x97\x55\x1b\xb4\x1c\x5a\xb3\x4b\x61\x10\x74\xc2\xf2\xa4\xd3\x39\x26\xe1\x1a\x9f\xef\x15\x8d\xb6\x0f\xdd\xa3\x0c\xf0\x95\x29\x15\x73\x1b\x68\x4e\xcd\xed\xf6\xd8\xea\xca\xdc\x01\x5c\xef\xaf\x6d\xdb\x50\xb8\xed\x43\x9a\x05\x7d\x6b\xc7\xb1\x7a\x66\x66\x4f\x33\x28\x0e\xd6\x9d\x85\x3e\x7d\x66\xf6\x09\x47\x58\xfe\xb4\x65\xd7\x03\xac\x65\x97\x94\xfe\x08\x26\xa6\x9e\xc6\x1d\x66\xfd\x08\xbd\xb3\xac\xc7\x84\xf9\x6c\x27\x59\xdd\xa6\x85\x6a\x7d\x1a\x85\x51\x61\x0f\xb1\xfc\xac\xee\x56\xde\x1d\xe4\x84\x77\xc1\xe9\x1c\x3d\x6d\x18\xf1\xcd\xcb\x30\x5c\xa6\xb9\xdd\x1d\xe5\x0a\x94\xae\xf4\x3f\xeb\x9e\x36\x73\x79\x61\x6b\xdc\xd1\xef\x7c\x88\x8f\x6b\x1a\xd2\xbd\x58\x38\x68\x0b\xe8\xce\x3d\xd6\x32\xfe\x56\xd9\x0e\xac\xe5\xec\xb6\x04\x36\x20\x46\x27\x7f\x53\x7a\x0d\xa5\x45\x59\x0d\x3e\x89\xd7\xeb\x2b\x4e\x07\xd7\x2e\x83\xa9\x97\xb6\xd1\x80\x17\xeb\xa7\xb4\xe7\xbe\x9e\x17\x54\xf2\x6e\x2a\x40\x75\xbf\xdc\xb4\x9b\x47\x67\x37\x72\x0c\xec\x2e\xe4\x77\x7a\x2a\x0b\x74\xaf\x5e\x44\x50\xe8\x71\xfc\xe9\x47\xe6\x6e\x81\xc8\x1f\x1d\xd8\x4c\x4f\x87\xe0\x5f\x36\x4a\x36\xb8\x28\xe1\x76\xe1\x2a\x94\x7c\x02\x35\x4f\x2f\x95\x6c\x40\x99\x12\x34\xb3\x9f\xdb\xdc\x96\x60\xe7\xa4\x37\x50\x37\x15\x37\xfe\x5f\x2b\x82\xf9\x9c\x9e\xff\x0c\x0f\xc8\x7f\xcb\x68\xef\xab\xe5\xd8\x38\xf2\xe3\xdc\x33\xb0\x5f\x94\xfc\xc0\x13\x6e\xf8\xfc\xe2\xf6\xc3\xc1\x8a\xa3\x8e\xdd\x97\x43\x72\xe3\xa2\xfb\x5d\xc2\x42\xe6\xf4\xf6\xb2\xaf\xed\x07\x67\xab\x09\x3b\x64\x3d\xcd\xfc\x17\x44\xb7\x43\xee\x21\xc6\x79\xf1\xed\x23\x0b\xec\x80\xe8\xdd\xca\xb7\xc9\xce\xf5\xe2\xdf\x3b\xa7\xf6\xe3\x71\x3f\x8a\x93\x4d\xfa\x41\xe4\x47\x45\x51\x62\x16\xe1\x95\x8f\x35\xbd\x96\xf5\x7b\xd1\x19\x6b\x20\x6f\x03\x2e\xd2\x35\xc1\xf3\xb9\xb3\x1d\xf4\x49\xd3\xdd\x1c\x1e\x7f\x22\xf8\xa4\xbd\xe1\xef\xec\xff\x99\xb2\xff\x96\x14\xe9\xd2\xa3\x8b\x9a\x5d\x8a\xf5\xb5\x2b\x2c\xe7\xbf\xe1\xa5\x79\x2d\x4c\x59\x59\x11\x24\xad\xa0\xdd\xa5\xc7\x1e\x9a\xec\x99\xb3\x9d\xdb\xab\x2c\xd2\x6c\x5b\x5b\xc3\xd0\x79\x1d\x72\xfc\x85\x1c\xe8\x1c\x9b\x11\x0b\xfc\x79\xda\xae\x3c\x78\x54\x80\xb9\xef\xa9\xeb\x77\x6c\xec\x26\x96\xed\xc3\x1a\xff\xa5\xd7\xf4\x8f\x4e\xb8\xb5\x68\x7f\x79\x70\xc8\xde\xfa\x8f\x97\x8b\xf9\xdc\xa5\xcf\xce\x6e\xd5\xfd\x8a\xbb\x93\xe8\xb6\x79\x84\xdf\x96\xb3\xed\xb9\x0e\x8b\x86\x1f\x0d\x28\x41\x1e\x8a\x68\xe8\x97\x6a\xa5\xbb\xea\x6c\x62\x74\x72\xdc\x9d\xe4\xd6\x89\x3b\x8d\xe6\xda\x53\xca\xa8\x2b\xb8\x2b\xc0\xee\x7d\xf3\x79\x5c\x8a\x02\x3e\x76\xf4\xbb\x94\xca\x68\xf6\x6d\x62\x2f\x16\x88\x47\xeb\xa2\x43\xc6\x9b\x06\x44\x11\xfb\x27\x28\x60\x55\xed\x5e\x33\xd7\xbf\xdc\x15\x93\x56\xe2\xd6\x71\x87\xcc\xab\xe1\xd1\x7a\x1a\x78\xa2\xf0\x2b\xde\xe0\x32\xe4\xba\x1a\x6f\x3e\x13\xf8\x3d\xf1\xeb\x30\xc5\x1a\x63\xe3\xf7\xf2\xce\x72\xa5\x81\x1a\xc7\x2d\xe7\xdb\x99\x76\x73\x47\x44\xf1\x3d\xd5\x14\xd1\x01\x6b\x1f\xfc\xc2\xab\xa9\xc5\x75\xb5\x04\xd8\x89\x5d\xad\xf2\x4f\x72\x6a\xbd\x5d\x89\xff\x17\x3b\xeb\xd1\x96\x2b\xcb\x67\xbb\xb0\x65\x77\xf4\xb6\x92\xa4\x33\xd2\x6f\x7e\xa8\x41\x4b\x94\xdd\x6b\xa2\x5e\xee\x5a\xa9\x8a\x76\xc8\x55\xfe\x1c\xf3\xd1\x77\xb2\x7f\x06\x00\x00\xff\xff\x63\x45\xf4\x5b\x44\x2d\x00\x00") func operatorGoTemplBytes() ([]byte, error) { return bindataRead( @@ -148,12 +148,12 @@ func operatorGoTempl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "operator.go.templ", size: 11595, mode: os.FileMode(436), modTime: time.Unix(1543370081, 0)} + info := bindataFileInfo{name: "operator.go.templ", size: 11588, mode: os.FileMode(436), modTime: time.Unix(1543404126, 0)} a := &asset{bytes: bytes, info: info} return a, nil } -var _template_functionsGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x54\xc1\x8e\xdb\x36\x10\x3d\x8b\x5f\x31\x15\x02\xd4\x2a\xbc\x22\xf6\x56\x04\x4d\x0f\x6d\x36\x89\x91\x60\xb7\xc8\x1a\xc8\xb1\xa1\xa5\xb1\x34\x30\x45\x12\xe4\xc8\x8e\x21\xe8\xdf\x0b\x92\xb2\x03\x6c\x91\xee\x56\x17\x4a\x23\xce\x7b\xf3\x1e\x67\x28\x25\xfc\x9e\x1f\x78\xfb\x00\xf7\x0f\x5b\xb8\x7b\xbb\xd9\xc2\xf6\xc3\xe6\x11\xde\x6d\x3e\xdd\xc1\x6f\xd7\x47\x48\x09\xdb\x9e\x02\xec\x49\x23\x50\x00\x35\xb2\xed\xd0\xa0\x57\x8c\x2d\x1c\x49\xc1\x57\x75\x0a\x37\xd6\xc5\x88\xf5\x37\x8d\x6d\xb1\x43\x03\xce\xdb\x06\x43\xf8\x1a\x01\x36\x7b\x38\xdb\xf1\xe7\x16\x34\x1d\x10\xb8\x47\x68\x7a\x65\x3a\x04\x65\xce\xdc\x93\xe9\x40\xed\xec\xc8\xc0\x57\xa2\x41\x1d\x10\xb0\x25\x0e\xc0\x36\x65\xd4\x8c\x83\xd3\x11\x2d\x57\x62\x52\xd4\x1d\x3a\xb9\x30\x4a\x15\x02\x72\x80\x96\x3c\x36\x6c\xfd\xb9\x16\xc2\xa9\xe6\xa0\x3a\x84\x1e\xb5\x43\x1f\x84\xa0\xc1\x59\xcf\xb0\x12\x85\x3a\x85\x46\x13\x1a\x86\xb2\x23\xee\xc7\x5d\xdd\xd8\x41\xaa\x53\xd0\x6a\x17\xe2\x7a\x13\xd0\x1f\xa9\xc1\xab\x34\x99\xc8\x52\xce\xb2\x04\x64\x79\x44\x1f\xc8\x1a\x6c\x25\x9f\x1d\xb6\xf2\x69\x56\xad\x4e\x41\x1e\x6f\x95\x76\xbd\xba\x2d\x45\xf1\xff\xd8\xac\xd9\x53\x57\x8a\x62\x40\x56\xc7\x5b\x28\x0f\xbf\x86\x9a\xac\x54\x8e\x06\xd5\xf4\x64\xd0\x9f\xd3\x46\xe5\x28\xc8\xb8\x49\x1e\x6f\x4b\x51\x89\xe8\xd3\x3d\x9e\xe0\x0b\x69\x0d\x1e\x79\xf4\xe6\x62\x42\x34\x74\x87\xe0\xa2\x5d\x2d\x90\x59\xfc\x4d\xf6\x2a\xc6\x20\xf6\xa3\x69\x62\xf2\xaa\x82\x0f\x4b\xca\x24\x8a\x05\x64\x89\x4c\xa2\x00\xf8\x38\xee\xd0\x1b\x64\x0c\x9f\x31\xd8\xd1\x37\x78\xaf\x06\x7c\xfd\x83\xf8\x5a\x14\xc5\x34\xdd\x80\x4f\x27\xff\x8a\x4c\x8b\xdf\xd6\xf0\x0a\x35\x0e\xf1\x14\x5e\xbf\x81\x7a\xc3\x38\x04\x98\x67\x51\x14\xef\x91\xa7\xe9\xf2\xb3\x7e\x74\xd8\xd4\x1f\xc9\xb4\xf3\xfc\xc7\x39\x93\x3c\xb3\xe1\xc2\x86\x31\x24\x8a\x59\xcc\xc9\x93\x8b\xa0\x16\xf7\x64\x30\x80\xd2\x3a\xa9\xcf\x71\x88\xd2\x99\xac\x09\xc0\xbd\x62\x50\x1e\x01\xbf\x39\x1b\x8d\xfa\x97\x4d\xf1\xb8\xaf\x78\x81\xfd\xd8\x30\x4c\xe2\x47\xae\x24\xe8\x55\x60\x4f\xa6\xab\xe0\xf2\x22\x5e\xee\xc8\x33\x7a\x33\xfe\x2f\xb9\x61\xea\x3f\xd3\xb2\x86\x4c\x73\x59\x2b\x58\x91\x61\xf4\x7b\xd5\xe0\x34\xaf\x01\xbd\xb7\x7e\xa9\x21\xfb\x34\x0b\xf1\xd2\x82\xa4\x7c\xee\x08\xe0\x14\x9b\x6f\x4f\xa6\x4d\xce\xf9\xc5\x0d\xd8\x9d\xc1\xa8\x01\x73\x9f\x3d\x83\xb1\xca\x82\xe0\xa9\xb0\x08\x70\x55\x17\x3f\x82\x53\x0d\xfe\xa7\xce\xd8\xc4\xda\x76\x1d\xfa\x28\x64\xc1\xfb\x94\x02\xa2\xc8\xf3\xfc\x88\xbc\x86\xbf\xe3\xef\xeb\xed\x50\xdf\xe3\xe9\x9d\xf5\x99\x77\xa9\xa6\xfe\x7c\xf7\xb8\xcd\x91\x2a\x0e\x46\xd6\x95\x78\x12\xf4\x05\xab\x7e\xaa\xec\x2f\x3d\x7a\xa5\xa3\xae\x79\x5e\x5d\xab\xae\xea\xf7\xc8\xe9\x73\x0d\x79\xce\x63\xe0\xc1\xa5\x46\x9c\xe6\x4a\x14\xb4\x4f\xd8\x3f\xbd\x01\x43\x3a\xea\x58\x84\xd4\x5f\x88\xfb\xbb\xa8\x6e\x85\xde\x57\x75\x7e\x2d\x93\x5e\xe8\x90\x39\x5e\xad\x21\x76\xb3\x75\xd4\x94\x95\x28\x2e\x63\x5c\x96\xa9\xdc\x38\x18\xd7\xd1\xfe\x2e\xc4\x90\x16\xb3\xf8\xde\x16\xff\x04\x00\x00\xff\xff\xe5\x13\x3f\x32\x30\x06\x00\x00") +var _template_functionsGoTempl = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x94\x54\x4d\x8f\xdb\x36\x10\x3d\x8b\xbf\x62\x2a\x04\xa8\x05\x78\x45\xec\xad\x08\x9a\x1e\xda\x6c\x12\x23\xc1\x6e\x91\x35\x90\x63\x43\x4b\x63\x69\x60\x8a\x24\xc8\x91\x1d\x43\xd0\x7f\x2f\x48\x7d\x04\xd8\x22\xdd\x8d\x2e\x94\x46\x9c\xf7\xe6\x3d\xce\x50\x4a\xf8\x63\x7a\xe0\xed\x03\xdc\x3f\xec\xe1\xee\xed\x6e\x0f\xfb\x0f\xbb\x47\x78\xb7\xfb\x74\x07\xbf\xaf\x8f\x90\x12\xf6\x2d\x05\x38\x92\x46\xa0\x00\xaa\x67\xdb\xa0\x41\xaf\x18\x6b\x38\x93\x82\xaf\xea\x12\x6e\xac\x8b\x11\xeb\x6f\x2a\x5b\x63\x83\x06\x9c\xb7\x15\x86\xf0\x35\x02\xec\x8e\x70\xb5\xfd\xaf\x35\x68\x3a\x21\x70\x8b\x50\xb5\xca\x34\x08\xca\x5c\xb9\x25\xd3\x80\x3a\xd8\x9e\x81\x57\xa2\x4e\x9d\x10\xb0\x26\x0e\xc0\x36\x65\x94\x8c\x9d\xd3\x11\x6d\xaa\xc4\xa4\xa8\x3b\x35\x72\x66\x94\x2a\x04\xe4\x00\x35\x79\xac\xd8\xfa\x6b\x29\x84\x53\xd5\x49\x35\x08\x2d\x6a\x87\x3e\x08\x41\x9d\xb3\x9e\x61\x23\x32\x75\x09\x95\x26\x34\x0c\x79\x43\xdc\xf6\x87\xb2\xb2\x9d\x54\x97\xa0\xd5\x21\xc4\xf5\x26\xa0\x3f\x53\x85\xab\x34\x99\xc8\x52\xce\xbc\x04\x64\x79\x46\x1f\xc8\x1a\xac\x25\x5f\x1d\xd6\xf2\x69\x56\xa9\x2e\x41\x9e\x6f\x95\x76\xad\xba\xcd\x45\xf6\x73\x6c\xd6\x1c\xa9\xc9\x45\xd6\x21\xab\xf3\x2d\xe4\xa7\xdf\x42\x49\x56\x2a\x47\x9d\xaa\x5a\x32\xe8\xaf\x69\xa3\x72\x14\x64\xdc\x24\xcf\xb7\xb9\x28\x44\xf4\xe9\x1e\x2f\xf0\x85\xb4\x06\x8f\xdc\x7b\xb3\x98\x10\x0d\x3d\x20\xb8\x68\x57\x0d\x64\x66\x7f\x93\xbd\x8a\x31\x88\x63\x6f\xaa\x98\xbc\x29\xe0\xc3\x9c\x32\x88\x6c\x06\x99\x23\x83\xc8\x00\x3e\xf6\x07\xf4\x06\x19\xc3\x67\x0c\xb6\xf7\x15\xde\xab\x0e\x5f\xff\x20\xbe\x15\x59\x36\x0c\x37\xe0\xd3\xc9\xbf\x22\x53\xe3\xb7\x2d\xbc\x42\x8d\x5d\x3c\x85\xd7\x6f\xa0\xdc\x31\x76\x01\xc6\x51\x64\xd9\x7b\xe4\x61\x58\x7e\x96\x8f\x0e\xab\xf2\x23\x99\x7a\x1c\xff\xbc\x4e\x24\xcf\x6c\x58\xd8\x30\x86\x44\x36\x8a\x31\x79\xb2\x08\xaa\xf1\x48\x06\x03\x28\xad\x93\xfa\x29\x0e\x51\x3a\x93\x35\x01\xb8\x55\x0c\xca\x23\xe0\x37\x67\xa3\x51\xff\xb1\x29\x1e\xf7\x8a\x17\xd8\xf7\x15\xc3\x20\x7e\xe4\x4a\x82\xde\x04\xf6\x64\x9a\x02\x96\x17\xf1\x72\x47\x9e\xd1\x3b\xe1\x4f\xfd\x52\xfe\x95\x96\x2d\x4c\x2c\xcb\x5a\xc0\x86\x0c\xa3\x3f\xaa\x0a\x87\x71\x0b\xe8\xbd\xf5\x73\x09\x93\x4d\xa3\x10\x2f\xad\x47\xca\xe7\x4e\x00\x2e\xb1\xf7\x8e\x64\xea\x64\x9c\x9f\xcd\x80\xc3\x15\x8c\xea\x70\x6a\xb3\x67\x30\x66\x41\xf0\x44\x57\xcc\x5f\xc5\xc5\x8f\xe0\x54\x85\xff\x2b\x33\xb6\xb0\xb6\x4d\x83\x3e\xea\x98\xf1\x3e\xa5\x80\xc8\xa6\x69\x7e\x44\xde\xc2\x3f\xf1\xf7\x7a\x37\x94\xf7\x78\x79\x67\xfd\xc4\xbb\xb8\xfb\xf9\xee\x71\x3f\x45\x8a\x38\x16\x93\xac\xc4\x93\xa0\x17\xac\xf2\xa9\xb0\xbf\x75\xef\x95\x8e\xb2\xc6\x71\xb3\x56\x5d\x94\xef\x91\xd3\xe7\x16\xa6\x29\x8f\x81\x07\x97\xda\x70\x18\x0b\x91\xd1\x31\x61\xff\xf2\x06\x0c\xe9\xa8\x63\x16\x52\x7e\x21\x6e\xef\xa2\xba\x0d\x7a\x5f\x94\xd3\x6b\x9e\xf4\x42\x83\xcc\xf1\x62\x0d\xb1\x97\xad\xa3\x2a\x2f\x44\xb6\x0c\x71\x9e\xa7\x72\xe3\x58\xac\x83\xfd\x5d\x88\x21\x2d\x46\xf1\xbd\x2b\xfe\x0d\x00\x00\xff\xff\x2d\x5b\xdf\x7e\x2e\x06\x00\x00") func template_functionsGoTemplBytes() ([]byte, error) { return bindataRead( @@ -168,7 +168,7 @@ func template_functionsGoTempl() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "template_functions.go.templ", size: 1584, mode: os.FileMode(436), modTime: time.Unix(1538540481, 0)} + info := bindataFileInfo{name: "template_functions.go.templ", size: 1582, mode: os.FileMode(436), modTime: time.Unix(1543403903, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/pkg/config/types.go b/pkg/config/config.go similarity index 56% rename from pkg/config/types.go rename to pkg/config/config.go index 8cd5efe8b..ce1110287 100644 --- a/pkg/config/types.go +++ b/pkg/config/config.go @@ -5,15 +5,22 @@ import ( "github.com/aws/aws-sdk-go/aws/session" awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1" + goVersion "github.com/christopherhein/go-version" "github.com/sirupsen/logrus" + corev1 "k8s.io/api/core/v1" "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" ) +const controllerName = "aws-service-operator" + // Config defines the configuration for the operator type Config struct { + Version *goVersion.Info Region string Kubeconfig string MasterURL string @@ -23,7 +30,7 @@ type Config struct { AWSClientset awsclient.ServiceoperatorV1alpha1Interface KubeClientset kubernetes.Interface RESTConfig *rest.Config - LoggingConfig *LoggingConfig + LoggingConfig LoggingConfig Logger *logrus.Entry Resources map[string]bool ClusterName string @@ -48,25 +55,29 @@ func getKubeconfig(masterURL, kubeconfig string) (*rest.Config, error) { return rest.InClusterConfig() } -func (c *Config) CreateContext(masterURL, kubeconfig string) error { +// CreateContext will create all the contexts for the informers +func CreateContext(masterURL, kubeconfig string) (awsclient.ServiceoperatorV1alpha1Interface, kubernetes.Interface, *rest.Config, error) { config, err := getKubeconfig(masterURL, kubeconfig) if err != nil { - return fmt.Errorf("failed to get k8s config. %+v", err) + return nil, nil, nil, 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) + return nil, nil, nil, 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) + return nil, nil, nil, fmt.Errorf("failed to create object store clientset. %+v", err) } - c.AWSClientset = awsclientset - c.KubeClientset = clientset - c.RESTConfig = config + return awsclientset, clientset, config, nil +} - return nil +func CreateRecorder(logger *logrus.Entry, kubeclientset kubernetes.Interface) record.EventRecorder { + eventBroadcaster := record.NewBroadcaster() + eventBroadcaster.StartLogging(logger.Infof) + eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: kubeclientset.CoreV1().Events("")}) + return eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: controllerName}) } diff --git a/pkg/customizations/cloudformationtemplate/cloudformationtemplate.go b/pkg/customizations/cloudformationtemplate/cloudformationtemplate.go index 3814b916c..7894196a0 100644 --- a/pkg/customizations/cloudformationtemplate/cloudformationtemplate.go +++ b/pkg/customizations/cloudformationtemplate/cloudformationtemplate.go @@ -5,7 +5,6 @@ import ( "reflect" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" 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" @@ -14,11 +13,11 @@ import ( ) // OnAdd will be fired when you add a new CFT -func OnAdd(config *config.Config, cft *awsV1alpha1.CloudFormationTemplate) { +func OnAdd(config config.Config, cft *awsV1alpha1.CloudFormationTemplate) { logger := config.Logger updateOutput(config, cft, "UPLOAD_IN_PROGRESS", "") - err := addFileToS3(config.AWSSession, config.Bucket, cft.Data.Key, cft.Data.Template) + err := addFileToS3(config, config.Bucket, cft.Data.Key, cft.Data.Template) if err != nil { logger.WithError(err).Error("error uploading cloudformation") updateOutput(config, cft, "UPLOAD_FAILED", err.Error()) @@ -28,12 +27,12 @@ func OnAdd(config *config.Config, cft *awsV1alpha1.CloudFormationTemplate) { } // OnUpdate will be fired when you update a CFT -func OnUpdate(config *config.Config, oldcft *awsV1alpha1.CloudFormationTemplate, newcft *awsV1alpha1.CloudFormationTemplate) { +func OnUpdate(config config.Config, oldcft *awsV1alpha1.CloudFormationTemplate, newcft *awsV1alpha1.CloudFormationTemplate) { if !reflect.DeepEqual(oldcft.Data, newcft.Data) { logger := config.Logger updateOutput(config, newcft, "UPLOAD_IN_PROGRESS", "") - err := addFileToS3(config.AWSSession, config.Bucket, oldcft.Data.Key, newcft.Data.Template) + err := addFileToS3(config, config.Bucket, oldcft.Data.Key, newcft.Data.Template) if err != nil { logger.WithError(err).Error("error uploading cloudformation") updateOutput(config, newcft, "UPLOAD_FAILED", err.Error()) @@ -44,23 +43,23 @@ func OnUpdate(config *config.Config, oldcft *awsV1alpha1.CloudFormationTemplate, } // OnDelete will be fired when you delete a CFT -func OnDelete(config *config.Config, cft *awsV1alpha1.CloudFormationTemplate) { +func OnDelete(config config.Config, cft *awsV1alpha1.CloudFormationTemplate) { logger := config.Logger - - _, err := s3.New(config.AWSSession).DeleteObject(&s3.DeleteObjectInput{ + sess := config.AWSSession + _, err := s3.New(sess).DeleteObject(&s3.DeleteObjectInput{ Bucket: aws.String(config.Bucket), Key: aws.String(cft.Data.Key), }) if err != nil { - logger.WithError(err).Error("error uploading cloudformation") + logger.WithError(err).Error("error deleting cloudformation") } logger.Infof("deleted cloudformationtemplate '%s'", cft.Name) } -func addFileToS3(s *session.Session, bucket string, filename string, template string) error { +func addFileToS3(config config.Config, bucket string, filename string, template string) error { buffer := []byte(template) - - svc := s3.New(s) + sess := config.AWSSession + svc := s3.New(sess) _, err := svc.PutObject(&s3.PutObjectInput{ Bucket: aws.String(bucket), @@ -71,7 +70,7 @@ func addFileToS3(s *session.Session, bucket string, filename string, template st return err } -func updateOutput(config *config.Config, cft *awsV1alpha1.CloudFormationTemplate, status string, reason string) error { +func updateOutput(config config.Config, cft *awsV1alpha1.CloudFormationTemplate, status string, reason string) error { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.CloudFormationTemplates(cft.Namespace).Get(cft.Name, metav1.GetOptions{}) diff --git a/pkg/helpers/configmap.go b/pkg/helpers/configmap.go index 2d78a03bb..da1870519 100644 --- a/pkg/helpers/configmap.go +++ b/pkg/helpers/configmap.go @@ -7,7 +7,7 @@ import ( ) // CreateConfigMap will create a Kubernetes Servic Using ExternalName types -func CreateConfigMap(config *config.Config, resource interface{}, svcName string, svcNamespace string, configMapTemplate map[string]string) string { +func CreateConfigMap(config config.Config, resource interface{}, svcName string, svcNamespace string, configMapTemplate map[string]string) string { logger := config.Logger cmData := map[string]string{} for key, value := range configMapTemplate { diff --git a/pkg/helpers/helpers.go b/pkg/helpers/helpers.go index 0333ecc2c..12bb2fb4a 100644 --- a/pkg/helpers/helpers.go +++ b/pkg/helpers/helpers.go @@ -85,7 +85,7 @@ func Templatize(tempStr string, data interface{}) (resp string, err error) { } // GetCloudFormationTemplate will return the url to the CFT from the CFT resource -func GetCloudFormationTemplate(config *config.Config, rType string, name string, namespace string) string { +func GetCloudFormationTemplate(config config.Config, rType string, name string, namespace string) string { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) diff --git a/pkg/helpers/service.go b/pkg/helpers/service.go index 51c189182..3e52e05cf 100644 --- a/pkg/helpers/service.go +++ b/pkg/helpers/service.go @@ -7,7 +7,7 @@ import ( ) // CreateExternalNameService will create a Kubernetes Servic Using ExternalName types -func CreateExternalNameService(config *config.Config, resource interface{}, svcName string, svcNamespace string, externalNameTemplate string, svcPort int32) string { +func CreateExternalNameService(config config.Config, resource interface{}, svcName string, svcNamespace string, externalNameTemplate string, svcPort int32) string { logger := config.Logger externalName, err := Templatize(externalNameTemplate, Data{Obj: resource, Config: config}) diff --git a/pkg/helpers/template_functions.go b/pkg/helpers/template_functions.go index faa40878a..49aca43a2 100644 --- a/pkg/helpers/template_functions.go +++ b/pkg/helpers/template_functions.go @@ -28,17 +28,17 @@ func New() Helpers { // Helpers defines all the Helper functions that are exposed to the templates type Helpers struct { KubernetesResourceName func(string) string - GetCloudFormationTemplateByName func(*config.Config, string, string) (interface{}, error) - GetDynamoDBByName func(*config.Config, string, string) (interface{}, error) - GetECRRepositoryByName func(*config.Config, string, string) (interface{}, error) - GetS3BucketByName func(*config.Config, string, string) (interface{}, error) - GetSNSSubscriptionByName func(*config.Config, string, string) (interface{}, error) - GetSNSTopicByName func(*config.Config, string, string) (interface{}, error) - GetSQSQueueByName func(*config.Config, string, string) (interface{}, error) + GetCloudFormationTemplateByName func(config.Config, string, string) (interface{}, error) + GetDynamoDBByName func(config.Config, string, string) (interface{}, error) + GetECRRepositoryByName func(config.Config, string, string) (interface{}, error) + GetS3BucketByName func(config.Config, string, string) (interface{}, error) + GetSNSSubscriptionByName func(config.Config, string, string) (interface{}, error) + GetSNSTopicByName func(config.Config, string, string) (interface{}, error) + GetSQSQueueByName func(config.Config, string, string) (interface{}, error) } // GetCloudFormationTemplateByName will find the resource by name -func GetCloudFormationTemplateByName(config *config.Config, name string, namespace string) (interface{}, error) { +func GetCloudFormationTemplateByName(config config.Config, name string, namespace string) (interface{}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.CloudFormationTemplates(namespace).Get(name, metav1.GetOptions{}) @@ -51,7 +51,7 @@ func GetCloudFormationTemplateByName(config *config.Config, name string, namespa } // GetDynamoDBByName will find the resource by name -func GetDynamoDBByName(config *config.Config, name string, namespace string) (interface{}, error) { +func GetDynamoDBByName(config config.Config, name string, namespace string) (interface{}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.DynamoDBs(namespace).Get(name, metav1.GetOptions{}) @@ -64,7 +64,7 @@ func GetDynamoDBByName(config *config.Config, name string, namespace string) (in } // GetECRRepositoryByName will find the resource by name -func GetECRRepositoryByName(config *config.Config, name string, namespace string) (interface{}, error) { +func GetECRRepositoryByName(config config.Config, name string, namespace string) (interface{}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.ECRRepositories(namespace).Get(name, metav1.GetOptions{}) @@ -77,7 +77,7 @@ func GetECRRepositoryByName(config *config.Config, name string, namespace string } // GetS3BucketByName will find the resource by name -func GetS3BucketByName(config *config.Config, name string, namespace string) (interface{}, error) { +func GetS3BucketByName(config config.Config, name string, namespace string) (interface{}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.S3Buckets(namespace).Get(name, metav1.GetOptions{}) @@ -90,7 +90,7 @@ func GetS3BucketByName(config *config.Config, name string, namespace string) (in } // GetSNSSubscriptionByName will find the resource by name -func GetSNSSubscriptionByName(config *config.Config, name string, namespace string) (interface{}, error) { +func GetSNSSubscriptionByName(config config.Config, name string, namespace string) (interface{}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSSubscriptions(namespace).Get(name, metav1.GetOptions{}) @@ -103,7 +103,7 @@ func GetSNSSubscriptionByName(config *config.Config, name string, namespace stri } // GetSNSTopicByName will find the resource by name -func GetSNSTopicByName(config *config.Config, name string, namespace string) (interface{}, error) { +func GetSNSTopicByName(config config.Config, name string, namespace string) (interface{}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSTopics(namespace).Get(name, metav1.GetOptions{}) @@ -116,7 +116,7 @@ func GetSNSTopicByName(config *config.Config, name string, namespace string) (in } // GetSQSQueueByName will find the resource by name -func GetSQSQueueByName(config *config.Config, name string, namespace string) (interface{}, error) { +func GetSQSQueueByName(config config.Config, name string, namespace string) (interface{}, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SQSQueues(namespace).Get(name, metav1.GetOptions{}) diff --git a/pkg/helpers/types.go b/pkg/helpers/types.go index c62c03d39..d6264ce02 100644 --- a/pkg/helpers/types.go +++ b/pkg/helpers/types.go @@ -6,5 +6,5 @@ import "github.com/awslabs/aws-service-operator/pkg/config" type Data struct { Helpers Helpers Obj interface{} - Config *config.Config + Config config.Config } diff --git a/pkg/logger/logger.go b/pkg/logger/logger.go index be177972b..6bac5b0fb 100644 --- a/pkg/logger/logger.go +++ b/pkg/logger/logger.go @@ -2,14 +2,15 @@ package logger import ( "bufio" - "github.com/awslabs/aws-service-operator/pkg/config" - "github.com/sirupsen/logrus" "os" "strings" + + "github.com/awslabs/aws-service-operator/pkg/config" + "github.com/sirupsen/logrus" ) // Configure will setup the logger for all commands -func Configure(config *config.LoggingConfig) (*logrus.Entry, error) { +func Configure(config config.LoggingConfig) (*logrus.Entry, error) { hostname, err := os.Hostname() if err != nil { return nil, err diff --git a/pkg/operators/base/base.go b/pkg/operators/base/base.go index 154d9dc11..bed2ae27c 100644 --- a/pkg/operators/base/base.go +++ b/pkg/operators/base/base.go @@ -14,7 +14,7 @@ import ( ) type base struct { - config *config.Config + config config.Config queueManager *queuemanager.QueueManager cloudformationtemplate *cloudformationtemplate.Operator dynamodb *dynamodb.Operator @@ -26,7 +26,7 @@ type base struct { } func New( - config *config.Config, + config config.Config, queueManager *queuemanager.QueueManager, ) *base { return &base{ diff --git a/pkg/operators/cloudformationtemplate/operator.go b/pkg/operators/cloudformationtemplate/operator.go index 07f5a337c..e58123da0 100644 --- a/pkg/operators/cloudformationtemplate/operator.go +++ b/pkg/operators/cloudformationtemplate/operator.go @@ -19,13 +19,13 @@ import ( // Operator represents a controller object for object store custom resources type Operator struct { - config *config.Config + config config.Config topicARN string queueManager *queuemanager.QueueManager } // NewOperator create controller for watching object store custom resources created -func NewOperator(config *config.Config, queueManager *queuemanager.QueueManager) *Operator { +func NewOperator(config config.Config, queueManager *queuemanager.QueueManager) *Operator { return &Operator{ config: config, diff --git a/pkg/operators/dynamodb/cft.go b/pkg/operators/dynamodb/cft.go index 617f6815b..d5a384457 100644 --- a/pkg/operators/dynamodb/cft.go +++ b/pkg/operators/dynamodb/cft.go @@ -15,7 +15,7 @@ import ( ) // New generates a new object -func New(config *config.Config, dynamodb *awsV1alpha1.DynamoDB, topicARN string) *Cloudformation { +func New(config config.Config, dynamodb *awsV1alpha1.DynamoDB, topicARN string) *Cloudformation { return &Cloudformation{ DynamoDB: dynamodb, config: config, @@ -25,7 +25,7 @@ func New(config *config.Config, dynamodb *awsV1alpha1.DynamoDB, topicARN string) // Cloudformation defines the dynamodb cfts type Cloudformation struct { - config *config.Config + config config.Config DynamoDB *awsV1alpha1.DynamoDB topicARN string } diff --git a/pkg/operators/dynamodb/operator.go b/pkg/operators/dynamodb/operator.go index 338ffbc26..a2c5cd879 100644 --- a/pkg/operators/dynamodb/operator.go +++ b/pkg/operators/dynamodb/operator.go @@ -26,13 +26,13 @@ import ( // Operator represents a controller object for object store custom resources type Operator struct { - config *config.Config + config config.Config topicARN string queueManager *queuemanager.QueueManager } // NewOperator create controller for watching object store custom resources created -func NewOperator(config *config.Config, queueManager *queuemanager.QueueManager) *Operator { +func NewOperator(config config.Config, queueManager *queuemanager.QueueManager) *Operator { queuectrl := queue.New(config, config.AWSClientset, 10) topicARN, _ := queuectrl.Register("dynamodb") queueManager.Add(topicARN, queuemanager.HandlerFunc(QueueUpdater)) @@ -57,7 +57,7 @@ func (c *Operator) StartWatch(ctx context.Context, namespace string) { } // QueueUpdater will take the messages from the queue and process them -func QueueUpdater(config *config.Config, msg *queuemanager.MessageBody) error { +func QueueUpdater(config config.Config, msg *queuemanager.MessageBody) error { logger := config.Logger var name, namespace string if msg.Updatable { @@ -167,7 +167,7 @@ func (c *Operator) onDelete(obj interface{}) { c.config.Logger.Infof("deleted dynamodb '%s'", s.Name) } -func incrementRollbackCount(config *config.Config, name string, namespace string) error { +func incrementRollbackCount(config config.Config, name string, namespace string) error { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.DynamoDBs(namespace).Get(name, metav1.GetOptions{}) @@ -187,7 +187,7 @@ func incrementRollbackCount(config *config.Config, name string, namespace string return nil } -func updateStatus(config *config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.DynamoDB, error) { +func updateStatus(config config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.DynamoDB, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.DynamoDBs(namespace).Get(name, metav1.GetOptions{}) @@ -226,7 +226,7 @@ func updateStatus(config *config.Config, name string, namespace string, stackID return resourceCopy, nil } -func deleteStack(config *config.Config, name string, namespace string, stackID string) (*awsV1alpha1.DynamoDB, error) { +func deleteStack(config config.Config, name string, namespace string, stackID string) (*awsV1alpha1.DynamoDB, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.DynamoDBs(namespace).Get(name, metav1.GetOptions{}) @@ -245,7 +245,7 @@ func deleteStack(config *config.Config, name string, namespace string, stackID s return resource, err } -func syncAdditionalResources(config *config.Config, s *awsV1alpha1.DynamoDB) (err error) { +func syncAdditionalResources(config config.Config, s *awsV1alpha1.DynamoDB) (err error) { clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.DynamoDBs(s.Namespace).Get(s.Name, metav1.GetOptions{}) if err != nil { diff --git a/pkg/operators/ecrrepository/cft.go b/pkg/operators/ecrrepository/cft.go index 301f2b378..926914297 100644 --- a/pkg/operators/ecrrepository/cft.go +++ b/pkg/operators/ecrrepository/cft.go @@ -15,7 +15,7 @@ import ( ) // New generates a new object -func New(config *config.Config, ecrrepository *awsV1alpha1.ECRRepository, topicARN string) *Cloudformation { +func New(config config.Config, ecrrepository *awsV1alpha1.ECRRepository, topicARN string) *Cloudformation { return &Cloudformation{ ECRRepository: ecrrepository, config: config, @@ -25,7 +25,7 @@ func New(config *config.Config, ecrrepository *awsV1alpha1.ECRRepository, topicA // Cloudformation defines the ecrrepository cfts type Cloudformation struct { - config *config.Config + config config.Config ECRRepository *awsV1alpha1.ECRRepository topicARN string } diff --git a/pkg/operators/ecrrepository/operator.go b/pkg/operators/ecrrepository/operator.go index 3d753aaee..195e4834f 100644 --- a/pkg/operators/ecrrepository/operator.go +++ b/pkg/operators/ecrrepository/operator.go @@ -26,13 +26,13 @@ import ( // Operator represents a controller object for object store custom resources type Operator struct { - config *config.Config + config config.Config topicARN string queueManager *queuemanager.QueueManager } // NewOperator create controller for watching object store custom resources created -func NewOperator(config *config.Config, queueManager *queuemanager.QueueManager) *Operator { +func NewOperator(config config.Config, queueManager *queuemanager.QueueManager) *Operator { queuectrl := queue.New(config, config.AWSClientset, 10) topicARN, _ := queuectrl.Register("ecrrepository") queueManager.Add(topicARN, queuemanager.HandlerFunc(QueueUpdater)) @@ -57,7 +57,7 @@ func (c *Operator) StartWatch(ctx context.Context, namespace string) { } // QueueUpdater will take the messages from the queue and process them -func QueueUpdater(config *config.Config, msg *queuemanager.MessageBody) error { +func QueueUpdater(config config.Config, msg *queuemanager.MessageBody) error { logger := config.Logger var name, namespace string if msg.Updatable { @@ -167,7 +167,7 @@ func (c *Operator) onDelete(obj interface{}) { c.config.Logger.Infof("deleted ecrrepository '%s'", s.Name) } -func incrementRollbackCount(config *config.Config, name string, namespace string) error { +func incrementRollbackCount(config config.Config, name string, namespace string) error { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.ECRRepositories(namespace).Get(name, metav1.GetOptions{}) @@ -187,7 +187,7 @@ func incrementRollbackCount(config *config.Config, name string, namespace string return nil } -func updateStatus(config *config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.ECRRepository, error) { +func updateStatus(config config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.ECRRepository, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.ECRRepositories(namespace).Get(name, metav1.GetOptions{}) @@ -228,7 +228,7 @@ func updateStatus(config *config.Config, name string, namespace string, stackID return resourceCopy, nil } -func deleteStack(config *config.Config, name string, namespace string, stackID string) (*awsV1alpha1.ECRRepository, error) { +func deleteStack(config config.Config, name string, namespace string, stackID string) (*awsV1alpha1.ECRRepository, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.ECRRepositories(namespace).Get(name, metav1.GetOptions{}) @@ -247,7 +247,7 @@ func deleteStack(config *config.Config, name string, namespace string, stackID s return resource, err } -func syncAdditionalResources(config *config.Config, s *awsV1alpha1.ECRRepository) (err error) { +func syncAdditionalResources(config config.Config, s *awsV1alpha1.ECRRepository) (err error) { clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.ECRRepositories(s.Namespace).Get(s.Name, metav1.GetOptions{}) if err != nil { diff --git a/pkg/operators/s3bucket/cft.go b/pkg/operators/s3bucket/cft.go index 77035f0b7..0a14815f5 100644 --- a/pkg/operators/s3bucket/cft.go +++ b/pkg/operators/s3bucket/cft.go @@ -15,7 +15,7 @@ import ( ) // New generates a new object -func New(config *config.Config, s3bucket *awsV1alpha1.S3Bucket, topicARN string) *Cloudformation { +func New(config config.Config, s3bucket *awsV1alpha1.S3Bucket, topicARN string) *Cloudformation { return &Cloudformation{ S3Bucket: s3bucket, config: config, @@ -25,7 +25,7 @@ func New(config *config.Config, s3bucket *awsV1alpha1.S3Bucket, topicARN string) // Cloudformation defines the s3bucket cfts type Cloudformation struct { - config *config.Config + config config.Config S3Bucket *awsV1alpha1.S3Bucket topicARN string } diff --git a/pkg/operators/s3bucket/operator.go b/pkg/operators/s3bucket/operator.go index fbb770423..744366cba 100644 --- a/pkg/operators/s3bucket/operator.go +++ b/pkg/operators/s3bucket/operator.go @@ -26,13 +26,13 @@ import ( // Operator represents a controller object for object store custom resources type Operator struct { - config *config.Config + config config.Config topicARN string queueManager *queuemanager.QueueManager } // NewOperator create controller for watching object store custom resources created -func NewOperator(config *config.Config, queueManager *queuemanager.QueueManager) *Operator { +func NewOperator(config config.Config, queueManager *queuemanager.QueueManager) *Operator { queuectrl := queue.New(config, config.AWSClientset, 10) topicARN, _ := queuectrl.Register("s3bucket") queueManager.Add(topicARN, queuemanager.HandlerFunc(QueueUpdater)) @@ -57,7 +57,7 @@ func (c *Operator) StartWatch(ctx context.Context, namespace string) { } // QueueUpdater will take the messages from the queue and process them -func QueueUpdater(config *config.Config, msg *queuemanager.MessageBody) error { +func QueueUpdater(config config.Config, msg *queuemanager.MessageBody) error { logger := config.Logger var name, namespace string if msg.Updatable { @@ -167,7 +167,7 @@ func (c *Operator) onDelete(obj interface{}) { c.config.Logger.Infof("deleted s3bucket '%s'", s.Name) } -func incrementRollbackCount(config *config.Config, name string, namespace string) error { +func incrementRollbackCount(config config.Config, name string, namespace string) error { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.S3Buckets(namespace).Get(name, metav1.GetOptions{}) @@ -187,7 +187,7 @@ func incrementRollbackCount(config *config.Config, name string, namespace string return nil } -func updateStatus(config *config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.S3Bucket, error) { +func updateStatus(config config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.S3Bucket, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.S3Buckets(namespace).Get(name, metav1.GetOptions{}) @@ -227,7 +227,7 @@ func updateStatus(config *config.Config, name string, namespace string, stackID return resourceCopy, nil } -func deleteStack(config *config.Config, name string, namespace string, stackID string) (*awsV1alpha1.S3Bucket, error) { +func deleteStack(config config.Config, name string, namespace string, stackID string) (*awsV1alpha1.S3Bucket, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.S3Buckets(namespace).Get(name, metav1.GetOptions{}) @@ -246,7 +246,7 @@ func deleteStack(config *config.Config, name string, namespace string, stackID s return resource, err } -func syncAdditionalResources(config *config.Config, s *awsV1alpha1.S3Bucket) (err error) { +func syncAdditionalResources(config config.Config, s *awsV1alpha1.S3Bucket) (err error) { clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.S3Buckets(s.Namespace).Get(s.Name, metav1.GetOptions{}) if err != nil { diff --git a/pkg/operators/snssubscription/cft.go b/pkg/operators/snssubscription/cft.go index 5497b9821..3c8ee0df7 100644 --- a/pkg/operators/snssubscription/cft.go +++ b/pkg/operators/snssubscription/cft.go @@ -15,7 +15,7 @@ import ( ) // New generates a new object -func New(config *config.Config, snssubscription *awsV1alpha1.SNSSubscription, topicARN string) *Cloudformation { +func New(config config.Config, snssubscription *awsV1alpha1.SNSSubscription, topicARN string) *Cloudformation { return &Cloudformation{ SNSSubscription: snssubscription, config: config, @@ -25,7 +25,7 @@ func New(config *config.Config, snssubscription *awsV1alpha1.SNSSubscription, to // Cloudformation defines the snssubscription cfts type Cloudformation struct { - config *config.Config + config config.Config SNSSubscription *awsV1alpha1.SNSSubscription topicARN string } diff --git a/pkg/operators/snssubscription/operator.go b/pkg/operators/snssubscription/operator.go index fb4e2d13c..067f46599 100644 --- a/pkg/operators/snssubscription/operator.go +++ b/pkg/operators/snssubscription/operator.go @@ -26,13 +26,13 @@ import ( // Operator represents a controller object for object store custom resources type Operator struct { - config *config.Config + config config.Config topicARN string queueManager *queuemanager.QueueManager } // NewOperator create controller for watching object store custom resources created -func NewOperator(config *config.Config, queueManager *queuemanager.QueueManager) *Operator { +func NewOperator(config config.Config, queueManager *queuemanager.QueueManager) *Operator { queuectrl := queue.New(config, config.AWSClientset, 10) topicARN, _ := queuectrl.Register("snssubscription") queueManager.Add(topicARN, queuemanager.HandlerFunc(QueueUpdater)) @@ -57,7 +57,7 @@ func (c *Operator) StartWatch(ctx context.Context, namespace string) { } // QueueUpdater will take the messages from the queue and process them -func QueueUpdater(config *config.Config, msg *queuemanager.MessageBody) error { +func QueueUpdater(config config.Config, msg *queuemanager.MessageBody) error { logger := config.Logger var name, namespace string if msg.Updatable { @@ -167,7 +167,7 @@ func (c *Operator) onDelete(obj interface{}) { c.config.Logger.Infof("deleted snssubscription '%s'", s.Name) } -func incrementRollbackCount(config *config.Config, name string, namespace string) error { +func incrementRollbackCount(config config.Config, name string, namespace string) error { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSSubscriptions(namespace).Get(name, metav1.GetOptions{}) @@ -187,7 +187,7 @@ func incrementRollbackCount(config *config.Config, name string, namespace string return nil } -func updateStatus(config *config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.SNSSubscription, error) { +func updateStatus(config config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.SNSSubscription, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSSubscriptions(namespace).Get(name, metav1.GetOptions{}) @@ -225,7 +225,7 @@ func updateStatus(config *config.Config, name string, namespace string, stackID return resourceCopy, nil } -func deleteStack(config *config.Config, name string, namespace string, stackID string) (*awsV1alpha1.SNSSubscription, error) { +func deleteStack(config config.Config, name string, namespace string, stackID string) (*awsV1alpha1.SNSSubscription, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSSubscriptions(namespace).Get(name, metav1.GetOptions{}) @@ -244,7 +244,7 @@ func deleteStack(config *config.Config, name string, namespace string, stackID s return resource, err } -func syncAdditionalResources(config *config.Config, s *awsV1alpha1.SNSSubscription) (err error) { +func syncAdditionalResources(config config.Config, s *awsV1alpha1.SNSSubscription) (err error) { clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSSubscriptions(s.Namespace).Get(s.Name, metav1.GetOptions{}) if err != nil { diff --git a/pkg/operators/snstopic/cft.go b/pkg/operators/snstopic/cft.go index e2fd46527..5e04c2395 100644 --- a/pkg/operators/snstopic/cft.go +++ b/pkg/operators/snstopic/cft.go @@ -15,7 +15,7 @@ import ( ) // New generates a new object -func New(config *config.Config, snstopic *awsV1alpha1.SNSTopic, topicARN string) *Cloudformation { +func New(config config.Config, snstopic *awsV1alpha1.SNSTopic, topicARN string) *Cloudformation { return &Cloudformation{ SNSTopic: snstopic, config: config, @@ -25,7 +25,7 @@ func New(config *config.Config, snstopic *awsV1alpha1.SNSTopic, topicARN string) // Cloudformation defines the snstopic cfts type Cloudformation struct { - config *config.Config + config config.Config SNSTopic *awsV1alpha1.SNSTopic topicARN string } diff --git a/pkg/operators/snstopic/operator.go b/pkg/operators/snstopic/operator.go index d6218498d..6f67bacff 100644 --- a/pkg/operators/snstopic/operator.go +++ b/pkg/operators/snstopic/operator.go @@ -26,13 +26,13 @@ import ( // Operator represents a controller object for object store custom resources type Operator struct { - config *config.Config + config config.Config topicARN string queueManager *queuemanager.QueueManager } // NewOperator create controller for watching object store custom resources created -func NewOperator(config *config.Config, queueManager *queuemanager.QueueManager) *Operator { +func NewOperator(config config.Config, queueManager *queuemanager.QueueManager) *Operator { queuectrl := queue.New(config, config.AWSClientset, 10) topicARN, _ := queuectrl.Register("snstopic") queueManager.Add(topicARN, queuemanager.HandlerFunc(QueueUpdater)) @@ -57,7 +57,7 @@ func (c *Operator) StartWatch(ctx context.Context, namespace string) { } // QueueUpdater will take the messages from the queue and process them -func QueueUpdater(config *config.Config, msg *queuemanager.MessageBody) error { +func QueueUpdater(config config.Config, msg *queuemanager.MessageBody) error { logger := config.Logger var name, namespace string if msg.Updatable { @@ -167,7 +167,7 @@ func (c *Operator) onDelete(obj interface{}) { c.config.Logger.Infof("deleted snstopic '%s'", s.Name) } -func incrementRollbackCount(config *config.Config, name string, namespace string) error { +func incrementRollbackCount(config config.Config, name string, namespace string) error { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSTopics(namespace).Get(name, metav1.GetOptions{}) @@ -187,7 +187,7 @@ func incrementRollbackCount(config *config.Config, name string, namespace string return nil } -func updateStatus(config *config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.SNSTopic, error) { +func updateStatus(config config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.SNSTopic, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSTopics(namespace).Get(name, metav1.GetOptions{}) @@ -225,7 +225,7 @@ func updateStatus(config *config.Config, name string, namespace string, stackID return resourceCopy, nil } -func deleteStack(config *config.Config, name string, namespace string, stackID string) (*awsV1alpha1.SNSTopic, error) { +func deleteStack(config config.Config, name string, namespace string, stackID string) (*awsV1alpha1.SNSTopic, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSTopics(namespace).Get(name, metav1.GetOptions{}) @@ -244,7 +244,7 @@ func deleteStack(config *config.Config, name string, namespace string, stackID s return resource, err } -func syncAdditionalResources(config *config.Config, s *awsV1alpha1.SNSTopic) (err error) { +func syncAdditionalResources(config config.Config, s *awsV1alpha1.SNSTopic) (err error) { clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SNSTopics(s.Namespace).Get(s.Name, metav1.GetOptions{}) if err != nil { diff --git a/pkg/operators/sqsqueue/cft.go b/pkg/operators/sqsqueue/cft.go index 9ee0580fd..fdd261a9a 100644 --- a/pkg/operators/sqsqueue/cft.go +++ b/pkg/operators/sqsqueue/cft.go @@ -15,7 +15,7 @@ import ( ) // New generates a new object -func New(config *config.Config, sqsqueue *awsV1alpha1.SQSQueue, topicARN string) *Cloudformation { +func New(config config.Config, sqsqueue *awsV1alpha1.SQSQueue, topicARN string) *Cloudformation { return &Cloudformation{ SQSQueue: sqsqueue, config: config, @@ -25,7 +25,7 @@ func New(config *config.Config, sqsqueue *awsV1alpha1.SQSQueue, topicARN string) // Cloudformation defines the sqsqueue cfts type Cloudformation struct { - config *config.Config + config config.Config SQSQueue *awsV1alpha1.SQSQueue topicARN string } diff --git a/pkg/operators/sqsqueue/operator.go b/pkg/operators/sqsqueue/operator.go index 339dc4c3c..2f1c49816 100644 --- a/pkg/operators/sqsqueue/operator.go +++ b/pkg/operators/sqsqueue/operator.go @@ -26,13 +26,13 @@ import ( // Operator represents a controller object for object store custom resources type Operator struct { - config *config.Config + config config.Config topicARN string queueManager *queuemanager.QueueManager } // NewOperator create controller for watching object store custom resources created -func NewOperator(config *config.Config, queueManager *queuemanager.QueueManager) *Operator { +func NewOperator(config config.Config, queueManager *queuemanager.QueueManager) *Operator { queuectrl := queue.New(config, config.AWSClientset, 10) topicARN, _ := queuectrl.Register("sqsqueue") queueManager.Add(topicARN, queuemanager.HandlerFunc(QueueUpdater)) @@ -57,7 +57,7 @@ func (c *Operator) StartWatch(ctx context.Context, namespace string) { } // QueueUpdater will take the messages from the queue and process them -func QueueUpdater(config *config.Config, msg *queuemanager.MessageBody) error { +func QueueUpdater(config config.Config, msg *queuemanager.MessageBody) error { logger := config.Logger var name, namespace string if msg.Updatable { @@ -167,7 +167,7 @@ func (c *Operator) onDelete(obj interface{}) { c.config.Logger.Infof("deleted sqsqueue '%s'", s.Name) } -func incrementRollbackCount(config *config.Config, name string, namespace string) error { +func incrementRollbackCount(config config.Config, name string, namespace string) error { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SQSQueues(namespace).Get(name, metav1.GetOptions{}) @@ -187,7 +187,7 @@ func incrementRollbackCount(config *config.Config, name string, namespace string return nil } -func updateStatus(config *config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.SQSQueue, error) { +func updateStatus(config config.Config, name string, namespace string, stackID string, status string, reason string) (*awsV1alpha1.SQSQueue, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SQSQueues(namespace).Get(name, metav1.GetOptions{}) @@ -230,7 +230,7 @@ func updateStatus(config *config.Config, name string, namespace string, stackID return resourceCopy, nil } -func deleteStack(config *config.Config, name string, namespace string, stackID string) (*awsV1alpha1.SQSQueue, error) { +func deleteStack(config config.Config, name string, namespace string, stackID string) (*awsV1alpha1.SQSQueue, error) { logger := config.Logger clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SQSQueues(namespace).Get(name, metav1.GetOptions{}) @@ -249,7 +249,7 @@ func deleteStack(config *config.Config, name string, namespace string, stackID s return resource, err } -func syncAdditionalResources(config *config.Config, s *awsV1alpha1.SQSQueue) (err error) { +func syncAdditionalResources(config config.Config, s *awsV1alpha1.SQSQueue) (err error) { clientSet, _ := awsclient.NewForConfig(config.RESTConfig) resource, err := clientSet.SQSQueues(s.Namespace).Get(s.Name, metav1.GetOptions{}) if err != nil { diff --git a/pkg/queue/queue.go b/pkg/queue/queue.go index 06b2cd252..41c249cea 100644 --- a/pkg/queue/queue.go +++ b/pkg/queue/queue.go @@ -15,7 +15,7 @@ import ( ) // New will initialize the Queue object for watching -func New(config *config.Config, awsclientset awsclient.ServiceoperatorV1alpha1Interface, timeout int) *Queue { +func New(config config.Config, awsclientset awsclient.ServiceoperatorV1alpha1Interface, timeout int) *Queue { return &Queue{ config: config, awsclientset: awsclientset, @@ -24,10 +24,9 @@ func New(config *config.Config, awsclientset awsclient.ServiceoperatorV1alpha1In } // RegisterQueue wkll create the Queue so it is accessible to SNS. -func RegisterQueue(config *config.Config, name string) (queueURL, queueARN string, manager *queuemanager.QueueManager, err error) { - manager = queuemanager.New() - sqsSvc := sqs.New(config.AWSSession) - keyname := keyName(config.ClusterName, name) +func RegisterQueue(awsSession *session.Session, clusterName, name string) (queueURL, queueARN string, err error) { + sqsSvc := sqs.New(awsSession) + keyname := keyName(clusterName, name) queueInputs := sqs.CreateQueueInput{ QueueName: aws.String(keyname), Attributes: map[string]*string{ @@ -37,7 +36,7 @@ func RegisterQueue(config *config.Config, name string) (queueURL, queueARN strin } sqsOutput, err := sqsSvc.CreateQueue(&queueInputs) if err != nil { - return "", "", manager, err + return "", "", err } queueURL = *sqsOutput.QueueUrl @@ -49,14 +48,14 @@ func RegisterQueue(config *config.Config, name string) (queueURL, queueARN strin } sqsQueueOutput, err := sqsSvc.GetQueueAttributes(&queueQueryInputs) if err != nil { - return "", "", manager, err + return "", "", err } queueARN = *sqsQueueOutput.Attributes["QueueArn"] - return queueURL, queueARN, manager, nil + return queueURL, queueARN, nil } // Subscribe will listen to the global queue and distribute messages -func Subscribe(config *config.Config, manager *queuemanager.QueueManager, ctx context.Context) { +func Subscribe(config config.Config, manager *queuemanager.QueueManager, ctx context.Context) { logger := config.Logger sess, err := session.NewSession(&aws.Config{ Region: aws.String(config.Region), @@ -101,7 +100,7 @@ func (q *Queue) Register(name string) (topicARN string, subARN string) { return } -func SetQueuePolicy(config *config.Config, manager *queuemanager.QueueManager) error { +func SetQueuePolicy(config config.Config, manager *queuemanager.QueueManager) error { sqsSvc := sqs.New(config.AWSSession) topicARNs := manager.Keys() @@ -151,7 +150,7 @@ func newPolicy(queueARN string, name string, topicARNs []string) Policy { } } -func process(config *config.Config, svc *sqs.SQS, manager *queuemanager.QueueManager, ctx context.Context) error { +func process(config config.Config, svc *sqs.SQS, manager *queuemanager.QueueManager, ctx context.Context) error { logger := config.Logger for { result, err := svc.ReceiveMessage(&sqs.ReceiveMessageInput{ diff --git a/pkg/queue/types.go b/pkg/queue/types.go index 341b816d3..eea5b5f85 100644 --- a/pkg/queue/types.go +++ b/pkg/queue/types.go @@ -7,7 +7,7 @@ import ( // Queue wraps the config object for updating type Queue struct { - config *config.Config + config config.Config queueURL string awsclientset awsclient.ServiceoperatorV1alpha1Interface timeout int64 diff --git a/pkg/queuemanager/queuemanager.go b/pkg/queuemanager/queuemanager.go index 53f741189..7021f5cbf 100644 --- a/pkg/queuemanager/queuemanager.go +++ b/pkg/queuemanager/queuemanager.go @@ -2,9 +2,10 @@ package queuemanager import ( "encoding/json" + "strings" + "github.com/awslabs/aws-service-operator/pkg/config" "github.com/awslabs/aws-service-operator/pkg/helpers" - "strings" ) // New will return the QueueManager @@ -43,7 +44,7 @@ func (q *QueueManager) Keys() []string { } // HandleMessage will stub the handler for processing messages -func (f HandlerFunc) HandleMessage(config *config.Config, msg *MessageBody) error { +func (f HandlerFunc) HandleMessage(config config.Config, msg *MessageBody) error { return f(config, msg) } diff --git a/pkg/queuemanager/types.go b/pkg/queuemanager/types.go index b1d43cb5c..9ca71e2f8 100644 --- a/pkg/queuemanager/types.go +++ b/pkg/queuemanager/types.go @@ -1,16 +1,17 @@ package queuemanager import ( - "github.com/awslabs/aws-service-operator/pkg/config" "sync" + + "github.com/awslabs/aws-service-operator/pkg/config" ) // HandlerFunc allows you to define a custom function for when a message is stored -type HandlerFunc func(config *config.Config, msg *MessageBody) error +type HandlerFunc func(config config.Config, msg *MessageBody) error // Handler allows a custom function to be passed type Handler interface { - HandleMessage(config *config.Config, msg *MessageBody) error + HandleMessage(config config.Config, msg *MessageBody) error } // Queue Manager allows you to register topics and a handler function diff --git a/pkg/server/server.go b/pkg/server/server.go index 4dfb55ee6..21b51c93a 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -5,22 +5,19 @@ import ( "fmt" "net/http" - awsscheme "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/scheme" + awsscheme "github.com/awslabs/aws-service-operator/pkg/apis/service-operator.aws/v1alpha1" "github.com/awslabs/aws-service-operator/pkg/config" opBase "github.com/awslabs/aws-service-operator/pkg/operators/base" "github.com/awslabs/aws-service-operator/pkg/queue" + "github.com/awslabs/aws-service-operator/pkg/queuemanager" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/sirupsen/logrus" corev1 "k8s.io/api/core/v1" "k8s.io/client-go/kubernetes/scheme" - typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1" - "k8s.io/client-go/tools/record" ) -const controllerName = "aws-service-operator" - // New creates a new server from a config -func New(config *config.Config) *Server { +func New(config config.Config) *Server { return &Server{ Config: config, } @@ -51,22 +48,11 @@ func (c *Server) watchOperatorResources(errChan chan error, ctx context.Context) logger.Info("getting kubernetes context") awsscheme.AddToScheme(scheme.Scheme) - eventBroadcaster := record.NewBroadcaster() - eventBroadcaster.StartLogging(logger.Infof) - eventBroadcaster.StartRecordingToSink(&typedcorev1.EventSinkImpl{Interface: c.Config.KubeClientset.CoreV1().Events("")}) - recorder := eventBroadcaster.NewRecorder(scheme.Scheme, corev1.EventSource{Component: controllerName}) - c.Config.Recorder = recorder - - queueURL, queueARN, queueManager, err := queue.RegisterQueue(c.Config, "cloudformation") - if err != nil { - logger.WithError(err).Error("error reqistering queue") - } - c.Config.QueueURL = queueURL - c.Config.QueueARN = queueARN + queueManager := queuemanager.New() operators := opBase.New(c.Config, queueManager) - err = queue.SetQueuePolicy(c.Config, queueManager) + err := queue.SetQueuePolicy(c.Config, queueManager) if err != nil { logger.WithError(err).Error("error setting queue policy") } diff --git a/pkg/server/types.go b/pkg/server/types.go index d5152bd60..3c5b25e83 100644 --- a/pkg/server/types.go +++ b/pkg/server/types.go @@ -9,5 +9,5 @@ import ( // Server defines the bas construct for the operator type Server struct { http.ServeMux - Config *config.Config + Config config.Config }