mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Move controller to it's own package, it's not part of the registry.
This commit is contained in:
parent
bb81caa60d
commit
a24116c7bd
@ -28,7 +28,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
"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/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
"github.com/coreos/go-etcd/etcd"
|
"github.com/coreos/go-etcd/etcd"
|
||||||
)
|
)
|
||||||
@ -48,7 +48,7 @@ func main() {
|
|||||||
// Set up logger for etcd client
|
// Set up logger for etcd client
|
||||||
etcd.SetLogger(log.New(os.Stderr, "etcd ", log.LstdFlags))
|
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{
|
client.Client{
|
||||||
Host: "http://" + *master,
|
Host: "http://" + *master,
|
||||||
})
|
})
|
||||||
|
19
pkg/controller/doc.go
Normal file
19
pkg/controller/doc.go
Normal file
@ -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
|
@ -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
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
package registry
|
|
||||||
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
@ -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
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
package registry
|
|
||||||
|
package controller
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
@ -31,6 +32,13 @@ import (
|
|||||||
// TODO: Move this to a common place, it's needed in multiple tests.
|
// TODO: Move this to a common place, it's needed in multiple tests.
|
||||||
var apiPath = "/api/v1beta1"
|
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 {
|
func makeUrl(suffix string) string {
|
||||||
return apiPath + suffix
|
return apiPath + suffix
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user