diff --git a/cmd/controller-manager/controller-manager.go b/cmd/controller-manager/controller-manager.go index 8781876bca5..82175e67f86 100644 --- a/cmd/controller-manager/controller-manager.go +++ b/cmd/controller-manager/controller-manager.go @@ -28,7 +28,7 @@ import ( "time" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" - "github.com/GoogleCloudPlatform/kubernetes/pkg/registry" + "github.com/GoogleCloudPlatform/kubernetes/pkg/controller" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "github.com/coreos/go-etcd/etcd" ) @@ -48,7 +48,7 @@ func main() { // Set up logger for etcd client etcd.SetLogger(log.New(os.Stderr, "etcd ", log.LstdFlags)) - controllerManager := registry.MakeReplicationManager(etcd.NewClient([]string{*etcd_servers}), + controllerManager := controller.MakeReplicationManager(etcd.NewClient([]string{*etcd_servers}), client.Client{ Host: "http://" + *master, }) diff --git a/pkg/controller/doc.go b/pkg/controller/doc.go new file mode 100644 index 00000000000..1b67b41ca82 --- /dev/null +++ b/pkg/controller/doc.go @@ -0,0 +1,19 @@ +/* +Copyright 2014 Google Inc. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package controller contains logic for watching and syncronizing +// replicationControllers. +package controller diff --git a/pkg/registry/replication_controller.go b/pkg/controller/replication_controller.go similarity index 99% rename from pkg/registry/replication_controller.go rename to pkg/controller/replication_controller.go index 3cdd2518609..6e6e1f68dba 100644 --- a/pkg/registry/replication_controller.go +++ b/pkg/controller/replication_controller.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package registry + +package controller import ( "encoding/json" diff --git a/pkg/registry/replication_controller_test.go b/pkg/controller/replication_controller_test.go similarity index 97% rename from pkg/registry/replication_controller_test.go rename to pkg/controller/replication_controller_test.go index 2bbbced8ba8..efe90f80fb2 100644 --- a/pkg/registry/replication_controller_test.go +++ b/pkg/controller/replication_controller_test.go @@ -13,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -package registry + +package controller import ( "encoding/json" @@ -31,6 +32,13 @@ import ( // TODO: Move this to a common place, it's needed in multiple tests. var apiPath = "/api/v1beta1" +// TODO: This doesn't reduce typing enough to make it worth the less readable errors. Remove. +func expectNoError(t *testing.T, err error) { + if err != nil { + t.Errorf("Unexpected error: %#v", err) + } +} + func makeUrl(suffix string) string { return apiPath + suffix }