mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-09 11:17:32 +00:00
Fix examples that don't build
This commit is contained in:
parent
49948ae0ca
commit
b7db396afa
@ -20,8 +20,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/client-go/pkg/api/v1"
|
|
||||||
"k8s.io/client-go/rest"
|
"k8s.io/client-go/rest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/client-go/pkg/api/v1"
|
|
||||||
"k8s.io/client-go/tools/clientcmd"
|
"k8s.io/client-go/tools/clientcmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -4,15 +4,14 @@ import (
|
|||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"k8s.io/apimachinery/pkg/api/errors"
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/serializer"
|
||||||
"k8s.io/client-go/kubernetes"
|
"k8s.io/client-go/kubernetes"
|
||||||
"k8s.io/client-go/pkg/api"
|
"k8s.io/client-go/pkg/api"
|
||||||
"k8s.io/client-go/pkg/api/errors"
|
|
||||||
"k8s.io/client-go/pkg/api/v1"
|
|
||||||
"k8s.io/client-go/pkg/apis/extensions/v1beta1"
|
"k8s.io/client-go/pkg/apis/extensions/v1beta1"
|
||||||
metav1 "k8s.io/client-go/pkg/apis/meta/v1"
|
|
||||||
"k8s.io/client-go/pkg/runtime"
|
|
||||||
"k8s.io/client-go/pkg/runtime/schema"
|
|
||||||
"k8s.io/client-go/pkg/runtime/serializer"
|
|
||||||
"k8s.io/client-go/rest"
|
"k8s.io/client-go/rest"
|
||||||
"k8s.io/client-go/tools/clientcmd"
|
"k8s.io/client-go/tools/clientcmd"
|
||||||
|
|
||||||
@ -44,7 +43,7 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.IsNotFound(err) {
|
if errors.IsNotFound(err) {
|
||||||
tpr := &v1beta1.ThirdPartyResource{
|
tpr := &v1beta1.ThirdPartyResource{
|
||||||
ObjectMeta: v1.ObjectMeta{
|
ObjectMeta: metav1.ObjectMeta{
|
||||||
Name: "example.k8s.io",
|
Name: "example.k8s.io",
|
||||||
},
|
},
|
||||||
Versions: []v1beta1.APIVersion{
|
Versions: []v1beta1.APIVersion{
|
||||||
|
@ -3,10 +3,9 @@ package main
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
|
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||||
"k8s.io/client-go/pkg/api"
|
"k8s.io/client-go/pkg/api"
|
||||||
"k8s.io/client-go/pkg/api/meta"
|
|
||||||
metav1 "k8s.io/client-go/pkg/apis/meta/v1"
|
|
||||||
"k8s.io/client-go/pkg/runtime/schema"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ExampleSpec struct {
|
type ExampleSpec struct {
|
||||||
@ -34,7 +33,7 @@ func (e *Example) GetObjectKind() schema.ObjectKind {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Required to satisfy ObjectMetaAccessor interface
|
// Required to satisfy ObjectMetaAccessor interface
|
||||||
func (e *Example) GetObjectMeta() meta.Object {
|
func (e *Example) GetObjectMeta() *api.ObjectMeta {
|
||||||
return &e.Metadata
|
return &e.Metadata
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user