Skip to content
This repository was archived by the owner on Nov 7, 2019. It is now read-only.

Commit 75b62ca

Browse files
authored
Merge pull request #120 from awslabs/fix-watch-cloudformationtemplate
Fix watching cloudformation template resources
2 parents 7665efa + 9f48eaa commit 75b62ca

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

cmd/aws-service-operator/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ package main
22

33
import (
44
"fmt"
5+
"os"
6+
"strings"
7+
58
"github.com/aws/aws-sdk-go/aws"
69
"github.com/aws/aws-sdk-go/aws/ec2metadata"
710
"github.com/aws/aws-sdk-go/aws/session"
811
"github.com/awslabs/aws-service-operator/pkg/config"
912
homedir "github.com/mitchellh/go-homedir"
1013
"github.com/spf13/cobra"
1114
"github.com/spf13/viper"
12-
"os"
13-
"strings"
1415
)
1516

1617
var (
@@ -45,7 +46,7 @@ func init() {
4546
rootCmd.PersistentFlags().StringVarP(&awsRegion, "region", "r", "us-west-2", "AWS Region for resources to be created in")
4647
rootCmd.PersistentFlags().StringVarP(&logLevel, "loglevel", "l", "Info", "Log level for the CLI")
4748
rootCmd.PersistentFlags().StringVarP(&logFile, "logfile", "", "", "Log level for the CLI")
48-
rootCmd.PersistentFlags().StringVarP(&resources, "resources", "", "cloudformationtemplates,dynamodb,ecrrepository,s3bucket,snssubscription,snstopic,sqsqueue", "Comma delimited list of CRDs to deploy")
49+
rootCmd.PersistentFlags().StringVarP(&resources, "resources", "", "cloudformationtemplate,dynamodb,ecrrepository,s3bucket,snssubscription,snstopic,sqsqueue", "Comma delimited list of CRDs to deploy")
4950
rootCmd.PersistentFlags().StringVarP(&clusterName, "cluster-name", "i", "aws-operator", "Cluster name for the Application to run as, used to label the Cloudformation templated to avoid conflict")
5051
rootCmd.PersistentFlags().StringVarP(&bucket, "bucket", "b", "aws-operator", "To configure the operator you need a base bucket to contain the resources")
5152
rootCmd.PersistentFlags().StringVarP(&accountID, "account-id", "a", "", "AWS Account ID, this is used to configure outputs and operate on the proper account.")

pkg/server/server.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
package server
22

33
import (
4-
// "fmt"
5-
// "github.com/aws/aws-sdk-go/aws"
6-
// "github.com/aws/aws-sdk-go/aws/ec2metadata"
7-
// "github.com/aws/aws-sdk-go/aws/session"
8-
94
awsscheme "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/scheme"
10-
//awsclient "github.com/awslabs/aws-service-operator/pkg/client/clientset/versioned/typed/service-operator.aws/v1alpha1"
115
"github.com/awslabs/aws-service-operator/pkg/config"
126
opBase "github.com/awslabs/aws-service-operator/pkg/operators/base"
7+
"github.com/sirupsen/logrus"
138
corev1 "k8s.io/api/core/v1"
149
"k8s.io/client-go/kubernetes/scheme"
1510
typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"
@@ -39,7 +34,8 @@ func (c *Server) Run(stopChan chan struct{}) {
3934
config.Recorder = recorder
4035

4136
// start watching the aws operator resources
42-
logger.Info("Watching the resources")
37+
logger.WithFields(logrus.Fields{"resources": config.Resources}).Info("Watching")
38+
4339
operators := opBase.New(config) // TODO: remove context and Clientset
4440
err := operators.Watch(corev1.NamespaceAll, stopChan)
4541
if err != nil {

0 commit comments

Comments
 (0)