Skip to content

Commit

Permalink
Remove serviceaccount feature flag for the SA controller.
Browse files Browse the repository at this point in the history
  • Loading branch information
saumoh committed Apr 3, 2018
1 parent fefbf83 commit e2e5ec4
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 17 deletions.
8 changes: 4 additions & 4 deletions glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import:
- tools/cache
- tools/clientcmd
- package: github.com/projectcalico/libcalico-go
version: 88291609bbefd0fe22982a7a78ec51d63583a651
version: 9070d94a5bf7214a417372890fa0ad28eb13e813
- package: github.com/projectcalico/felix
version: 518dbc352494a962e46d50f8bfe72a70c86951bf
subpackages:
Expand Down
9 changes: 2 additions & 7 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,8 @@ func main() {
nodeController := node.NewNodeController(ctx, k8sClientset, calicoClient)
go nodeController.Run(config.NodeWorkers, config.ReconcilerPeriod, stop)
case "serviceaccount":
if apiconfig.IsAlphaFeatureSet(os.Getenv("ALPHA_FEATURES"), apiconfig.AlphaFeatureSA) {
log.Info("Running service accounts profile controller")
serviceAccountController := serviceaccount.NewServiceAccountController(ctx, k8sClientset, calicoClient)
go serviceAccountController.Run(config.ProfileWorkers, config.ReconcilerPeriod, stop)
} else {
log.Info("Not running service account profile controller. Not set in ALPHA_FEATURES.")
}
serviceAccountController := serviceaccount.NewServiceAccountController(ctx, k8sClientset, calicoClient)
go serviceAccountController.Run(config.ProfileWorkers, config.ReconcilerPeriod, stop)
default:
log.Fatalf("Invalid controller '%s' provided. Valid options are workloadendpoint, profile, policy", controllerType)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ type Config struct {
CompactionPeriod string `default:"10m" split_words:"true"`

// Which controllers to run.
// 'serviceaccount' is not a default yet.
EnabledControllers string `default:"policy,namespace,workloadendpoint" split_words:"true"`
EnabledControllers string `default:"policy,namespace,workloadendpoint,serviceaccount" split_words:"true"`

// Number of workers to run for each controller.
WorkloadEndpointWorkers int `default:"1" split_words:"true"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ var _ = Describe("Config", func() {
It("shoud return default values", func() {
Expect(config.LogLevel).To(Equal("info"))
Expect(config.ReconcilerPeriod).To(Equal("5m"))
Expect(config.EnabledControllers).To(Equal("policy,namespace,workloadendpoint"))
Expect(config.EnabledControllers).To(Equal("policy,namespace,workloadendpoint,serviceaccount"))
Expect(config.WorkloadEndpointWorkers).To(Equal(1))
Expect(config.ProfileWorkers).To(Equal(1))
Expect(config.PolicyWorkers).To(Equal(1))
Expand Down
1 change: 0 additions & 1 deletion tests/testutils/policy_controller_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ func RunPolicyController(etcdIP, kconfigfile string) *containers.Container {
"-e", "LOG_LEVEL=debug",
"-e", fmt.Sprintf("KUBECONFIG=%s", kconfigfile),
"-e", "RECONCILER_PERIOD=10s",
"-e", "ALPHA_FEATURES=serviceaccounts",
"-v", fmt.Sprintf("%s:%s", kconfigfile, kconfigfile),
fmt.Sprintf("%s", os.Getenv("CONTAINER_NAME")))
}
1 change: 0 additions & 1 deletion tests/testutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ func GetCalicoClient(etcdIP string) client.Interface {
cfg := apiconfig.NewCalicoAPIConfig()
cfg.Spec.DatastoreType = apiconfig.EtcdV3
cfg.Spec.EtcdEndpoints = fmt.Sprintf("http://%s:2379", etcdIP)
cfg.Spec.AlphaFeatures = "serviceaccounts"
client, err := client.New(*cfg)

Expect(err).NotTo(HaveOccurred())
Expand Down

0 comments on commit e2e5ec4

Please sign in to comment.