published by bot

(https://github.com/kubernetes/test-infra/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is ab794c612853e6c6dfda63594cb5d74914e7e151
This commit is contained in:
Kubernetes Publisher
2017-02-03 22:09:57 +00:00
parent 1679e38db8
commit 7ac1236194
66 changed files with 230 additions and 4317 deletions

View File

@@ -20,7 +20,7 @@ import (
"fmt"
"time"
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
)
@@ -37,7 +37,7 @@ func main() {
panic(err.Error())
}
for {
pods, err := clientset.Core().Pods("").List(v1.ListOptions{})
pods, err := clientset.CoreV1().Pods("").List(metav1.ListOptions{})
if err != nil {
panic(err.Error())
}

View File

@@ -21,7 +21,7 @@ import (
"fmt"
"time"
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
)
@@ -43,7 +43,7 @@ func main() {
panic(err.Error())
}
for {
pods, err := clientset.Core().Pods("").List(v1.ListOptions{})
pods, err := clientset.CoreV1().Pods("").List(metav1.ListOptions{})
if err != nil {
panic(err.Error())
}

View File

@@ -1,3 +1,19 @@
/*
Copyright 2017 The Kubernetes Authors.
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 main
import (
@@ -39,7 +55,7 @@ func main() {
}
// initialize third party resource if it does not exist
tpr, err := clientset.Extensions().ThirdPartyResources().Get("example.k8s.io", metav1.GetOptions{})
tpr, err := clientset.ExtensionsV1beta1().ThirdPartyResources().Get("example.k8s.io", metav1.GetOptions{})
if err != nil {
if errors.IsNotFound(err) {
tpr := &v1beta1.ThirdPartyResource{
@@ -52,7 +68,7 @@ func main() {
Description: "An Example ThirdPartyResource",
}
result, err := clientset.Extensions().ThirdPartyResources().Create(tpr)
result, err := clientset.ExtensionsV1beta1().ThirdPartyResources().Create(tpr)
if err != nil {
panic(err)
}
@@ -86,7 +102,7 @@ func main() {
if errors.IsNotFound(err) {
// Create an instance of our TPR
example := &Example{
Metadata: api.ObjectMeta{
Metadata: metav1.ObjectMeta{
Name: "example1",
},
Spec: ExampleSpec{
@@ -146,10 +162,9 @@ func configureClient(config *rest.Config) {
groupversion,
&Example{},
&ExampleList{},
&api.ListOptions{},
&api.DeleteOptions{},
)
return nil
})
metav1.AddToGroupVersion(api.Scheme, groupversion)
schemeBuilder.AddToScheme(api.Scheme)
}

View File

@@ -1,3 +1,19 @@
/*
Copyright 2017 The Kubernetes Authors.
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 main
import (
@@ -5,7 +21,6 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/pkg/api"
)
type ExampleSpec struct {
@@ -15,7 +30,7 @@ type ExampleSpec struct {
type Example struct {
metav1.TypeMeta `json:",inline"`
Metadata api.ObjectMeta `json:"metadata"`
Metadata metav1.ObjectMeta `json:"metadata"`
Spec ExampleSpec `json:"spec"`
}
@@ -33,7 +48,7 @@ func (e *Example) GetObjectKind() schema.ObjectKind {
}
// Required to satisfy ObjectMetaAccessor interface
func (e *Example) GetObjectMeta() *api.ObjectMeta {
func (e *Example) GetObjectMeta() metav1.Object {
return &e.Metadata
}