Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Commit

Permalink
Merge pull request #298 from krousey/v1beta3
Browse files Browse the repository at this point in the history
Updating to use v1beta3 API of Kubernetes
  • Loading branch information
vishh committed May 28, 2015
2 parents 61bfdf6 + 36e0a57 commit 680b317
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/source-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ To run without auth file, use the following config:

The following options are available:

* `apiVersion` - API version to use to talk to Kubernetes (default: `v1beta1`)
* `apiVersion` - API version to use to talk to Kubernetes (default: `v1beta3`)
* `insecure` - whether to trust kubernetes certificates (default: `false`)
* `kubeletPort` - kubelet port to use (default: `10255`)
* `kubeletHttps` - whether to use https to connect to kubelets (default: `false`)
Expand Down
8 changes: 4 additions & 4 deletions integration/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"time"

"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta2"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta3"
kclient "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
kclientcmd "github.com/GoogleCloudPlatform/kubernetes/pkg/client/clientcmd"
kclientcmdapi "github.com/GoogleCloudPlatform/kubernetes/pkg/client/clientcmd/api"
Expand Down Expand Up @@ -214,7 +214,7 @@ func getKubeClient() (string, *kclient.Client, error) {
*c,
&kclientcmd.ConfigOverrides{
ClusterInfo: kclientcmdapi.Cluster{
APIVersion: "v1beta1",
APIVersion: "v1beta3",
},
}).ClientConfig()
if err != nil {
Expand Down Expand Up @@ -354,7 +354,7 @@ func (self *realKubeFramework) loadObject(filePath string) (runtime.Object, erro
if err != nil {
return nil, fmt.Errorf("failed to read object: %v", err)
}
return v1beta2.Codec.Decode(data)
return v1beta3.Codec.Decode(data)
}

func (self *realKubeFramework) ParseRC(filePath string) (*api.ReplicationController, error) {
Expand Down Expand Up @@ -423,7 +423,7 @@ func (self *realKubeFramework) DestroyCluster() {
}

func (self *realKubeFramework) GetProxyUrlForService(serviceName string) string {
return fmt.Sprintf("%s/api/v1beta1/proxy/services/%s/", self.masterIP, serviceName)
return fmt.Sprintf("%s/api/v1beta3/proxy/namespaces/default/services/%s/", self.masterIP, serviceName)
}

func (self *realKubeFramework) GetNodes() ([]string, error) {
Expand Down
2 changes: 1 addition & 1 deletion sources/kube_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
)

const (
defaultApiVersion = "v1beta1"
defaultApiVersion = "v1beta3"
defaultInsecure = false
defaultKubeletPort = 10255
defaultKubeConfigFile = "/etc/kubernetes/kubeconfig/kubeconfig"
Expand Down
2 changes: 1 addition & 1 deletion sources/nodes/kube.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func NewKubeNodes(client *client.Client) (NodesApi, error) {
return nil, fmt.Errorf("client is nil")
}

lw := cache.NewListWatchFromClient(client, "minions", api.NamespaceAll, fields.Everything())
lw := cache.NewListWatchFromClient(client, "nodes", api.NamespaceAll, fields.Everything())
nodeLister := &cache.StoreToNodeLister{Store: cache.NewStore(cache.MetaNamespaceKeyFunc)}
reflector := cache.NewReflector(lw, &api.Node{}, nodeLister.Store, 0)
stopChan := make(chan struct{})
Expand Down
4 changes: 2 additions & 2 deletions sources/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func (self *realPodsApi) parseAllPods(podNodePairs []podNodePair) []api.Pod {
func (self *realPodsApi) getNodeSelector(nodeList *nodes.NodeList) (labels.Selector, error) {
nodeLabels := []string{}
for host := range nodeList.Items {
nodeLabels = append(nodeLabels, fmt.Sprintf("DesiredState.Host==%s", host))
nodeLabels = append(nodeLabels, fmt.Sprintf("spec.host==%s", host))
}
glog.V(2).Infof("using labels %v to find pods", nodeLabels)
return labels.Parse(strings.Join(nodeLabels, ","))
Expand Down Expand Up @@ -127,7 +127,7 @@ func (self *realPodsApi) DebugInfo() string {
func newPodsApi(client *client.Client) podsApi {
// Extend the selector to include specific nodes to monitor
// or provide an API to update the nodes to monitor.
selector, err := fields.ParseSelector("DesiredState.Host!=")
selector, err := fields.ParseSelector("spec.host!=")
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 680b317

Please sign in to comment.