Add glide.yaml and vendor deps
This commit is contained in:
parent
db918f12ad
commit
5b3d5e81bd
18880 changed files with 5166045 additions and 1 deletions
70
vendor/k8s.io/kubernetes/federation/Makefile
generated
vendored
Normal file
70
vendor/k8s.io/kubernetes/federation/Makefile
generated
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# Copyright 2016 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.
|
||||
|
||||
DBG_MAKEFILE ?=
|
||||
ifeq ($(DBG_MAKEFILE),1)
|
||||
$(warning ***** starting makefile for goal(s) "$(MAKECMDGOALS)")
|
||||
$(warning ***** $(shell date))
|
||||
else
|
||||
# If we're not debugging the Makefile, don't echo recipes.
|
||||
MAKEFLAGS += -s
|
||||
endif
|
||||
|
||||
.PHONY: all
|
||||
all: init build push deploy
|
||||
|
||||
.PHONY: init
|
||||
init:
|
||||
./develop/develop.sh init
|
||||
|
||||
.PHONY: build
|
||||
build: build_binaries build_image
|
||||
|
||||
.PHONY: push
|
||||
push:
|
||||
./develop/develop.sh push
|
||||
|
||||
.PHONY: deploy
|
||||
deploy: deploy_clusters deploy_federation
|
||||
|
||||
.PHONY: destroy
|
||||
destroy: destroy_federation destroy_clusters
|
||||
|
||||
.PHONY: build_binaries
|
||||
build_binaries:
|
||||
./develop/develop.sh build_binaries
|
||||
|
||||
.PHONY: build_image
|
||||
build_image:
|
||||
./develop/develop.sh build_image
|
||||
|
||||
.PHONY: deploy_clusters
|
||||
deploy_clusters:
|
||||
./develop/develop.sh deploy_clusters
|
||||
|
||||
.PHONY: deploy_federation
|
||||
deploy_federation:
|
||||
./develop/develop.sh deploy_federation
|
||||
|
||||
.PHONY: destroy_federation
|
||||
destroy_federation:
|
||||
./develop/develop.sh destroy_federation
|
||||
|
||||
.PHONY: destroy_clusters
|
||||
destroy_clusters:
|
||||
./develop/develop.sh destroy_clusters
|
||||
|
||||
.PHONY: redeploy_federation
|
||||
redeploy_federation:
|
||||
./develop/develop.sh redeploy_federation
|
||||
6
vendor/k8s.io/kubernetes/federation/OWNERS
generated
vendored
Normal file
6
vendor/k8s.io/kubernetes/federation/OWNERS
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
assignees:
|
||||
- quinton-hoole
|
||||
- madhusudancs
|
||||
- mml
|
||||
- nikhiljindal
|
||||
- colhom
|
||||
67
vendor/k8s.io/kubernetes/federation/README.md
generated
vendored
Normal file
67
vendor/k8s.io/kubernetes/federation/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
# Cluster Federation
|
||||
|
||||
Kubernetes Cluster Federation enables users to federate multiple
|
||||
Kubernetes clusters. Please see the [user guide](http://kubernetes.io/docs/user-guide/federation/federated-services/)
|
||||
and the [admin guide](http://kubernetes.io/docs/admin/federation/)
|
||||
for more details about setting up and using the Cluster Federation.
|
||||
|
||||
# Building Kubernetes Cluster Federation
|
||||
|
||||
Please see the [Kubernetes Development Guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md)
|
||||
for initial setup. Once you have the development environment setup
|
||||
as explained in that guide, you also need to install [`jq`](https://stedolan.github.io/jq/download/)
|
||||
<!-- TODO(madhusudancs): Re-evaluate using jq even in the development
|
||||
environment. There is a concern that adding more tools as dependencies
|
||||
might lead to proliferation of tools one need to install to develop
|
||||
Kubernetes. jq is already a dependency for kubernetes-anywhere on
|
||||
which this workflow depends, so we are giving an exception to jq
|
||||
for now. -->
|
||||
|
||||
Building cluster federation artifacts should be as simple as running:
|
||||
|
||||
```shell
|
||||
make build
|
||||
```
|
||||
|
||||
You can specify the docker registry to tag the image using the
|
||||
KUBE_REGISTRY environment variable. Please make sure that you use
|
||||
the same value in all the subsequent commands.
|
||||
|
||||
To push the built docker images to the registry, run:
|
||||
|
||||
```shell
|
||||
make push
|
||||
```
|
||||
|
||||
To initialize the deployment run:
|
||||
|
||||
(This pulls the installer images)
|
||||
|
||||
```shell
|
||||
make init
|
||||
```
|
||||
|
||||
To deploy the clusters and install the federation components, edit the
|
||||
`${KUBE_ROOT}/_output/federation/config.json` file to describe your
|
||||
clusters and run:
|
||||
|
||||
```shell
|
||||
make deploy
|
||||
```
|
||||
|
||||
To turn down the federation components and tear down the clusters run:
|
||||
|
||||
```shell
|
||||
make destroy
|
||||
```
|
||||
|
||||
# Ideas for improvement
|
||||
|
||||
1. Continue with `destroy` phase even in the face of errors.
|
||||
|
||||
The bash script sets `set -e errexit` which causes the script to exit
|
||||
at the very first error. This should be the default mode for deploying
|
||||
components but not for destroying/cleanup.
|
||||
|
||||
|
||||
[]()
|
||||
30
vendor/k8s.io/kubernetes/federation/apis/core/BUILD
generated
vendored
Normal file
30
vendor/k8s.io/kubernetes/federation/apis/core/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"conversion.go",
|
||||
"defaults.go",
|
||||
"register.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apis/meta/v1:go_default_library",
|
||||
"//pkg/fields:go_default_library",
|
||||
"//pkg/labels:go_default_library",
|
||||
"//pkg/runtime:go_default_library",
|
||||
"//pkg/runtime/schema:go_default_library",
|
||||
"//pkg/runtime/serializer:go_default_library",
|
||||
],
|
||||
)
|
||||
42
vendor/k8s.io/kubernetes/federation/apis/core/conversion.go
generated
vendored
Normal file
42
vendor/k8s.io/kubernetes/federation/apis/core/conversion.go
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
Copyright 2016 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 core
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
// Add non-generated conversion functions
|
||||
return scheme.AddConversionFuncs(
|
||||
api.Convert_v1_TypeMeta_To_v1_TypeMeta,
|
||||
api.Convert_unversioned_ListMeta_To_unversioned_ListMeta,
|
||||
api.Convert_intstr_IntOrString_To_intstr_IntOrString,
|
||||
api.Convert_unversioned_Time_To_unversioned_Time,
|
||||
api.Convert_Slice_string_To_unversioned_Time,
|
||||
api.Convert_string_To_labels_Selector,
|
||||
api.Convert_string_To_fields_Selector,
|
||||
api.Convert_Pointer_bool_To_bool,
|
||||
api.Convert_bool_To_Pointer_bool,
|
||||
api.Convert_Pointer_string_To_string,
|
||||
api.Convert_string_To_Pointer_string,
|
||||
api.Convert_labels_Selector_To_string,
|
||||
api.Convert_fields_Selector_To_string,
|
||||
api.Convert_resource_Quantity_To_resource_Quantity,
|
||||
)
|
||||
}
|
||||
37
vendor/k8s.io/kubernetes/federation/apis/core/defaults.go
generated
vendored
Normal file
37
vendor/k8s.io/kubernetes/federation/apis/core/defaults.go
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright 2016 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 core
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/fields"
|
||||
"k8s.io/kubernetes/pkg/labels"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
return scheme.AddDefaultingFuncs(
|
||||
func(obj *api.ListOptions) {
|
||||
if obj.LabelSelector == nil {
|
||||
obj.LabelSelector = labels.Everything()
|
||||
}
|
||||
if obj.FieldSelector == nil {
|
||||
obj.FieldSelector = fields.Everything()
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
29
vendor/k8s.io/kubernetes/federation/apis/core/install/BUILD
generated
vendored
Normal file
29
vendor/k8s.io/kubernetes/federation/apis/core/install/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["install.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/core:go_default_library",
|
||||
"//federation/apis/core/v1:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/api/meta:go_default_library",
|
||||
"//pkg/apimachinery:go_default_library",
|
||||
"//pkg/apimachinery/registered:go_default_library",
|
||||
"//pkg/runtime:go_default_library",
|
||||
"//pkg/runtime/schema:go_default_library",
|
||||
"//pkg/util/sets:go_default_library",
|
||||
"//vendor:github.com/golang/glog",
|
||||
],
|
||||
)
|
||||
145
vendor/k8s.io/kubernetes/federation/apis/core/install/install.go
generated
vendored
Normal file
145
vendor/k8s.io/kubernetes/federation/apis/core/install/install.go
generated
vendored
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
Copyright 2016 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 install
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
core "k8s.io/kubernetes/federation/apis/core"
|
||||
core_v1 "k8s.io/kubernetes/federation/apis/core/v1"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/apimachinery"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
)
|
||||
|
||||
const importPrefix = "k8s.io/kubernetes/pkg/api"
|
||||
|
||||
var accessor = meta.NewAccessor()
|
||||
|
||||
// availableVersions lists all known external versions for this group from most preferred to least preferred
|
||||
var availableVersions = []schema.GroupVersion{core_v1.SchemeGroupVersion}
|
||||
|
||||
func init() {
|
||||
registered.RegisterVersions(availableVersions)
|
||||
externalVersions := []schema.GroupVersion{}
|
||||
for _, v := range availableVersions {
|
||||
if registered.IsAllowedVersion(v) {
|
||||
externalVersions = append(externalVersions, v)
|
||||
}
|
||||
}
|
||||
if len(externalVersions) == 0 {
|
||||
glog.V(4).Infof("No version is registered for group %v", core.GroupName)
|
||||
return
|
||||
}
|
||||
|
||||
if err := registered.EnableVersions(externalVersions...); err != nil {
|
||||
glog.V(4).Infof("%v", err)
|
||||
return
|
||||
}
|
||||
if err := enableVersions(externalVersions); err != nil {
|
||||
glog.V(4).Infof("%v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: enableVersions should be centralized rather than spread in each API
|
||||
// group.
|
||||
// We can combine registered.RegisterVersions, registered.EnableVersions and
|
||||
// registered.RegisterGroup once we have moved enableVersions there.
|
||||
func enableVersions(externalVersions []schema.GroupVersion) error {
|
||||
addVersionsToScheme(externalVersions...)
|
||||
preferredExternalVersion := externalVersions[0]
|
||||
|
||||
groupMeta := apimachinery.GroupMeta{
|
||||
GroupVersion: preferredExternalVersion,
|
||||
GroupVersions: externalVersions,
|
||||
RESTMapper: newRESTMapper(externalVersions),
|
||||
SelfLinker: runtime.SelfLinker(accessor),
|
||||
InterfacesFor: interfacesFor,
|
||||
}
|
||||
|
||||
if err := registered.RegisterGroup(groupMeta); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// userResources is a group of resources mostly used by a kubectl user
|
||||
var userResources = []string{"svc"}
|
||||
|
||||
func newRESTMapper(externalVersions []schema.GroupVersion) meta.RESTMapper {
|
||||
// the list of kinds that are scoped at the root of the api hierarchy
|
||||
// if a kind is not enumerated here, it is assumed to have a namespace scope
|
||||
rootScoped := sets.NewString(
|
||||
"Namespace",
|
||||
)
|
||||
|
||||
// these kinds should be excluded from the list of resources
|
||||
ignoredKinds := sets.NewString(
|
||||
"ListOptions",
|
||||
"DeleteOptions",
|
||||
"Status")
|
||||
|
||||
mapper := api.NewDefaultRESTMapperFromScheme(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped, core.Scheme)
|
||||
// setup aliases for groups of resources
|
||||
mapper.AddResourceAlias("all", userResources...)
|
||||
|
||||
return mapper
|
||||
}
|
||||
|
||||
// InterfacesFor returns the default Codec and ResourceVersioner for a given version
|
||||
// string, or an error if the version is not known.
|
||||
func interfacesFor(version schema.GroupVersion) (*meta.VersionInterfaces, error) {
|
||||
switch version {
|
||||
case core_v1.SchemeGroupVersion:
|
||||
return &meta.VersionInterfaces{
|
||||
ObjectConvertor: core.Scheme,
|
||||
MetadataAccessor: accessor,
|
||||
}, nil
|
||||
default:
|
||||
g, _ := registered.Group(core.GroupName)
|
||||
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
||||
}
|
||||
}
|
||||
|
||||
func addVersionsToScheme(externalVersions ...schema.GroupVersion) {
|
||||
// add the internal version to Scheme
|
||||
if err := core.AddToScheme(core.Scheme); err != nil {
|
||||
// Programmer error, detect immediately
|
||||
panic(err)
|
||||
}
|
||||
// add the enabled external versions to Scheme
|
||||
for _, v := range externalVersions {
|
||||
if !registered.IsEnabledVersion(v) {
|
||||
glog.Errorf("Version %s is not enabled, so it will not be added to the Scheme.", v)
|
||||
continue
|
||||
}
|
||||
switch v {
|
||||
case core_v1.SchemeGroupVersion:
|
||||
if err := core_v1.AddToScheme(core.Scheme); err != nil {
|
||||
// Programmer error, detect immediately
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
90
vendor/k8s.io/kubernetes/federation/apis/core/register.go
generated
vendored
Normal file
90
vendor/k8s.io/kubernetes/federation/apis/core/register.go
generated
vendored
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
Copyright 2016 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 core
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||
"k8s.io/kubernetes/pkg/runtime/serializer"
|
||||
)
|
||||
|
||||
// Scheme is the default instance of runtime.Scheme to which types in the Kubernetes API are already registered.
|
||||
var Scheme = runtime.NewScheme()
|
||||
|
||||
// Codecs provides access to encoding and decoding for the scheme
|
||||
var Codecs = serializer.NewCodecFactory(Scheme)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = ""
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
|
||||
|
||||
// Unversioned is group version for unversioned API objects
|
||||
// TODO: this should be v1 probably
|
||||
var Unversioned = schema.GroupVersion{Group: "", Version: "v1"}
|
||||
|
||||
// ParameterCodec handles versioning of objects that are converted to query parameters.
|
||||
var ParameterCodec = runtime.NewParameterCodec(Scheme)
|
||||
|
||||
// Kind takes an unqualified kind and returns a Group qualified GroupKind
|
||||
func Kind(kind string) schema.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs, addConversionFuncs)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
if err := scheme.AddIgnoredConversionType(&metav1.TypeMeta{}, &metav1.TypeMeta{}); err != nil {
|
||||
return err
|
||||
}
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&api.ServiceList{},
|
||||
&api.Service{},
|
||||
&api.Namespace{},
|
||||
&api.NamespaceList{},
|
||||
&api.ListOptions{},
|
||||
&api.DeleteOptions{},
|
||||
&api.Secret{},
|
||||
&api.SecretList{},
|
||||
&api.Event{},
|
||||
&api.EventList{},
|
||||
&api.ConfigMap{},
|
||||
&api.ConfigMapList{},
|
||||
)
|
||||
|
||||
// Register Unversioned types under their own special group
|
||||
scheme.AddUnversionedTypes(Unversioned,
|
||||
&metav1.ExportOptions{},
|
||||
&metav1.Status{},
|
||||
&metav1.APIVersions{},
|
||||
&metav1.APIGroupList{},
|
||||
&metav1.APIGroup{},
|
||||
&metav1.APIResourceList{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
30
vendor/k8s.io/kubernetes/federation/apis/core/v1/BUILD
generated
vendored
Normal file
30
vendor/k8s.io/kubernetes/federation/apis/core/v1/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"conversion.go",
|
||||
"defaults.go",
|
||||
"doc.go",
|
||||
"register.go",
|
||||
"zz_generated.conversion.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api/v1:go_default_library",
|
||||
"//pkg/apis/meta/v1:go_default_library",
|
||||
"//pkg/runtime:go_default_library",
|
||||
"//pkg/runtime/schema:go_default_library",
|
||||
"//pkg/watch/versioned:go_default_library",
|
||||
],
|
||||
)
|
||||
92
vendor/k8s.io/kubernetes/federation/apis/core/v1/conversion.go
generated
vendored
Normal file
92
vendor/k8s.io/kubernetes/federation/apis/core/v1/conversion.go
generated
vendored
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
Copyright 2016 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 v1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
// Add non-generated conversion functions
|
||||
err := scheme.AddConversionFuncs(
|
||||
v1.Convert_v1_DeleteOptions_To_api_DeleteOptions,
|
||||
v1.Convert_api_DeleteOptions_To_v1_DeleteOptions,
|
||||
v1.Convert_v1_List_To_api_List,
|
||||
v1.Convert_api_List_To_v1_List,
|
||||
v1.Convert_v1_ListOptions_To_api_ListOptions,
|
||||
v1.Convert_api_ListOptions_To_v1_ListOptions,
|
||||
v1.Convert_v1_ObjectFieldSelector_To_api_ObjectFieldSelector,
|
||||
v1.Convert_api_ObjectFieldSelector_To_v1_ObjectFieldSelector,
|
||||
v1.Convert_v1_ObjectMeta_To_api_ObjectMeta,
|
||||
v1.Convert_api_ObjectMeta_To_v1_ObjectMeta,
|
||||
v1.Convert_v1_ObjectReference_To_api_ObjectReference,
|
||||
v1.Convert_api_ObjectReference_To_v1_ObjectReference,
|
||||
v1.Convert_v1_OwnerReference_To_api_OwnerReference,
|
||||
v1.Convert_api_OwnerReference_To_v1_OwnerReference,
|
||||
v1.Convert_v1_Secret_To_api_Secret,
|
||||
v1.Convert_api_Secret_To_v1_Secret,
|
||||
v1.Convert_v1_SecretList_To_api_SecretList,
|
||||
v1.Convert_api_SecretList_To_v1_SecretList,
|
||||
v1.Convert_v1_Service_To_api_Service,
|
||||
v1.Convert_api_Service_To_v1_Service,
|
||||
v1.Convert_v1_ServiceList_To_api_ServiceList,
|
||||
v1.Convert_api_ServiceList_To_v1_ServiceList,
|
||||
v1.Convert_v1_ServicePort_To_api_ServicePort,
|
||||
v1.Convert_api_ServicePort_To_v1_ServicePort,
|
||||
v1.Convert_v1_ServiceProxyOptions_To_api_ServiceProxyOptions,
|
||||
v1.Convert_api_ServiceProxyOptions_To_v1_ServiceProxyOptions,
|
||||
v1.Convert_v1_ServiceSpec_To_api_ServiceSpec,
|
||||
v1.Convert_api_ServiceSpec_To_v1_ServiceSpec,
|
||||
v1.Convert_v1_ServiceStatus_To_api_ServiceStatus,
|
||||
v1.Convert_api_ServiceStatus_To_v1_ServiceStatus,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Add field label conversions for kinds having selectable nothing but ObjectMeta fields.
|
||||
for _, kind := range []string{
|
||||
"Service",
|
||||
} {
|
||||
err = scheme.AddFieldLabelConversionFunc("v1", kind,
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "metadata.namespace",
|
||||
"metadata.name":
|
||||
return label, value, nil
|
||||
default:
|
||||
return "", "", fmt.Errorf("field label %q not supported for %q", label, kind)
|
||||
}
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if err := v1.AddFieldLabelConversionsForEvent(scheme); err != nil {
|
||||
return nil
|
||||
}
|
||||
if err := v1.AddFieldLabelConversionsForNamespace(scheme); err != nil {
|
||||
return nil
|
||||
}
|
||||
if err := v1.AddFieldLabelConversionsForSecret(scheme); err != nil {
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
31
vendor/k8s.io/kubernetes/federation/apis/core/v1/defaults.go
generated
vendored
Normal file
31
vendor/k8s.io/kubernetes/federation/apis/core/v1/defaults.go
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
Copyright 2016 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 v1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
v1.RegisterDefaults(scheme)
|
||||
return scheme.AddDefaultingFuncs(
|
||||
v1.SetDefaults_Secret,
|
||||
v1.SetDefaults_ServiceSpec,
|
||||
v1.SetDefaults_NamespaceStatus,
|
||||
)
|
||||
}
|
||||
23
vendor/k8s.io/kubernetes/federation/apis/core/v1/doc.go
generated
vendored
Normal file
23
vendor/k8s.io/kubernetes/federation/apis/core/v1/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This is probably not required for now because we are reusing the types
|
||||
// in k8s.io/kubernetes/pkg/api. But adding it now as a guard to ensure
|
||||
// that others don't stumble on this in the future when they add new
|
||||
// types here since adding it now doesn't hurt.
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/federation/apis/core
|
||||
|
||||
package v1
|
||||
61
vendor/k8s.io/kubernetes/federation/apis/core/v1/register.go
generated
vendored
Normal file
61
vendor/k8s.io/kubernetes/federation/apis/core/v1/register.go
generated
vendored
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
Copyright 2014 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 v1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||
versionedwatch "k8s.io/kubernetes/pkg/watch/versioned"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = ""
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1"}
|
||||
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addConversionFuncs, addDefaultingFuncs)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
// Adds the list of known types to api.Scheme.
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&v1.Service{},
|
||||
&v1.Namespace{},
|
||||
&v1.NamespaceList{},
|
||||
&v1.ServiceList{},
|
||||
&v1.ListOptions{},
|
||||
&v1.DeleteOptions{},
|
||||
&v1.Secret{},
|
||||
&v1.SecretList{},
|
||||
&v1.Event{},
|
||||
&v1.EventList{},
|
||||
&v1.ConfigMap{},
|
||||
&v1.ConfigMapList{},
|
||||
)
|
||||
|
||||
// Add common types
|
||||
scheme.AddKnownTypes(SchemeGroupVersion, &metav1.Status{})
|
||||
|
||||
// Add the watch version that applies
|
||||
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
}
|
||||
35
vendor/k8s.io/kubernetes/federation/apis/core/v1/zz_generated.conversion.go
generated
vendored
Normal file
35
vendor/k8s.io/kubernetes/federation/apis/core/v1/zz_generated.conversion.go
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
||||
|
||||
package v1
|
||||
|
||||
import (
|
||||
runtime "k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedConversionFuncs()
|
||||
}
|
||||
32
vendor/k8s.io/kubernetes/federation/apis/federation/BUILD
generated
vendored
Normal file
32
vendor/k8s.io/kubernetes/federation/apis/federation/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"register.go",
|
||||
"types.generated.go",
|
||||
"types.go",
|
||||
"zz_generated.deepcopy.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apis/meta/v1:go_default_library",
|
||||
"//pkg/conversion:go_default_library",
|
||||
"//pkg/runtime:go_default_library",
|
||||
"//pkg/runtime/schema:go_default_library",
|
||||
"//pkg/types:go_default_library",
|
||||
"//vendor:github.com/ugorji/go/codec",
|
||||
],
|
||||
)
|
||||
19
vendor/k8s.io/kubernetes/federation/apis/federation/doc.go
generated
vendored
Normal file
19
vendor/k8s.io/kubernetes/federation/apis/federation/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
|
||||
package federation // import "k8s.io/kubernetes/federation/apis/federation"
|
||||
44
vendor/k8s.io/kubernetes/federation/apis/federation/install/BUILD
generated
vendored
Normal file
44
vendor/k8s.io/kubernetes/federation/apis/federation/install/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["install.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/federation:go_default_library",
|
||||
"//federation/apis/federation/v1beta1:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/api/meta:go_default_library",
|
||||
"//pkg/apimachinery:go_default_library",
|
||||
"//pkg/apimachinery/registered:go_default_library",
|
||||
"//pkg/runtime:go_default_library",
|
||||
"//pkg/runtime/schema:go_default_library",
|
||||
"//pkg/util/sets:go_default_library",
|
||||
"//vendor:github.com/golang/glog",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["install_test.go"],
|
||||
library = "go_default_library",
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/federation:go_default_library",
|
||||
"//federation/apis/federation/v1beta1:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apimachinery/registered:go_default_library",
|
||||
"//pkg/apis/meta/v1:go_default_library",
|
||||
"//pkg/runtime:go_default_library",
|
||||
],
|
||||
)
|
||||
134
vendor/k8s.io/kubernetes/federation/apis/federation/install/install.go
generated
vendored
Normal file
134
vendor/k8s.io/kubernetes/federation/apis/federation/install/install.go
generated
vendored
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
Copyright 2016 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 install
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
"k8s.io/kubernetes/federation/apis/federation"
|
||||
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/meta"
|
||||
"k8s.io/kubernetes/pkg/apimachinery"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||
"k8s.io/kubernetes/pkg/util/sets"
|
||||
)
|
||||
|
||||
const importPrefix = "k8s.io/kubernetes/federation/apis/federation"
|
||||
|
||||
var accessor = meta.NewAccessor()
|
||||
|
||||
// availableVersions lists all known external versions for this group from most preferred to least preferred
|
||||
var availableVersions = []schema.GroupVersion{v1beta1.SchemeGroupVersion}
|
||||
|
||||
func init() {
|
||||
registered.RegisterVersions(availableVersions)
|
||||
externalVersions := []schema.GroupVersion{}
|
||||
for _, v := range availableVersions {
|
||||
if registered.IsAllowedVersion(v) {
|
||||
externalVersions = append(externalVersions, v)
|
||||
}
|
||||
}
|
||||
if len(externalVersions) == 0 {
|
||||
glog.V(4).Infof("No version is registered for group %v", federation.GroupName)
|
||||
return
|
||||
}
|
||||
|
||||
if err := registered.EnableVersions(externalVersions...); err != nil {
|
||||
glog.V(4).Infof("%v", err)
|
||||
return
|
||||
}
|
||||
if err := enableVersions(externalVersions); err != nil {
|
||||
glog.V(4).Infof("%v", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: enableVersions should be centralized rather than spread in each API
|
||||
// group.
|
||||
// We can combine registered.RegisterVersions, registered.EnableVersions and
|
||||
// registered.RegisterGroup once we have moved enableVersions there.
|
||||
func enableVersions(externalVersions []schema.GroupVersion) error {
|
||||
addVersionsToScheme(externalVersions...)
|
||||
preferredExternalVersion := externalVersions[0]
|
||||
|
||||
groupMeta := apimachinery.GroupMeta{
|
||||
GroupVersion: preferredExternalVersion,
|
||||
GroupVersions: externalVersions,
|
||||
RESTMapper: newRESTMapper(externalVersions),
|
||||
SelfLinker: runtime.SelfLinker(accessor),
|
||||
InterfacesFor: interfacesFor,
|
||||
}
|
||||
|
||||
if err := registered.RegisterGroup(groupMeta); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func newRESTMapper(externalVersions []schema.GroupVersion) meta.RESTMapper {
|
||||
// the list of kinds that are scoped at the root of the api hierarchy
|
||||
// if a kind is not enumerated here, it is assumed to have a namespace scope
|
||||
rootScoped := sets.NewString(
|
||||
"Cluster",
|
||||
)
|
||||
|
||||
ignoredKinds := sets.NewString()
|
||||
|
||||
return api.NewDefaultRESTMapper(externalVersions, interfacesFor, importPrefix, ignoredKinds, rootScoped)
|
||||
}
|
||||
|
||||
// interfacesFor returns the default Codec and ResourceVersioner for a given version
|
||||
// string, or an error if the version is not known.
|
||||
func interfacesFor(version schema.GroupVersion) (*meta.VersionInterfaces, error) {
|
||||
switch version {
|
||||
case v1beta1.SchemeGroupVersion:
|
||||
return &meta.VersionInterfaces{
|
||||
ObjectConvertor: api.Scheme,
|
||||
MetadataAccessor: accessor,
|
||||
}, nil
|
||||
default:
|
||||
g, _ := registered.Group(federation.GroupName)
|
||||
return nil, fmt.Errorf("unsupported storage version: %s (valid: %v)", version, g.GroupVersions)
|
||||
}
|
||||
}
|
||||
|
||||
func addVersionsToScheme(externalVersions ...schema.GroupVersion) {
|
||||
// add the internal version to Scheme
|
||||
if err := federation.AddToScheme(api.Scheme); err != nil {
|
||||
// Programmer error, detect immediately
|
||||
panic(err)
|
||||
}
|
||||
// add the enabled external versions to Scheme
|
||||
for _, v := range externalVersions {
|
||||
if !registered.IsEnabledVersion(v) {
|
||||
glog.Errorf("Version %s is not enabled, so it will not be added to the Scheme.", v)
|
||||
continue
|
||||
}
|
||||
switch v {
|
||||
case v1beta1.SchemeGroupVersion:
|
||||
if err := v1beta1.AddToScheme(api.Scheme); err != nil {
|
||||
// Programmer error, detect immediately
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
118
vendor/k8s.io/kubernetes/federation/apis/federation/install/install_test.go
generated
vendored
Normal file
118
vendor/k8s.io/kubernetes/federation/apis/federation/install/install_test.go
generated
vendored
Normal file
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
Copyright 2016 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 install
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
|
||||
"k8s.io/kubernetes/federation/apis/federation"
|
||||
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func TestResourceVersioner(t *testing.T) {
|
||||
cluster := federation.Cluster{ObjectMeta: api.ObjectMeta{ResourceVersion: "10"}}
|
||||
version, err := accessor.ResourceVersion(&cluster)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if version != "10" {
|
||||
t.Errorf("unexpected version %v", version)
|
||||
}
|
||||
|
||||
clusterList := federation.ClusterList{ListMeta: metav1.ListMeta{ResourceVersion: "10"}}
|
||||
version, err = accessor.ResourceVersion(&clusterList)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if version != "10" {
|
||||
t.Errorf("unexpected version %v", version)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCodec(t *testing.T) {
|
||||
cluster := federation.Cluster{}
|
||||
// We do want to use package registered rather than testapi here, because we
|
||||
// want to test if the package install and package registered work as expected.
|
||||
data, err := runtime.Encode(api.Codecs.LegacyCodec(registered.GroupOrDie(federation.GroupName).GroupVersion), &cluster)
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
other := federation.Cluster{}
|
||||
if err := json.Unmarshal(data, &other); err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if other.APIVersion != registered.GroupOrDie(federation.GroupName).GroupVersion.String() || other.Kind != "Cluster" {
|
||||
t.Errorf("unexpected unmarshalled object %#v", other)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInterfacesFor(t *testing.T) {
|
||||
if _, err := registered.GroupOrDie(federation.GroupName).InterfacesFor(federation.SchemeGroupVersion); err == nil {
|
||||
t.Fatalf("unexpected non-error: %v", err)
|
||||
}
|
||||
for i, version := range registered.GroupOrDie(federation.GroupName).GroupVersions {
|
||||
if vi, err := registered.GroupOrDie(federation.GroupName).InterfacesFor(version); err != nil || vi == nil {
|
||||
t.Fatalf("%d: unexpected result: %v", i, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRESTMapper(t *testing.T) {
|
||||
gv := v1beta1.SchemeGroupVersion
|
||||
clusterGVK := gv.WithKind("Cluster")
|
||||
|
||||
if gvk, err := registered.GroupOrDie(federation.GroupName).RESTMapper.KindFor(gv.WithResource("clusters")); err != nil || gvk != clusterGVK {
|
||||
t.Errorf("unexpected version mapping: %v %v", gvk, err)
|
||||
}
|
||||
|
||||
if m, err := registered.GroupOrDie(federation.GroupName).RESTMapper.RESTMapping(clusterGVK.GroupKind(), ""); err != nil || m.GroupVersionKind != clusterGVK || m.Resource != "clusters" {
|
||||
t.Errorf("unexpected version mapping: %#v %v", m, err)
|
||||
}
|
||||
|
||||
for _, version := range registered.GroupOrDie(federation.GroupName).GroupVersions {
|
||||
mapping, err := registered.GroupOrDie(federation.GroupName).RESTMapper.RESTMapping(clusterGVK.GroupKind(), version.Version)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
if mapping.Resource != "clusters" {
|
||||
t.Errorf("incorrect resource name: %#v", mapping)
|
||||
}
|
||||
if mapping.GroupVersionKind.GroupVersion() != version {
|
||||
t.Errorf("incorrect groupVersion: %v", mapping)
|
||||
}
|
||||
|
||||
interfaces, _ := registered.GroupOrDie(federation.GroupName).InterfacesFor(version)
|
||||
if mapping.ObjectConvertor != interfaces.ObjectConvertor {
|
||||
t.Errorf("unexpected: %#v, expected: %#v", mapping, interfaces)
|
||||
}
|
||||
|
||||
rc := &federation.Cluster{ObjectMeta: api.ObjectMeta{Name: "foo"}}
|
||||
name, err := mapping.MetadataAccessor.Name(rc)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
if name != "foo" {
|
||||
t.Errorf("unable to retrieve object meta with: %v", mapping.MetadataAccessor)
|
||||
}
|
||||
}
|
||||
}
|
||||
57
vendor/k8s.io/kubernetes/federation/apis/federation/register.go
generated
vendored
Normal file
57
vendor/k8s.io/kubernetes/federation/apis/federation/register.go
generated
vendored
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
Copyright 2016 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 federation
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = "federation"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}
|
||||
|
||||
// Kind takes an unqualified kind and returns a Group qualified GroupKind
|
||||
func Kind(kind string) schema.GroupKind {
|
||||
return SchemeGroupVersion.WithKind(kind).GroupKind()
|
||||
}
|
||||
|
||||
// Resource takes an unqualified resource and returns a Group qualified GroupResource
|
||||
func Resource(resource string) schema.GroupResource {
|
||||
return SchemeGroupVersion.WithResource(resource).GroupResource()
|
||||
}
|
||||
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Cluster{},
|
||||
&ClusterList{},
|
||||
&api.ListOptions{},
|
||||
&api.DeleteOptions{},
|
||||
)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (obj *Cluster) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ClusterList) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
2954
vendor/k8s.io/kubernetes/federation/apis/federation/types.generated.go
generated
vendored
Normal file
2954
vendor/k8s.io/kubernetes/federation/apis/federation/types.generated.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
155
vendor/k8s.io/kubernetes/federation/apis/federation/types.go
generated
vendored
Normal file
155
vendor/k8s.io/kubernetes/federation/apis/federation/types.go
generated
vendored
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
Copyright 2016 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 federation
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.
|
||||
type ServerAddressByClientCIDR struct {
|
||||
// The CIDR with which clients can match their IP to figure out the server address that they should use.
|
||||
ClientCIDR string `json:"clientCIDR" protobuf:"bytes,1,opt,name=clientCIDR"`
|
||||
// Address of this server, suitable for a client that matches the above CIDR.
|
||||
// This can be a hostname, hostname:port, IP or IP:port.
|
||||
ServerAddress string `json:"serverAddress" protobuf:"bytes,2,opt,name=serverAddress"`
|
||||
}
|
||||
|
||||
// ClusterSpec describes the attributes of a kubernetes cluster.
|
||||
type ClusterSpec struct {
|
||||
// A map of client CIDR to server address.
|
||||
// This is to help clients reach servers in the most network-efficient way possible.
|
||||
// Clients can use the appropriate server address as per the CIDR that they match.
|
||||
// In case of multiple matches, clients should use the longest matching CIDR.
|
||||
ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs" patchStrategy:"merge" patchMergeKey:"clientCIDR"`
|
||||
// Name of the secret containing kubeconfig to access this cluster.
|
||||
// The secret is read from the kubernetes cluster that is hosting federation control plane.
|
||||
// Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig".
|
||||
// This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets.
|
||||
// This can be left empty if the cluster allows insecure access.
|
||||
// +optional
|
||||
SecretRef *api.LocalObjectReference `json:"secretRef,omitempty"`
|
||||
}
|
||||
|
||||
type ClusterConditionType string
|
||||
|
||||
// These are valid conditions of a cluster.
|
||||
const (
|
||||
// ClusterReady means the cluster is ready to accept workloads.
|
||||
ClusterReady ClusterConditionType = "Ready"
|
||||
// ClusterOffline means the cluster is temporarily down or not reachable
|
||||
ClusterOffline ClusterConditionType = "Offline"
|
||||
)
|
||||
|
||||
// ClusterCondition describes current state of a cluster.
|
||||
type ClusterCondition struct {
|
||||
// Type of cluster condition, Complete or Failed.
|
||||
Type ClusterConditionType `json:"type"`
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status api.ConditionStatus `json:"status"`
|
||||
// Last time the condition was checked.
|
||||
// +optional
|
||||
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty"`
|
||||
// Last time the condition transit from one status to another.
|
||||
// +optional
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
|
||||
// (brief) reason for the condition's last transition.
|
||||
// +optional
|
||||
Reason string `json:"reason,omitempty"`
|
||||
// Human readable message indicating details about last transition.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
|
||||
type ClusterStatus struct {
|
||||
// Conditions is an array of current cluster conditions.
|
||||
// +optional
|
||||
Conditions []ClusterCondition `json:"conditions,omitempty"`
|
||||
// Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// These will always be in the same region.
|
||||
// +optional
|
||||
Zones []string `json:"zones,omitempty"`
|
||||
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
|
||||
// +optional
|
||||
Region string `json:"region,omitempty"`
|
||||
}
|
||||
|
||||
// +genclient=true
|
||||
// +nonNamespaced=true
|
||||
|
||||
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
|
||||
type Cluster struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard object's metadata.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
|
||||
// +optional
|
||||
api.ObjectMeta `json:"metadata,omitempty"`
|
||||
|
||||
// Spec defines the behavior of the Cluster.
|
||||
// +optional
|
||||
Spec ClusterSpec `json:"spec,omitempty"`
|
||||
// Status describes the current status of a Cluster
|
||||
// +optional
|
||||
Status ClusterStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
// A list of all the kubernetes clusters registered to the federation
|
||||
type ClusterList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard list metadata.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
|
||||
// +optional
|
||||
metav1.ListMeta `json:"metadata,omitempty"`
|
||||
|
||||
// List of Cluster objects.
|
||||
Items []Cluster `json:"items"`
|
||||
}
|
||||
|
||||
// Temporary/alpha structures to support custom replica assignments within FederatedReplicaSet.
|
||||
|
||||
// A set of preferences that can be added to federated version of ReplicaSet as a json-serialized annotation.
|
||||
// The preferences allow the user to express in which culsters he wants to put his replicas within the
|
||||
// mentiond FederatedReplicaSet.
|
||||
type FederatedReplicaSetPreferences struct {
|
||||
// If set to true then already scheduled and running replicas may be moved to other clusters to
|
||||
// in order to bring cluster replicasets towards a desired state. Otherwise, if set to false,
|
||||
// up and running replicas will not be moved.
|
||||
// +optional
|
||||
Rebalance bool `json:"rebalance,omitempty"`
|
||||
|
||||
// A mapping between cluster names and preferences regarding local ReplicaSet in these clusters.
|
||||
// "*" (if provided) applies to all clusters if an explicit mapping is not provided. If there is no
|
||||
// "*" that clusters without explicit preferences should not have any replicas scheduled.
|
||||
// +optional
|
||||
Clusters map[string]ClusterReplicaSetPreferences `json:"clusters,omitempty"`
|
||||
}
|
||||
|
||||
// Preferences regarding number of replicas assigned to a cluster replicaset within a federated replicaset.
|
||||
type ClusterReplicaSetPreferences struct {
|
||||
// Minimum number of replicas that should be assigned to this Local ReplicaSet. 0 by default.
|
||||
// +optional
|
||||
MinReplicas int64 `json:"minReplicas,omitempty"`
|
||||
|
||||
// Maximum number of replicas that should be assigned to this Local ReplicaSet. Unbounded if no value provided (default).
|
||||
// +optional
|
||||
MaxReplicas *int64 `json:"maxReplicas,omitempty"`
|
||||
|
||||
// A number expressing the preference to put an additional replica to this LocalReplicaSet. 0 by default.
|
||||
Weight int64
|
||||
}
|
||||
41
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/BUILD
generated
vendored
Normal file
41
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"conversion.go",
|
||||
"defaults.go",
|
||||
"doc.go",
|
||||
"generated.pb.go",
|
||||
"register.go",
|
||||
"types.generated.go",
|
||||
"types.go",
|
||||
"types_swagger_doc_generated.go",
|
||||
"zz_generated.conversion.go",
|
||||
"zz_generated.deepcopy.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/federation:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/api/v1:go_default_library",
|
||||
"//pkg/apis/meta/v1:go_default_library",
|
||||
"//pkg/conversion:go_default_library",
|
||||
"//pkg/runtime:go_default_library",
|
||||
"//pkg/runtime/schema:go_default_library",
|
||||
"//pkg/types:go_default_library",
|
||||
"//pkg/watch/versioned:go_default_library",
|
||||
"//vendor:github.com/gogo/protobuf/proto",
|
||||
"//vendor:github.com/ugorji/go/codec",
|
||||
],
|
||||
)
|
||||
36
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/conversion.go
generated
vendored
Normal file
36
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/conversion.go
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
Copyright 2016 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 v1beta1
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
return scheme.AddFieldLabelConversionFunc(SchemeGroupVersion.String(), "Cluster",
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
case "metadata.name":
|
||||
return label, value, nil
|
||||
default:
|
||||
return "", "", fmt.Errorf("field label not supported: %s", label)
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
25
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/defaults.go
generated
vendored
Normal file
25
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/defaults.go
generated
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
Copyright 2016 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 v1beta1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
func addDefaultingFuncs(scheme *runtime.Scheme) error {
|
||||
return nil
|
||||
}
|
||||
21
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/doc.go
generated
vendored
Normal file
21
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// +k8s:deepcopy-gen=package,register
|
||||
// +k8s:conversion-gen=k8s.io/kubernetes/federation/apis/federation
|
||||
// +k8s:openapi-gen=true
|
||||
// +k8s:defaulter-gen=TypeMeta
|
||||
package v1beta1 // import "k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||
1541
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.pb.go
generated
vendored
Normal file
1541
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.pb.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
128
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto
generated
vendored
Normal file
128
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/generated.proto
generated
vendored
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
|
||||
// This file was autogenerated by go-to-protobuf. Do not edit it manually!
|
||||
|
||||
syntax = 'proto2';
|
||||
|
||||
package k8s.io.kubernetes.federation.apis.federation.v1beta1;
|
||||
|
||||
import "k8s.io/kubernetes/pkg/api/resource/generated.proto";
|
||||
import "k8s.io/kubernetes/pkg/api/v1/generated.proto";
|
||||
import "k8s.io/kubernetes/pkg/apis/meta/v1/generated.proto";
|
||||
import "k8s.io/kubernetes/pkg/runtime/generated.proto";
|
||||
import "k8s.io/kubernetes/pkg/runtime/schema/generated.proto";
|
||||
import "k8s.io/kubernetes/pkg/util/intstr/generated.proto";
|
||||
|
||||
// Package-wide variables from generator "generated".
|
||||
option go_package = "v1beta1";
|
||||
|
||||
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
|
||||
message Cluster {
|
||||
// Standard object's metadata.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
|
||||
// +optional
|
||||
optional k8s.io.kubernetes.pkg.api.v1.ObjectMeta metadata = 1;
|
||||
|
||||
// Spec defines the behavior of the Cluster.
|
||||
// +optional
|
||||
optional ClusterSpec spec = 2;
|
||||
|
||||
// Status describes the current status of a Cluster
|
||||
// +optional
|
||||
optional ClusterStatus status = 3;
|
||||
}
|
||||
|
||||
// ClusterCondition describes current state of a cluster.
|
||||
message ClusterCondition {
|
||||
// Type of cluster condition, Complete or Failed.
|
||||
optional string type = 1;
|
||||
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
optional string status = 2;
|
||||
|
||||
// Last time the condition was checked.
|
||||
// +optional
|
||||
optional k8s.io.kubernetes.pkg.apis.meta.v1.Time lastProbeTime = 3;
|
||||
|
||||
// Last time the condition transit from one status to another.
|
||||
// +optional
|
||||
optional k8s.io.kubernetes.pkg.apis.meta.v1.Time lastTransitionTime = 4;
|
||||
|
||||
// (brief) reason for the condition's last transition.
|
||||
// +optional
|
||||
optional string reason = 5;
|
||||
|
||||
// Human readable message indicating details about last transition.
|
||||
// +optional
|
||||
optional string message = 6;
|
||||
}
|
||||
|
||||
// A list of all the kubernetes clusters registered to the federation
|
||||
message ClusterList {
|
||||
// Standard list metadata.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
|
||||
// +optional
|
||||
optional k8s.io.kubernetes.pkg.apis.meta.v1.ListMeta metadata = 1;
|
||||
|
||||
// List of Cluster objects.
|
||||
repeated Cluster items = 2;
|
||||
}
|
||||
|
||||
// ClusterSpec describes the attributes of a kubernetes cluster.
|
||||
message ClusterSpec {
|
||||
// A map of client CIDR to server address.
|
||||
// This is to help clients reach servers in the most network-efficient way possible.
|
||||
// Clients can use the appropriate server address as per the CIDR that they match.
|
||||
// In case of multiple matches, clients should use the longest matching CIDR.
|
||||
repeated ServerAddressByClientCIDR serverAddressByClientCIDRs = 1;
|
||||
|
||||
// Name of the secret containing kubeconfig to access this cluster.
|
||||
// The secret is read from the kubernetes cluster that is hosting federation control plane.
|
||||
// Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig".
|
||||
// This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets.
|
||||
// This can be left empty if the cluster allows insecure access.
|
||||
// +optional
|
||||
optional k8s.io.kubernetes.pkg.api.v1.LocalObjectReference secretRef = 2;
|
||||
}
|
||||
|
||||
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
|
||||
message ClusterStatus {
|
||||
// Conditions is an array of current cluster conditions.
|
||||
// +optional
|
||||
repeated ClusterCondition conditions = 1;
|
||||
|
||||
// Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// These will always be in the same region.
|
||||
// +optional
|
||||
repeated string zones = 5;
|
||||
|
||||
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
|
||||
// +optional
|
||||
optional string region = 6;
|
||||
}
|
||||
|
||||
// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.
|
||||
message ServerAddressByClientCIDR {
|
||||
// The CIDR with which clients can match their IP to figure out the server address that they should use.
|
||||
optional string clientCIDR = 1;
|
||||
|
||||
// Address of this server, suitable for a client that matches the above CIDR.
|
||||
// This can be a hostname, hostname:port, IP or IP:port.
|
||||
optional string serverAddress = 2;
|
||||
}
|
||||
|
||||
51
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/register.go
generated
vendored
Normal file
51
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/register.go
generated
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
Copyright 2016 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 v1beta1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/runtime/schema"
|
||||
versionedwatch "k8s.io/kubernetes/pkg/watch/versioned"
|
||||
)
|
||||
|
||||
// GroupName is the group name use in this package
|
||||
const GroupName = "federation"
|
||||
|
||||
// SchemeGroupVersion is group version used to register these objects
|
||||
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}
|
||||
|
||||
var (
|
||||
SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes, addDefaultingFuncs, addConversionFuncs)
|
||||
AddToScheme = SchemeBuilder.AddToScheme
|
||||
)
|
||||
|
||||
func addKnownTypes(scheme *runtime.Scheme) error {
|
||||
scheme.AddKnownTypes(SchemeGroupVersion,
|
||||
&Cluster{},
|
||||
&ClusterList{},
|
||||
&v1.ListOptions{},
|
||||
&v1.DeleteOptions{},
|
||||
&metav1.ExportOptions{},
|
||||
)
|
||||
versionedwatch.AddToGroupVersion(scheme, SchemeGroupVersion)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (obj *Cluster) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
func (obj *ClusterList) GetObjectKind() schema.ObjectKind { return &obj.TypeMeta }
|
||||
2334
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.generated.go
generated
vendored
Normal file
2334
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.generated.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
122
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.go
generated
vendored
Normal file
122
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types.go
generated
vendored
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
/*
|
||||
Copyright 2016 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 v1beta1
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api/v1"
|
||||
metav1 "k8s.io/kubernetes/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
// ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.
|
||||
type ServerAddressByClientCIDR struct {
|
||||
// The CIDR with which clients can match their IP to figure out the server address that they should use.
|
||||
ClientCIDR string `json:"clientCIDR" protobuf:"bytes,1,opt,name=clientCIDR"`
|
||||
// Address of this server, suitable for a client that matches the above CIDR.
|
||||
// This can be a hostname, hostname:port, IP or IP:port.
|
||||
ServerAddress string `json:"serverAddress" protobuf:"bytes,2,opt,name=serverAddress"`
|
||||
}
|
||||
|
||||
// ClusterSpec describes the attributes of a kubernetes cluster.
|
||||
type ClusterSpec struct {
|
||||
// A map of client CIDR to server address.
|
||||
// This is to help clients reach servers in the most network-efficient way possible.
|
||||
// Clients can use the appropriate server address as per the CIDR that they match.
|
||||
// In case of multiple matches, clients should use the longest matching CIDR.
|
||||
ServerAddressByClientCIDRs []ServerAddressByClientCIDR `json:"serverAddressByClientCIDRs" patchStrategy:"merge" patchMergeKey:"clientCIDR" protobuf:"bytes,1,rep,name=serverAddressByClientCIDRs"`
|
||||
// Name of the secret containing kubeconfig to access this cluster.
|
||||
// The secret is read from the kubernetes cluster that is hosting federation control plane.
|
||||
// Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key "kubeconfig".
|
||||
// This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets.
|
||||
// This can be left empty if the cluster allows insecure access.
|
||||
// +optional
|
||||
SecretRef *v1.LocalObjectReference `json:"secretRef,omitempty" protobuf:"bytes,2,opt,name=secretRef"`
|
||||
}
|
||||
|
||||
type ClusterConditionType string
|
||||
|
||||
// These are valid conditions of a cluster.
|
||||
const (
|
||||
// ClusterReady means the cluster is ready to accept workloads.
|
||||
ClusterReady ClusterConditionType = "Ready"
|
||||
// ClusterOffline means the cluster is temporarily down or not reachable
|
||||
ClusterOffline ClusterConditionType = "Offline"
|
||||
)
|
||||
|
||||
// ClusterCondition describes current state of a cluster.
|
||||
type ClusterCondition struct {
|
||||
// Type of cluster condition, Complete or Failed.
|
||||
Type ClusterConditionType `json:"type" protobuf:"bytes,1,opt,name=type,casttype=ClusterConditionType"`
|
||||
// Status of the condition, one of True, False, Unknown.
|
||||
Status v1.ConditionStatus `json:"status" protobuf:"bytes,2,opt,name=status,casttype=k8s.io/kubernetes/pkg/api/v1.ConditionStatus"`
|
||||
// Last time the condition was checked.
|
||||
// +optional
|
||||
LastProbeTime metav1.Time `json:"lastProbeTime,omitempty" protobuf:"bytes,3,opt,name=lastProbeTime"`
|
||||
// Last time the condition transit from one status to another.
|
||||
// +optional
|
||||
LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,4,opt,name=lastTransitionTime"`
|
||||
// (brief) reason for the condition's last transition.
|
||||
// +optional
|
||||
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
|
||||
// Human readable message indicating details about last transition.
|
||||
// +optional
|
||||
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
|
||||
}
|
||||
|
||||
// ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.
|
||||
type ClusterStatus struct {
|
||||
// Conditions is an array of current cluster conditions.
|
||||
// +optional
|
||||
Conditions []ClusterCondition `json:"conditions,omitempty" protobuf:"bytes,1,rep,name=conditions"`
|
||||
// Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'.
|
||||
// These will always be in the same region.
|
||||
// +optional
|
||||
Zones []string `json:"zones,omitempty" protobuf:"bytes,5,rep,name=zones"`
|
||||
// Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.
|
||||
// +optional
|
||||
Region string `json:"region,omitempty" protobuf:"bytes,6,opt,name=region"`
|
||||
}
|
||||
|
||||
// +genclient=true
|
||||
// +nonNamespaced=true
|
||||
|
||||
// Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.
|
||||
type Cluster struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard object's metadata.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata
|
||||
// +optional
|
||||
v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
|
||||
// Spec defines the behavior of the Cluster.
|
||||
// +optional
|
||||
Spec ClusterSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
|
||||
// Status describes the current status of a Cluster
|
||||
// +optional
|
||||
Status ClusterStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
|
||||
}
|
||||
|
||||
// A list of all the kubernetes clusters registered to the federation
|
||||
type ClusterList struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard list metadata.
|
||||
// More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds
|
||||
// +optional
|
||||
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||||
|
||||
// List of Cluster objects.
|
||||
Items []Cluster `json:"items" protobuf:"bytes,2,rep,name=items"`
|
||||
}
|
||||
96
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types_swagger_doc_generated.go
generated
vendored
Normal file
96
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/types_swagger_doc_generated.go
generated
vendored
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
Copyright 2016 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 v1beta1
|
||||
|
||||
// This file contains a collection of methods that can be used from go-restful to
|
||||
// generate Swagger API documentation for its models. Please read this PR for more
|
||||
// information on the implementation: https://github.com/emicklei/go-restful/pull/215
|
||||
//
|
||||
// TODOs are ignored from the parser (e.g. TODO(andronat):... || TODO:...) if and only if
|
||||
// they are on one line! For multiple line or blocks that you want to ignore use ---.
|
||||
// Any context after a --- is ignored.
|
||||
//
|
||||
// Those methods can be generated by using hack/update-generated-swagger-docs.sh
|
||||
|
||||
// AUTO-GENERATED FUNCTIONS START HERE
|
||||
var map_Cluster = map[string]string{
|
||||
"": "Information about a registered cluster in a federated kubernetes setup. Clusters are not namespaced and have unique names in the federation.",
|
||||
"metadata": "Standard object's metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata",
|
||||
"spec": "Spec defines the behavior of the Cluster.",
|
||||
"status": "Status describes the current status of a Cluster",
|
||||
}
|
||||
|
||||
func (Cluster) SwaggerDoc() map[string]string {
|
||||
return map_Cluster
|
||||
}
|
||||
|
||||
var map_ClusterCondition = map[string]string{
|
||||
"": "ClusterCondition describes current state of a cluster.",
|
||||
"type": "Type of cluster condition, Complete or Failed.",
|
||||
"status": "Status of the condition, one of True, False, Unknown.",
|
||||
"lastProbeTime": "Last time the condition was checked.",
|
||||
"lastTransitionTime": "Last time the condition transit from one status to another.",
|
||||
"reason": "(brief) reason for the condition's last transition.",
|
||||
"message": "Human readable message indicating details about last transition.",
|
||||
}
|
||||
|
||||
func (ClusterCondition) SwaggerDoc() map[string]string {
|
||||
return map_ClusterCondition
|
||||
}
|
||||
|
||||
var map_ClusterList = map[string]string{
|
||||
"": "A list of all the kubernetes clusters registered to the federation",
|
||||
"metadata": "Standard list metadata. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds",
|
||||
"items": "List of Cluster objects.",
|
||||
}
|
||||
|
||||
func (ClusterList) SwaggerDoc() map[string]string {
|
||||
return map_ClusterList
|
||||
}
|
||||
|
||||
var map_ClusterSpec = map[string]string{
|
||||
"": "ClusterSpec describes the attributes of a kubernetes cluster.",
|
||||
"serverAddressByClientCIDRs": "A map of client CIDR to server address. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR.",
|
||||
"secretRef": "Name of the secret containing kubeconfig to access this cluster. The secret is read from the kubernetes cluster that is hosting federation control plane. Admin needs to ensure that the required secret exists. Secret should be in the same namespace where federation control plane is hosted and it should have kubeconfig in its data with key \"kubeconfig\". This will later be changed to a reference to secret in federation control plane when the federation control plane supports secrets. This can be left empty if the cluster allows insecure access.",
|
||||
}
|
||||
|
||||
func (ClusterSpec) SwaggerDoc() map[string]string {
|
||||
return map_ClusterSpec
|
||||
}
|
||||
|
||||
var map_ClusterStatus = map[string]string{
|
||||
"": "ClusterStatus is information about the current status of a cluster updated by cluster controller peridocally.",
|
||||
"conditions": "Conditions is an array of current cluster conditions.",
|
||||
"zones": "Zones is the list of availability zones in which the nodes of the cluster exist, e.g. 'us-east1-a'. These will always be in the same region.",
|
||||
"region": "Region is the name of the region in which all of the nodes in the cluster exist. e.g. 'us-east1'.",
|
||||
}
|
||||
|
||||
func (ClusterStatus) SwaggerDoc() map[string]string {
|
||||
return map_ClusterStatus
|
||||
}
|
||||
|
||||
var map_ServerAddressByClientCIDR = map[string]string{
|
||||
"": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
|
||||
"clientCIDR": "The CIDR with which clients can match their IP to figure out the server address that they should use.",
|
||||
"serverAddress": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port.",
|
||||
}
|
||||
|
||||
func (ServerAddressByClientCIDR) SwaggerDoc() map[string]string {
|
||||
return map_ServerAddressByClientCIDR
|
||||
}
|
||||
|
||||
// AUTO-GENERATED FUNCTIONS END HERE
|
||||
199
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/zz_generated.conversion.go
generated
vendored
Normal file
199
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/zz_generated.conversion.go
generated
vendored
Normal file
|
|
@ -0,0 +1,199 @@
|
|||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This file was autogenerated by conversion-gen. Do not edit it manually!
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
federation "k8s.io/kubernetes/federation/apis/federation"
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
runtime "k8s.io/kubernetes/pkg/runtime"
|
||||
unsafe "unsafe"
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(RegisterConversions)
|
||||
}
|
||||
|
||||
// RegisterConversions adds conversion functions to the given scheme.
|
||||
// Public to allow building arbitrary schemes.
|
||||
func RegisterConversions(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedConversionFuncs(
|
||||
Convert_v1beta1_Cluster_To_federation_Cluster,
|
||||
Convert_federation_Cluster_To_v1beta1_Cluster,
|
||||
Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition,
|
||||
Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition,
|
||||
Convert_v1beta1_ClusterList_To_federation_ClusterList,
|
||||
Convert_federation_ClusterList_To_v1beta1_ClusterList,
|
||||
Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec,
|
||||
Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec,
|
||||
Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus,
|
||||
Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus,
|
||||
Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR,
|
||||
Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR,
|
||||
)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error {
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_Cluster_To_federation_Cluster(in *Cluster, out *federation.Cluster, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_Cluster_To_federation_Cluster(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error {
|
||||
// TODO: Inefficient conversion - can we improve it?
|
||||
if err := s.Convert(&in.ObjectMeta, &out.ObjectMeta, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(&in.Spec, &out.Spec, s); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(&in.Status, &out.Status, s); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_federation_Cluster_To_v1beta1_Cluster(in *federation.Cluster, out *Cluster, s conversion.Scope) error {
|
||||
return autoConvert_federation_Cluster_To_v1beta1_Cluster(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error {
|
||||
out.Type = federation.ClusterConditionType(in.Type)
|
||||
out.Status = api.ConditionStatus(in.Status)
|
||||
out.LastProbeTime = in.LastProbeTime
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in *ClusterCondition, out *federation.ClusterCondition, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_ClusterCondition_To_federation_ClusterCondition(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error {
|
||||
out.Type = ClusterConditionType(in.Type)
|
||||
out.Status = v1.ConditionStatus(in.Status)
|
||||
out.LastProbeTime = in.LastProbeTime
|
||||
out.LastTransitionTime = in.LastTransitionTime
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in *federation.ClusterCondition, out *ClusterCondition, s conversion.Scope) error {
|
||||
return autoConvert_federation_ClusterCondition_To_v1beta1_ClusterCondition(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]federation.Cluster)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_ClusterList_To_federation_ClusterList(in *ClusterList, out *federation.ClusterList, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_ClusterList_To_federation_ClusterList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error {
|
||||
out.ListMeta = in.ListMeta
|
||||
out.Items = *(*[]Cluster)(unsafe.Pointer(&in.Items))
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_federation_ClusterList_To_v1beta1_ClusterList(in *federation.ClusterList, out *ClusterList, s conversion.Scope) error {
|
||||
return autoConvert_federation_ClusterList_To_v1beta1_ClusterList(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error {
|
||||
out.ServerAddressByClientCIDRs = *(*[]federation.ServerAddressByClientCIDR)(unsafe.Pointer(&in.ServerAddressByClientCIDRs))
|
||||
out.SecretRef = (*api.LocalObjectReference)(unsafe.Pointer(in.SecretRef))
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in *ClusterSpec, out *federation.ClusterSpec, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_ClusterSpec_To_federation_ClusterSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error {
|
||||
out.ServerAddressByClientCIDRs = *(*[]ServerAddressByClientCIDR)(unsafe.Pointer(&in.ServerAddressByClientCIDRs))
|
||||
out.SecretRef = (*v1.LocalObjectReference)(unsafe.Pointer(in.SecretRef))
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in *federation.ClusterSpec, out *ClusterSpec, s conversion.Scope) error {
|
||||
return autoConvert_federation_ClusterSpec_To_v1beta1_ClusterSpec(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error {
|
||||
out.Conditions = *(*[]federation.ClusterCondition)(unsafe.Pointer(&in.Conditions))
|
||||
out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones))
|
||||
out.Region = in.Region
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in *ClusterStatus, out *federation.ClusterStatus, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_ClusterStatus_To_federation_ClusterStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error {
|
||||
out.Conditions = *(*[]ClusterCondition)(unsafe.Pointer(&in.Conditions))
|
||||
out.Zones = *(*[]string)(unsafe.Pointer(&in.Zones))
|
||||
out.Region = in.Region
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in *federation.ClusterStatus, out *ClusterStatus, s conversion.Scope) error {
|
||||
return autoConvert_federation_ClusterStatus_To_v1beta1_ClusterStatus(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error {
|
||||
out.ClientCIDR = in.ClientCIDR
|
||||
out.ServerAddress = in.ServerAddress
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in *ServerAddressByClientCIDR, out *federation.ServerAddressByClientCIDR, s conversion.Scope) error {
|
||||
return autoConvert_v1beta1_ServerAddressByClientCIDR_To_federation_ServerAddressByClientCIDR(in, out, s)
|
||||
}
|
||||
|
||||
func autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error {
|
||||
out.ClientCIDR = in.ClientCIDR
|
||||
out.ServerAddress = in.ServerAddress
|
||||
return nil
|
||||
}
|
||||
|
||||
func Convert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in *federation.ServerAddressByClientCIDR, out *ServerAddressByClientCIDR, s conversion.Scope) error {
|
||||
return autoConvert_federation_ServerAddressByClientCIDR_To_v1beta1_ServerAddressByClientCIDR(in, out, s)
|
||||
}
|
||||
159
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/zz_generated.deepcopy.go
generated
vendored
Normal file
159
vendor/k8s.io/kubernetes/federation/apis/federation/v1beta1/zz_generated.deepcopy.go
generated
vendored
Normal file
|
|
@ -0,0 +1,159 @@
|
|||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||
|
||||
package v1beta1
|
||||
|
||||
import (
|
||||
v1 "k8s.io/kubernetes/pkg/api/v1"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
runtime "k8s.io/kubernetes/pkg/runtime"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(RegisterDeepCopies)
|
||||
}
|
||||
|
||||
// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
|
||||
// to allow building arbitrary schemes.
|
||||
func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedDeepCopyFuncs(
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_Cluster, InType: reflect.TypeOf(&Cluster{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterCondition, InType: reflect.TypeOf(&ClusterCondition{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterList, InType: reflect.TypeOf(&ClusterList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterSpec, InType: reflect.TypeOf(&ClusterSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ClusterStatus, InType: reflect.TypeOf(&ClusterStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_v1beta1_ServerAddressByClientCIDR, InType: reflect.TypeOf(&ServerAddressByClientCIDR{})},
|
||||
)
|
||||
}
|
||||
|
||||
func DeepCopy_v1beta1_Cluster(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Cluster)
|
||||
out := out.(*Cluster)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if err := v1.DeepCopy_v1_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_v1beta1_ClusterSpec(&in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_v1beta1_ClusterStatus(&in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1beta1_ClusterCondition(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ClusterCondition)
|
||||
out := out.(*ClusterCondition)
|
||||
out.Type = in.Type
|
||||
out.Status = in.Status
|
||||
out.LastProbeTime = in.LastProbeTime.DeepCopy()
|
||||
out.LastTransitionTime = in.LastTransitionTime.DeepCopy()
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1beta1_ClusterList(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ClusterList)
|
||||
out := out.(*ClusterList)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Cluster, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_v1beta1_Cluster(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1beta1_ClusterSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ClusterSpec)
|
||||
out := out.(*ClusterSpec)
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
}
|
||||
if in.SecretRef != nil {
|
||||
in, out := &in.SecretRef, &out.SecretRef
|
||||
*out = new(v1.LocalObjectReference)
|
||||
**out = **in
|
||||
} else {
|
||||
out.SecretRef = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1beta1_ClusterStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ClusterStatus)
|
||||
out := out.(*ClusterStatus)
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]ClusterCondition, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_v1beta1_ClusterCondition(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Conditions = nil
|
||||
}
|
||||
if in.Zones != nil {
|
||||
in, out := &in.Zones, &out.Zones
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Zones = nil
|
||||
}
|
||||
out.Region = in.Region
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_v1beta1_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ServerAddressByClientCIDR)
|
||||
out := out.(*ServerAddressByClientCIDR)
|
||||
out.ClientCIDR = in.ClientCIDR
|
||||
out.ServerAddress = in.ServerAddress
|
||||
return nil
|
||||
}
|
||||
}
|
||||
33
vendor/k8s.io/kubernetes/federation/apis/federation/validation/BUILD
generated
vendored
Normal file
33
vendor/k8s.io/kubernetes/federation/apis/federation/validation/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["validation.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/federation:go_default_library",
|
||||
"//pkg/api/validation:go_default_library",
|
||||
"//pkg/util/validation/field:go_default_library",
|
||||
],
|
||||
)
|
||||
|
||||
go_test(
|
||||
name = "go_default_test",
|
||||
srcs = ["validation_test.go"],
|
||||
library = "go_default_library",
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/federation:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
],
|
||||
)
|
||||
52
vendor/k8s.io/kubernetes/federation/apis/federation/validation/validation.go
generated
vendored
Normal file
52
vendor/k8s.io/kubernetes/federation/apis/federation/validation/validation.go
generated
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
Copyright 2016 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 validation
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/federation/apis/federation"
|
||||
"k8s.io/kubernetes/pkg/api/validation"
|
||||
"k8s.io/kubernetes/pkg/util/validation/field"
|
||||
)
|
||||
|
||||
func ValidateClusterSpec(spec *federation.ClusterSpec, fieldPath *field.Path) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
// address is required.
|
||||
if len(spec.ServerAddressByClientCIDRs) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fieldPath.Child("serverAddressByClientCIDRs"), ""))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateCluster(cluster *federation.Cluster) field.ErrorList {
|
||||
allErrs := validation.ValidateObjectMeta(&cluster.ObjectMeta, false, validation.ValidateClusterName, field.NewPath("metadata"))
|
||||
allErrs = append(allErrs, ValidateClusterSpec(&cluster.Spec, field.NewPath("spec"))...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateClusterUpdate(cluster, oldCluster *federation.Cluster) field.ErrorList {
|
||||
allErrs := validation.ValidateObjectMetaUpdate(&cluster.ObjectMeta, &oldCluster.ObjectMeta, field.NewPath("metadata"))
|
||||
if cluster.Name != oldCluster.Name {
|
||||
allErrs = append(allErrs, field.Invalid(field.NewPath("meta", "name"),
|
||||
cluster.Name+" != "+oldCluster.Name, "cannot change cluster name"))
|
||||
}
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func ValidateClusterStatusUpdate(cluster, oldCluster *federation.Cluster) field.ErrorList {
|
||||
allErrs := validation.ValidateObjectMetaUpdate(&cluster.ObjectMeta, &oldCluster.ObjectMeta, field.NewPath("metadata"))
|
||||
return allErrs
|
||||
}
|
||||
216
vendor/k8s.io/kubernetes/federation/apis/federation/validation/validation_test.go
generated
vendored
Normal file
216
vendor/k8s.io/kubernetes/federation/apis/federation/validation/validation_test.go
generated
vendored
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
/*
|
||||
Copyright 2016 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 validation
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"k8s.io/kubernetes/federation/apis/federation"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
)
|
||||
|
||||
func TestValidateCluster(t *testing.T) {
|
||||
successCases := []federation.Cluster{
|
||||
{
|
||||
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
|
||||
Spec: federation.ClusterSpec{
|
||||
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
|
||||
{
|
||||
ClientCIDR: "0.0.0.0/0",
|
||||
ServerAddress: "localhost:8888",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, successCase := range successCases {
|
||||
errs := ValidateCluster(&successCase)
|
||||
if len(errs) != 0 {
|
||||
t.Errorf("expect success: %v", errs)
|
||||
}
|
||||
}
|
||||
|
||||
errorCases := map[string]federation.Cluster{
|
||||
"missing cluster addresses": {
|
||||
ObjectMeta: api.ObjectMeta{Name: "cluster-f"},
|
||||
},
|
||||
"empty cluster addresses": {
|
||||
ObjectMeta: api.ObjectMeta{Name: "cluster-f"},
|
||||
Spec: federation.ClusterSpec{
|
||||
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{},
|
||||
}},
|
||||
"invalid_label": {
|
||||
ObjectMeta: api.ObjectMeta{
|
||||
Name: "cluster-f",
|
||||
Labels: map[string]string{
|
||||
"NoUppercaseOrSpecialCharsLike=Equals": "bar",
|
||||
},
|
||||
},
|
||||
},
|
||||
"invalid cluster name (is a subdomain)": {
|
||||
ObjectMeta: api.ObjectMeta{Name: "mycluster.mycompany"},
|
||||
Spec: federation.ClusterSpec{
|
||||
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
|
||||
{
|
||||
ClientCIDR: "0.0.0.0/0",
|
||||
ServerAddress: "localhost:8888",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for testName, errorCase := range errorCases {
|
||||
errs := ValidateCluster(&errorCase)
|
||||
if len(errs) == 0 {
|
||||
t.Errorf("expected failur for %s", testName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateClusterUpdate(t *testing.T) {
|
||||
type clusterUpdateTest struct {
|
||||
old federation.Cluster
|
||||
update federation.Cluster
|
||||
}
|
||||
successCases := []clusterUpdateTest{
|
||||
{
|
||||
old: federation.Cluster{
|
||||
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
|
||||
Spec: federation.ClusterSpec{
|
||||
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
|
||||
{
|
||||
ClientCIDR: "0.0.0.0/0",
|
||||
ServerAddress: "localhost:8888",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
update: federation.Cluster{
|
||||
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
|
||||
Spec: federation.ClusterSpec{
|
||||
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
|
||||
{
|
||||
ClientCIDR: "0.0.0.0/0",
|
||||
ServerAddress: "localhost:8888",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, successCase := range successCases {
|
||||
successCase.old.ObjectMeta.ResourceVersion = "1"
|
||||
successCase.update.ObjectMeta.ResourceVersion = "1"
|
||||
errs := ValidateClusterUpdate(&successCase.update, &successCase.old)
|
||||
if len(errs) != 0 {
|
||||
t.Errorf("expect success: %v", errs)
|
||||
}
|
||||
}
|
||||
|
||||
errorCases := map[string]clusterUpdateTest{
|
||||
"cluster name changed": {
|
||||
old: federation.Cluster{
|
||||
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
|
||||
Spec: federation.ClusterSpec{
|
||||
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
|
||||
{
|
||||
ClientCIDR: "0.0.0.0/0",
|
||||
ServerAddress: "localhost:8888",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
update: federation.Cluster{
|
||||
ObjectMeta: api.ObjectMeta{Name: "cluster-newname"},
|
||||
Spec: federation.ClusterSpec{
|
||||
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
|
||||
{
|
||||
ClientCIDR: "0.0.0.0/0",
|
||||
ServerAddress: "localhost:8888",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for testName, errorCase := range errorCases {
|
||||
errs := ValidateClusterUpdate(&errorCase.update, &errorCase.old)
|
||||
if len(errs) == 0 {
|
||||
t.Errorf("expected failure: %s", testName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestValidateClusterStatusUpdate(t *testing.T) {
|
||||
type clusterUpdateTest struct {
|
||||
old federation.Cluster
|
||||
update federation.Cluster
|
||||
}
|
||||
successCases := []clusterUpdateTest{
|
||||
{
|
||||
old: federation.Cluster{
|
||||
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
|
||||
Spec: federation.ClusterSpec{
|
||||
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
|
||||
{
|
||||
ClientCIDR: "0.0.0.0/0",
|
||||
ServerAddress: "localhost:8888",
|
||||
},
|
||||
},
|
||||
},
|
||||
Status: federation.ClusterStatus{
|
||||
Conditions: []federation.ClusterCondition{
|
||||
{Type: federation.ClusterReady, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
update: federation.Cluster{
|
||||
ObjectMeta: api.ObjectMeta{Name: "cluster-s"},
|
||||
Spec: federation.ClusterSpec{
|
||||
ServerAddressByClientCIDRs: []federation.ServerAddressByClientCIDR{
|
||||
{
|
||||
ClientCIDR: "0.0.0.0/0",
|
||||
ServerAddress: "localhost:8888",
|
||||
},
|
||||
},
|
||||
},
|
||||
Status: federation.ClusterStatus{
|
||||
Conditions: []federation.ClusterCondition{
|
||||
{Type: federation.ClusterReady, Status: api.ConditionTrue},
|
||||
{Type: federation.ClusterOffline, Status: api.ConditionTrue},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
for _, successCase := range successCases {
|
||||
successCase.old.ObjectMeta.ResourceVersion = "1"
|
||||
successCase.update.ObjectMeta.ResourceVersion = "1"
|
||||
errs := ValidateClusterUpdate(&successCase.update, &successCase.old)
|
||||
if len(errs) != 0 {
|
||||
t.Errorf("expect success: %v", errs)
|
||||
}
|
||||
}
|
||||
|
||||
errorCases := map[string]clusterUpdateTest{}
|
||||
for testName, errorCase := range errorCases {
|
||||
errs := ValidateClusterStatusUpdate(&errorCase.update, &errorCase.old)
|
||||
if len(errs) == 0 {
|
||||
t.Errorf("expected failure: %s", testName)
|
||||
}
|
||||
}
|
||||
}
|
||||
200
vendor/k8s.io/kubernetes/federation/apis/federation/zz_generated.deepcopy.go
generated
vendored
Normal file
200
vendor/k8s.io/kubernetes/federation/apis/federation/zz_generated.deepcopy.go
generated
vendored
Normal file
|
|
@ -0,0 +1,200 @@
|
|||
// +build !ignore_autogenerated
|
||||
|
||||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
||||
|
||||
package federation
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
conversion "k8s.io/kubernetes/pkg/conversion"
|
||||
runtime "k8s.io/kubernetes/pkg/runtime"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
func init() {
|
||||
SchemeBuilder.Register(RegisterDeepCopies)
|
||||
}
|
||||
|
||||
// RegisterDeepCopies adds deep-copy functions to the given scheme. Public
|
||||
// to allow building arbitrary schemes.
|
||||
func RegisterDeepCopies(scheme *runtime.Scheme) error {
|
||||
return scheme.AddGeneratedDeepCopyFuncs(
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_Cluster, InType: reflect.TypeOf(&Cluster{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterCondition, InType: reflect.TypeOf(&ClusterCondition{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterList, InType: reflect.TypeOf(&ClusterList{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterReplicaSetPreferences, InType: reflect.TypeOf(&ClusterReplicaSetPreferences{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterSpec, InType: reflect.TypeOf(&ClusterSpec{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ClusterStatus, InType: reflect.TypeOf(&ClusterStatus{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_FederatedReplicaSetPreferences, InType: reflect.TypeOf(&FederatedReplicaSetPreferences{})},
|
||||
conversion.GeneratedDeepCopyFunc{Fn: DeepCopy_federation_ServerAddressByClientCIDR, InType: reflect.TypeOf(&ServerAddressByClientCIDR{})},
|
||||
)
|
||||
}
|
||||
|
||||
func DeepCopy_federation_Cluster(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*Cluster)
|
||||
out := out.(*Cluster)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
if err := api.DeepCopy_api_ObjectMeta(&in.ObjectMeta, &out.ObjectMeta, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_federation_ClusterSpec(&in.Spec, &out.Spec, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := DeepCopy_federation_ClusterStatus(&in.Status, &out.Status, c); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_federation_ClusterCondition(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ClusterCondition)
|
||||
out := out.(*ClusterCondition)
|
||||
out.Type = in.Type
|
||||
out.Status = in.Status
|
||||
out.LastProbeTime = in.LastProbeTime.DeepCopy()
|
||||
out.LastTransitionTime = in.LastTransitionTime.DeepCopy()
|
||||
out.Reason = in.Reason
|
||||
out.Message = in.Message
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_federation_ClusterList(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ClusterList)
|
||||
out := out.(*ClusterList)
|
||||
out.TypeMeta = in.TypeMeta
|
||||
out.ListMeta = in.ListMeta
|
||||
if in.Items != nil {
|
||||
in, out := &in.Items, &out.Items
|
||||
*out = make([]Cluster, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_federation_Cluster(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Items = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_federation_ClusterReplicaSetPreferences(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ClusterReplicaSetPreferences)
|
||||
out := out.(*ClusterReplicaSetPreferences)
|
||||
out.MinReplicas = in.MinReplicas
|
||||
if in.MaxReplicas != nil {
|
||||
in, out := &in.MaxReplicas, &out.MaxReplicas
|
||||
*out = new(int64)
|
||||
**out = **in
|
||||
} else {
|
||||
out.MaxReplicas = nil
|
||||
}
|
||||
out.Weight = in.Weight
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_federation_ClusterSpec(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ClusterSpec)
|
||||
out := out.(*ClusterSpec)
|
||||
if in.ServerAddressByClientCIDRs != nil {
|
||||
in, out := &in.ServerAddressByClientCIDRs, &out.ServerAddressByClientCIDRs
|
||||
*out = make([]ServerAddressByClientCIDR, len(*in))
|
||||
for i := range *in {
|
||||
(*out)[i] = (*in)[i]
|
||||
}
|
||||
} else {
|
||||
out.ServerAddressByClientCIDRs = nil
|
||||
}
|
||||
if in.SecretRef != nil {
|
||||
in, out := &in.SecretRef, &out.SecretRef
|
||||
*out = new(api.LocalObjectReference)
|
||||
**out = **in
|
||||
} else {
|
||||
out.SecretRef = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_federation_ClusterStatus(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ClusterStatus)
|
||||
out := out.(*ClusterStatus)
|
||||
if in.Conditions != nil {
|
||||
in, out := &in.Conditions, &out.Conditions
|
||||
*out = make([]ClusterCondition, len(*in))
|
||||
for i := range *in {
|
||||
if err := DeepCopy_federation_ClusterCondition(&(*in)[i], &(*out)[i], c); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
out.Conditions = nil
|
||||
}
|
||||
if in.Zones != nil {
|
||||
in, out := &in.Zones, &out.Zones
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
} else {
|
||||
out.Zones = nil
|
||||
}
|
||||
out.Region = in.Region
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_federation_FederatedReplicaSetPreferences(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*FederatedReplicaSetPreferences)
|
||||
out := out.(*FederatedReplicaSetPreferences)
|
||||
out.Rebalance = in.Rebalance
|
||||
if in.Clusters != nil {
|
||||
in, out := &in.Clusters, &out.Clusters
|
||||
*out = make(map[string]ClusterReplicaSetPreferences)
|
||||
for key, val := range *in {
|
||||
newVal := new(ClusterReplicaSetPreferences)
|
||||
if err := DeepCopy_federation_ClusterReplicaSetPreferences(&val, newVal, c); err != nil {
|
||||
return err
|
||||
}
|
||||
(*out)[key] = *newVal
|
||||
}
|
||||
} else {
|
||||
out.Clusters = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func DeepCopy_federation_ServerAddressByClientCIDR(in interface{}, out interface{}, c *conversion.Cloner) error {
|
||||
{
|
||||
in := in.(*ServerAddressByClientCIDR)
|
||||
out := out.(*ServerAddressByClientCIDR)
|
||||
out.ClientCIDR = in.ClientCIDR
|
||||
out.ServerAddress = in.ServerAddress
|
||||
return nil
|
||||
}
|
||||
}
|
||||
10754
vendor/k8s.io/kubernetes/federation/apis/openapi-spec/swagger.json
generated
vendored
Normal file
10754
vendor/k8s.io/kubernetes/federation/apis/openapi-spec/swagger.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
87
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/api.json
generated
vendored
Normal file
87
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/api.json
generated
vendored
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "https://10.10.10.10:6443",
|
||||
"resourcePath": "/api",
|
||||
"info": {
|
||||
"title": "",
|
||||
"description": ""
|
||||
},
|
||||
"apis": [
|
||||
{
|
||||
"path": "/api",
|
||||
"description": "get available API versions",
|
||||
"operations": [
|
||||
{
|
||||
"type": "v1.APIVersions",
|
||||
"method": "GET",
|
||||
"summary": "get available API versions",
|
||||
"nickname": "getAPIVersions",
|
||||
"parameters": [],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"models": {
|
||||
"v1.APIVersions": {
|
||||
"id": "v1.APIVersions",
|
||||
"description": "APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.",
|
||||
"required": [
|
||||
"versions",
|
||||
"serverAddressByClientCIDRs"
|
||||
],
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
|
||||
},
|
||||
"versions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": "versions are the api versions that are available."
|
||||
},
|
||||
"serverAddressByClientCIDRs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.ServerAddressByClientCIDR"
|
||||
},
|
||||
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.ServerAddressByClientCIDR": {
|
||||
"id": "v1.ServerAddressByClientCIDR",
|
||||
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
|
||||
"required": [
|
||||
"clientCIDR",
|
||||
"serverAddress"
|
||||
],
|
||||
"properties": {
|
||||
"clientCIDR": {
|
||||
"type": "string",
|
||||
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use."
|
||||
},
|
||||
"serverAddress": {
|
||||
"type": "string",
|
||||
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
138
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/apis.json
generated
vendored
Normal file
138
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/apis.json
generated
vendored
Normal file
|
|
@ -0,0 +1,138 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "https://10.10.10.10:6443",
|
||||
"resourcePath": "/apis",
|
||||
"info": {
|
||||
"title": "",
|
||||
"description": ""
|
||||
},
|
||||
"apis": [
|
||||
{
|
||||
"path": "/apis",
|
||||
"description": "get available API versions",
|
||||
"operations": [
|
||||
{
|
||||
"type": "v1.APIGroupList",
|
||||
"method": "GET",
|
||||
"summary": "get available API versions",
|
||||
"nickname": "getAPIVersions",
|
||||
"parameters": [],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"models": {
|
||||
"v1.APIGroupList": {
|
||||
"id": "v1.APIGroupList",
|
||||
"description": "APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.",
|
||||
"required": [
|
||||
"groups"
|
||||
],
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
|
||||
},
|
||||
"groups": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.APIGroup"
|
||||
},
|
||||
"description": "groups is a list of APIGroup."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.APIGroup": {
|
||||
"id": "v1.APIGroup",
|
||||
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
|
||||
"required": [
|
||||
"name",
|
||||
"versions",
|
||||
"serverAddressByClientCIDRs"
|
||||
],
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "name is the name of the group."
|
||||
},
|
||||
"versions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.GroupVersionForDiscovery"
|
||||
},
|
||||
"description": "versions are the versions supported in this group."
|
||||
},
|
||||
"preferredVersion": {
|
||||
"$ref": "v1.GroupVersionForDiscovery",
|
||||
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version."
|
||||
},
|
||||
"serverAddressByClientCIDRs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.ServerAddressByClientCIDR"
|
||||
},
|
||||
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.GroupVersionForDiscovery": {
|
||||
"id": "v1.GroupVersionForDiscovery",
|
||||
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
|
||||
"required": [
|
||||
"groupVersion",
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"groupVersion": {
|
||||
"type": "string",
|
||||
"description": "groupVersion specifies the API group and version in the form \"group/version\""
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.ServerAddressByClientCIDR": {
|
||||
"id": "v1.ServerAddressByClientCIDR",
|
||||
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
|
||||
"required": [
|
||||
"clientCIDR",
|
||||
"serverAddress"
|
||||
],
|
||||
"properties": {
|
||||
"clientCIDR": {
|
||||
"type": "string",
|
||||
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use."
|
||||
},
|
||||
"serverAddress": {
|
||||
"type": "string",
|
||||
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
114
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/extensions.json
generated
vendored
Normal file
114
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/extensions.json
generated
vendored
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "https://10.10.10.10:6443",
|
||||
"resourcePath": "/apis/extensions",
|
||||
"info": {
|
||||
"title": "",
|
||||
"description": ""
|
||||
},
|
||||
"apis": [
|
||||
{
|
||||
"path": "/apis/extensions",
|
||||
"description": "get information of a group",
|
||||
"operations": [
|
||||
{
|
||||
"type": "v1.APIGroup",
|
||||
"method": "GET",
|
||||
"summary": "get information of a group",
|
||||
"nickname": "getAPIGroup",
|
||||
"parameters": [],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"models": {
|
||||
"v1.APIGroup": {
|
||||
"id": "v1.APIGroup",
|
||||
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
|
||||
"required": [
|
||||
"name",
|
||||
"versions",
|
||||
"serverAddressByClientCIDRs"
|
||||
],
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "name is the name of the group."
|
||||
},
|
||||
"versions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.GroupVersionForDiscovery"
|
||||
},
|
||||
"description": "versions are the versions supported in this group."
|
||||
},
|
||||
"preferredVersion": {
|
||||
"$ref": "v1.GroupVersionForDiscovery",
|
||||
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version."
|
||||
},
|
||||
"serverAddressByClientCIDRs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.ServerAddressByClientCIDR"
|
||||
},
|
||||
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.GroupVersionForDiscovery": {
|
||||
"id": "v1.GroupVersionForDiscovery",
|
||||
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
|
||||
"required": [
|
||||
"groupVersion",
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"groupVersion": {
|
||||
"type": "string",
|
||||
"description": "groupVersion specifies the API group and version in the form \"group/version\""
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.ServerAddressByClientCIDR": {
|
||||
"id": "v1.ServerAddressByClientCIDR",
|
||||
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
|
||||
"required": [
|
||||
"clientCIDR",
|
||||
"serverAddress"
|
||||
],
|
||||
"properties": {
|
||||
"clientCIDR": {
|
||||
"type": "string",
|
||||
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use."
|
||||
},
|
||||
"serverAddress": {
|
||||
"type": "string",
|
||||
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6777
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/extensions_v1beta1.json
generated
vendored
Normal file
6777
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/extensions_v1beta1.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
114
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/federation.json
generated
vendored
Normal file
114
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/federation.json
generated
vendored
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "https://10.10.10.10:6443",
|
||||
"resourcePath": "/apis/federation",
|
||||
"info": {
|
||||
"title": "",
|
||||
"description": ""
|
||||
},
|
||||
"apis": [
|
||||
{
|
||||
"path": "/apis/federation",
|
||||
"description": "get information of a group",
|
||||
"operations": [
|
||||
{
|
||||
"type": "v1.APIGroup",
|
||||
"method": "GET",
|
||||
"summary": "get information of a group",
|
||||
"nickname": "getAPIGroup",
|
||||
"parameters": [],
|
||||
"produces": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json",
|
||||
"application/yaml",
|
||||
"application/vnd.kubernetes.protobuf"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"models": {
|
||||
"v1.APIGroup": {
|
||||
"id": "v1.APIGroup",
|
||||
"description": "APIGroup contains the name, the supported versions, and the preferred version of a group.",
|
||||
"required": [
|
||||
"name",
|
||||
"versions",
|
||||
"serverAddressByClientCIDRs"
|
||||
],
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#types-kinds"
|
||||
},
|
||||
"apiVersion": {
|
||||
"type": "string",
|
||||
"description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#resources"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "name is the name of the group."
|
||||
},
|
||||
"versions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.GroupVersionForDiscovery"
|
||||
},
|
||||
"description": "versions are the versions supported in this group."
|
||||
},
|
||||
"preferredVersion": {
|
||||
"$ref": "v1.GroupVersionForDiscovery",
|
||||
"description": "preferredVersion is the version preferred by the API server, which probably is the storage version."
|
||||
},
|
||||
"serverAddressByClientCIDRs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "v1.ServerAddressByClientCIDR"
|
||||
},
|
||||
"description": "a map of client CIDR to server address that is serving this group. This is to help clients reach servers in the most network-efficient way possible. Clients can use the appropriate server address as per the CIDR that they match. In case of multiple matches, clients should use the longest matching CIDR. The server returns only those CIDRs that it thinks that the client can match. For example: the master will return an internal IP CIDR only, if the client reaches the server using an internal IP. Server looks at X-Forwarded-For header or X-Real-Ip header or request.RemoteAddr (in that order) to get the client IP."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.GroupVersionForDiscovery": {
|
||||
"id": "v1.GroupVersionForDiscovery",
|
||||
"description": "GroupVersion contains the \"group/version\" and \"version\" string of a version. It is made a struct to keep extensibility.",
|
||||
"required": [
|
||||
"groupVersion",
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"groupVersion": {
|
||||
"type": "string",
|
||||
"description": "groupVersion specifies the API group and version in the form \"group/version\""
|
||||
},
|
||||
"version": {
|
||||
"type": "string",
|
||||
"description": "version specifies the version in the form of \"version\". This is to save the clients the trouble of splitting the GroupVersion."
|
||||
}
|
||||
}
|
||||
},
|
||||
"v1.ServerAddressByClientCIDR": {
|
||||
"id": "v1.ServerAddressByClientCIDR",
|
||||
"description": "ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.",
|
||||
"required": [
|
||||
"clientCIDR",
|
||||
"serverAddress"
|
||||
],
|
||||
"properties": {
|
||||
"clientCIDR": {
|
||||
"type": "string",
|
||||
"description": "The CIDR with which clients can match their IP to figure out the server address that they should use."
|
||||
},
|
||||
"serverAddress": {
|
||||
"type": "string",
|
||||
"description": "Address of this server, suitable for a client that matches the above CIDR. This can be a hostname, hostname:port, IP or IP:port."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1145
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/federation_v1beta1.json
generated
vendored
Normal file
1145
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/federation_v1beta1.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
46
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/logs.json
generated
vendored
Normal file
46
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/logs.json
generated
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "https://10.10.10.10:6443",
|
||||
"resourcePath": "/logs",
|
||||
"info": {
|
||||
"title": "",
|
||||
"description": ""
|
||||
},
|
||||
"apis": [
|
||||
{
|
||||
"path": "/logs/{logpath}",
|
||||
"description": "get log files",
|
||||
"operations": [
|
||||
{
|
||||
"type": "void",
|
||||
"method": "GET",
|
||||
"nickname": "logFileHandler",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"paramType": "path",
|
||||
"name": "logpath",
|
||||
"description": "path to the log",
|
||||
"required": true,
|
||||
"allowMultiple": false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "/logs",
|
||||
"description": "get log files",
|
||||
"operations": [
|
||||
{
|
||||
"type": "void",
|
||||
"method": "GET",
|
||||
"nickname": "logFileListHandler",
|
||||
"parameters": []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"models": {}
|
||||
}
|
||||
46
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/resourceListing.json
generated
vendored
Normal file
46
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/resourceListing.json
generated
vendored
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apis": [
|
||||
{
|
||||
"path": "/version",
|
||||
"description": "git code version from which this is built"
|
||||
},
|
||||
{
|
||||
"path": "/apis",
|
||||
"description": "get available API versions"
|
||||
},
|
||||
{
|
||||
"path": "/logs",
|
||||
"description": "get log files"
|
||||
},
|
||||
{
|
||||
"path": "/apis/federation/v1beta1",
|
||||
"description": "API at /apis/federation/v1beta1"
|
||||
},
|
||||
{
|
||||
"path": "/apis/federation",
|
||||
"description": "get information of a group"
|
||||
},
|
||||
{
|
||||
"path": "/api/v1",
|
||||
"description": "API at /api/v1"
|
||||
},
|
||||
{
|
||||
"path": "/api",
|
||||
"description": "get available API versions"
|
||||
},
|
||||
{
|
||||
"path": "/apis/extensions/v1beta1",
|
||||
"description": "API at /apis/extensions/v1beta1"
|
||||
},
|
||||
{
|
||||
"path": "/apis/extensions",
|
||||
"description": "get information of a group"
|
||||
}
|
||||
],
|
||||
"apiVersion": "",
|
||||
"info": {
|
||||
"title": "",
|
||||
"description": ""
|
||||
}
|
||||
}
|
||||
5014
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/v1.json
generated
vendored
Normal file
5014
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/v1.json
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
76
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/version.json
generated
vendored
Normal file
76
vendor/k8s.io/kubernetes/federation/apis/swagger-spec/version.json
generated
vendored
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
{
|
||||
"swaggerVersion": "1.2",
|
||||
"apiVersion": "",
|
||||
"basePath": "https://10.10.10.10:6443",
|
||||
"resourcePath": "/version",
|
||||
"info": {
|
||||
"title": "",
|
||||
"description": ""
|
||||
},
|
||||
"apis": [
|
||||
{
|
||||
"path": "/version",
|
||||
"description": "git code version from which this is built",
|
||||
"operations": [
|
||||
{
|
||||
"type": "version.Info",
|
||||
"method": "GET",
|
||||
"summary": "get the code version",
|
||||
"nickname": "getCodeVersion",
|
||||
"parameters": [],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"models": {
|
||||
"version.Info": {
|
||||
"id": "version.Info",
|
||||
"required": [
|
||||
"major",
|
||||
"minor",
|
||||
"gitVersion",
|
||||
"gitCommit",
|
||||
"gitTreeState",
|
||||
"buildDate",
|
||||
"goVersion",
|
||||
"compiler",
|
||||
"platform"
|
||||
],
|
||||
"properties": {
|
||||
"major": {
|
||||
"type": "string"
|
||||
},
|
||||
"minor": {
|
||||
"type": "string"
|
||||
},
|
||||
"gitVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"gitCommit": {
|
||||
"type": "string"
|
||||
},
|
||||
"gitTreeState": {
|
||||
"type": "string"
|
||||
},
|
||||
"buildDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"goVersion": {
|
||||
"type": "string"
|
||||
},
|
||||
"compiler": {
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
22
vendor/k8s.io/kubernetes/federation/client/cache/BUILD
generated
vendored
Normal file
22
vendor/k8s.io/kubernetes/federation/client/cache/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["cluster_cache.go"],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/federation/v1beta1:go_default_library",
|
||||
"//pkg/client/cache:go_default_library",
|
||||
"//vendor:github.com/golang/glog",
|
||||
],
|
||||
)
|
||||
64
vendor/k8s.io/kubernetes/federation/client/cache/cluster_cache.go
generated
vendored
Normal file
64
vendor/k8s.io/kubernetes/federation/client/cache/cluster_cache.go
generated
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
Copyright 2016 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 cache
|
||||
|
||||
import (
|
||||
"github.com/golang/glog"
|
||||
"k8s.io/kubernetes/federation/apis/federation/v1beta1"
|
||||
kubecache "k8s.io/kubernetes/pkg/client/cache"
|
||||
)
|
||||
|
||||
// StoreToClusterLister makes a Store have the List method of the metav1.ClusterInterface
|
||||
// The Store must contain (only) clusters.
|
||||
type StoreToClusterLister struct {
|
||||
kubecache.Store
|
||||
}
|
||||
|
||||
func (s *StoreToClusterLister) List() (clusters v1beta1.ClusterList, err error) {
|
||||
for _, m := range s.Store.List() {
|
||||
clusters.Items = append(clusters.Items, *(m.(*v1beta1.Cluster)))
|
||||
}
|
||||
return clusters, nil
|
||||
}
|
||||
|
||||
// ClusterConditionPredicate is a function that indicates whether the given cluster's conditions meet
|
||||
// some set of criteria defined by the function.
|
||||
type ClusterConditionPredicate func(cluster v1beta1.Cluster) bool
|
||||
|
||||
// storeToClusterConditionLister filters and returns nodes matching the given type and status from the store.
|
||||
type storeToClusterConditionLister struct {
|
||||
store kubecache.Store
|
||||
predicate ClusterConditionPredicate
|
||||
}
|
||||
|
||||
// ClusterCondition returns a storeToClusterConditionLister
|
||||
func (s *StoreToClusterLister) ClusterCondition(predicate ClusterConditionPredicate) storeToClusterConditionLister {
|
||||
return storeToClusterConditionLister{s.Store, predicate}
|
||||
}
|
||||
|
||||
// List returns a list of clusters that match the conditions defined by the predicate functions in the storeToClusterConditionLister.
|
||||
func (s storeToClusterConditionLister) List() (clusters v1beta1.ClusterList, err error) {
|
||||
for _, m := range s.store.List() {
|
||||
cluster := *m.(*v1beta1.Cluster)
|
||||
if s.predicate(cluster) {
|
||||
clusters.Items = append(clusters.Items, cluster)
|
||||
} else {
|
||||
glog.V(5).Infof("Cluster %s matches none of the conditions", cluster.Name)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
32
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/BUILD
generated
vendored
Normal file
32
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"clientset.go",
|
||||
"doc.go",
|
||||
"import_known_versions.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/federation/install:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion:go_default_library",
|
||||
"//pkg/client/restclient:go_default_library",
|
||||
"//pkg/client/typed/discovery:go_default_library",
|
||||
"//pkg/util/flowcontrol:go_default_library",
|
||||
"//plugin/pkg/client/auth:go_default_library",
|
||||
"//vendor:github.com/golang/glog",
|
||||
],
|
||||
)
|
||||
127
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/clientset.go
generated
vendored
Normal file
127
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/clientset.go
generated
vendored
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
Copyright 2016 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 federation_internalclientset
|
||||
|
||||
import (
|
||||
"github.com/golang/glog"
|
||||
internalversioncore "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion"
|
||||
internalversionextensions "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion"
|
||||
internalversionfederation "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
discovery "k8s.io/kubernetes/pkg/client/typed/discovery"
|
||||
"k8s.io/kubernetes/pkg/util/flowcontrol"
|
||||
_ "k8s.io/kubernetes/plugin/pkg/client/auth"
|
||||
)
|
||||
|
||||
type Interface interface {
|
||||
Discovery() discovery.DiscoveryInterface
|
||||
Core() internalversioncore.CoreInterface
|
||||
|
||||
Extensions() internalversionextensions.ExtensionsInterface
|
||||
|
||||
Federation() internalversionfederation.FederationInterface
|
||||
}
|
||||
|
||||
// Clientset contains the clients for groups. Each group has exactly one
|
||||
// version included in a Clientset.
|
||||
type Clientset struct {
|
||||
*discovery.DiscoveryClient
|
||||
*internalversioncore.CoreClient
|
||||
*internalversionextensions.ExtensionsClient
|
||||
*internalversionfederation.FederationClient
|
||||
}
|
||||
|
||||
// Core retrieves the CoreClient
|
||||
func (c *Clientset) Core() internalversioncore.CoreInterface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.CoreClient
|
||||
}
|
||||
|
||||
// Extensions retrieves the ExtensionsClient
|
||||
func (c *Clientset) Extensions() internalversionextensions.ExtensionsInterface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.ExtensionsClient
|
||||
}
|
||||
|
||||
// Federation retrieves the FederationClient
|
||||
func (c *Clientset) Federation() internalversionfederation.FederationInterface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.FederationClient
|
||||
}
|
||||
|
||||
// Discovery retrieves the DiscoveryClient
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
return c.DiscoveryClient
|
||||
}
|
||||
|
||||
// NewForConfig creates a new Clientset for the given config.
|
||||
func NewForConfig(c *restclient.Config) (*Clientset, error) {
|
||||
configShallowCopy := *c
|
||||
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
|
||||
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
|
||||
}
|
||||
var clientset Clientset
|
||||
var err error
|
||||
clientset.CoreClient, err = internalversioncore.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clientset.ExtensionsClient, err = internalversionextensions.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
clientset.FederationClient, err = internalversionfederation.NewForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
clientset.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
|
||||
if err != nil {
|
||||
glog.Errorf("failed to create the DiscoveryClient: %v", err)
|
||||
return nil, err
|
||||
}
|
||||
return &clientset, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new Clientset for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *restclient.Config) *Clientset {
|
||||
var clientset Clientset
|
||||
clientset.CoreClient = internalversioncore.NewForConfigOrDie(c)
|
||||
clientset.ExtensionsClient = internalversionextensions.NewForConfigOrDie(c)
|
||||
clientset.FederationClient = internalversionfederation.NewForConfigOrDie(c)
|
||||
|
||||
clientset.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
|
||||
return &clientset
|
||||
}
|
||||
|
||||
// New creates a new Clientset for the given RESTClient.
|
||||
func New(c restclient.Interface) *Clientset {
|
||||
var clientset Clientset
|
||||
clientset.CoreClient = internalversioncore.New(c)
|
||||
clientset.ExtensionsClient = internalversionextensions.New(c)
|
||||
clientset.FederationClient = internalversionfederation.New(c)
|
||||
|
||||
clientset.DiscoveryClient = discovery.NewDiscoveryClient(c)
|
||||
return &clientset
|
||||
}
|
||||
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/doc.go
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event] --input=[../../federation/apis/federation/,api/,extensions/]
|
||||
|
||||
// This package has the automatically generated clientset.
|
||||
package federation_internalclientset
|
||||
36
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/fake/BUILD
generated
vendored
Normal file
36
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/fake/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"clientset_generated.go",
|
||||
"doc.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/client/clientset_generated/federation_internalclientset:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apimachinery/registered:go_default_library",
|
||||
"//pkg/client/testing/core:go_default_library",
|
||||
"//pkg/client/typed/discovery:go_default_library",
|
||||
"//pkg/client/typed/discovery/fake:go_default_library",
|
||||
"//pkg/runtime:go_default_library",
|
||||
"//pkg/watch:go_default_library",
|
||||
],
|
||||
)
|
||||
82
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/fake/clientset_generated.go
generated
vendored
Normal file
82
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/fake/clientset_generated.go
generated
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
clientset "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset"
|
||||
internalversioncore "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion"
|
||||
fakeinternalversioncore "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake"
|
||||
internalversionextensions "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion"
|
||||
fakeinternalversionextensions "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake"
|
||||
internalversionfederation "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion"
|
||||
fakeinternalversionfederation "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
"k8s.io/kubernetes/pkg/client/testing/core"
|
||||
"k8s.io/kubernetes/pkg/client/typed/discovery"
|
||||
fakediscovery "k8s.io/kubernetes/pkg/client/typed/discovery/fake"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
"k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// NewSimpleClientset returns a clientset that will respond with the provided objects.
|
||||
// It's backed by a very simple object tracker that processes creates, updates and deletions as-is,
|
||||
// without applying any validations and/or defaults. It shouldn't be considered a replacement
|
||||
// for a real clientset and is mostly useful in simple unit tests.
|
||||
func NewSimpleClientset(objects ...runtime.Object) *Clientset {
|
||||
o := core.NewObjectTracker(api.Scheme, api.Codecs.UniversalDecoder())
|
||||
for _, obj := range objects {
|
||||
if err := o.Add(obj); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
fakePtr := core.Fake{}
|
||||
fakePtr.AddReactor("*", "*", core.ObjectReaction(o, registered.RESTMapper()))
|
||||
|
||||
fakePtr.AddWatchReactor("*", core.DefaultWatchReactor(watch.NewFake(), nil))
|
||||
|
||||
return &Clientset{fakePtr}
|
||||
}
|
||||
|
||||
// Clientset implements clientset.Interface. Meant to be embedded into a
|
||||
// struct to get a default implementation. This makes faking out just the method
|
||||
// you want to test easier.
|
||||
type Clientset struct {
|
||||
core.Fake
|
||||
}
|
||||
|
||||
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
|
||||
return &fakediscovery.FakeDiscovery{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
var _ clientset.Interface = &Clientset{}
|
||||
|
||||
// Core retrieves the CoreClient
|
||||
func (c *Clientset) Core() internalversioncore.CoreInterface {
|
||||
return &fakeinternalversioncore.FakeCore{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Extensions retrieves the ExtensionsClient
|
||||
func (c *Clientset) Extensions() internalversionextensions.ExtensionsInterface {
|
||||
return &fakeinternalversionextensions.FakeExtensions{Fake: &c.Fake}
|
||||
}
|
||||
|
||||
// Federation retrieves the FederationClient
|
||||
func (c *Clientset) Federation() internalversionfederation.FederationInterface {
|
||||
return &fakeinternalversionfederation.FakeFederation{Fake: &c.Fake}
|
||||
}
|
||||
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/fake/doc.go
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/fake/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event] --input=[../../federation/apis/federation/,api/,extensions/]
|
||||
|
||||
// This package has the automatically generated fake clientset.
|
||||
package fake
|
||||
25
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/import_known_versions.go
generated
vendored
Normal file
25
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/import_known_versions.go
generated
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
Copyright 2016 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 federation_internalclientset
|
||||
|
||||
// These imports are the API groups the client will support.
|
||||
import (
|
||||
_ "k8s.io/kubernetes/federation/apis/federation/install"
|
||||
)
|
||||
|
||||
func init() {
|
||||
}
|
||||
33
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/BUILD
generated
vendored
Normal file
33
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"configmap.go",
|
||||
"core_client.go",
|
||||
"doc.go",
|
||||
"event.go",
|
||||
"generated_expansion.go",
|
||||
"namespace.go",
|
||||
"namespace_expansion.go",
|
||||
"secret.go",
|
||||
"service.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apimachinery/registered:go_default_library",
|
||||
"//pkg/client/restclient:go_default_library",
|
||||
"//pkg/watch:go_default_library",
|
||||
],
|
||||
)
|
||||
151
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/configmap.go
generated
vendored
Normal file
151
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/configmap.go
generated
vendored
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// ConfigMapsGetter has a method to return a ConfigMapInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ConfigMapsGetter interface {
|
||||
ConfigMaps(namespace string) ConfigMapInterface
|
||||
}
|
||||
|
||||
// ConfigMapInterface has methods to work with ConfigMap resources.
|
||||
type ConfigMapInterface interface {
|
||||
Create(*api.ConfigMap) (*api.ConfigMap, error)
|
||||
Update(*api.ConfigMap) (*api.ConfigMap, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*api.ConfigMap, error)
|
||||
List(opts api.ListOptions) (*api.ConfigMapList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.ConfigMap, err error)
|
||||
ConfigMapExpansion
|
||||
}
|
||||
|
||||
// configMaps implements ConfigMapInterface
|
||||
type configMaps struct {
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newConfigMaps returns a ConfigMaps
|
||||
func newConfigMaps(c *CoreClient, namespace string) *configMaps {
|
||||
return &configMaps{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a configMap and creates it. Returns the server's representation of the configMap, and an error, if there is any.
|
||||
func (c *configMaps) Create(configMap *api.ConfigMap) (result *api.ConfigMap, err error) {
|
||||
result = &api.ConfigMap{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("configmaps").
|
||||
Body(configMap).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a configMap and updates it. Returns the server's representation of the configMap, and an error, if there is any.
|
||||
func (c *configMaps) Update(configMap *api.ConfigMap) (result *api.ConfigMap, err error) {
|
||||
result = &api.ConfigMap{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("configmaps").
|
||||
Name(configMap.Name).
|
||||
Body(configMap).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the configMap and deletes it. Returns an error if one occurs.
|
||||
func (c *configMaps) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("configmaps").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *configMaps) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("configmaps").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the configMap, and returns the corresponding configMap object, and an error if there is any.
|
||||
func (c *configMaps) Get(name string) (result *api.ConfigMap, err error) {
|
||||
result = &api.ConfigMap{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("configmaps").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ConfigMaps that match those selectors.
|
||||
func (c *configMaps) List(opts api.ListOptions) (result *api.ConfigMapList, err error) {
|
||||
result = &api.ConfigMapList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("configmaps").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested configMaps.
|
||||
func (c *configMaps) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("configmaps").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched configMap.
|
||||
func (c *configMaps) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.ConfigMap, err error) {
|
||||
result = &api.ConfigMap{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("configmaps").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
119
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/core_client.go
generated
vendored
Normal file
119
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/core_client.go
generated
vendored
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
registered "k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
)
|
||||
|
||||
type CoreInterface interface {
|
||||
RESTClient() restclient.Interface
|
||||
ConfigMapsGetter
|
||||
EventsGetter
|
||||
NamespacesGetter
|
||||
SecretsGetter
|
||||
ServicesGetter
|
||||
}
|
||||
|
||||
// CoreClient is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
|
||||
type CoreClient struct {
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
func (c *CoreClient) ConfigMaps(namespace string) ConfigMapInterface {
|
||||
return newConfigMaps(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreClient) Events(namespace string) EventInterface {
|
||||
return newEvents(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreClient) Namespaces() NamespaceInterface {
|
||||
return newNamespaces(c)
|
||||
}
|
||||
|
||||
func (c *CoreClient) Secrets(namespace string) SecretInterface {
|
||||
return newSecrets(c, namespace)
|
||||
}
|
||||
|
||||
func (c *CoreClient) Services(namespace string) ServiceInterface {
|
||||
return newServices(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new CoreClient for the given config.
|
||||
func NewForConfig(c *restclient.Config) (*CoreClient, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := restclient.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &CoreClient{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new CoreClient for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *restclient.Config) *CoreClient {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new CoreClient for the given RESTClient.
|
||||
func New(c restclient.Interface) *CoreClient {
|
||||
return &CoreClient{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *restclient.Config) error {
|
||||
// if core group is not registered, return an error
|
||||
g, err := registered.Group("")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config.APIPath = "/api"
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = restclient.DefaultKubernetesUserAgent()
|
||||
}
|
||||
if config.GroupVersion == nil || config.GroupVersion.Group != g.GroupVersion.Group {
|
||||
copyGroupVersion := g.GroupVersion
|
||||
config.GroupVersion = ©GroupVersion
|
||||
}
|
||||
config.NegotiatedSerializer = api.Codecs
|
||||
|
||||
if config.QPS == 0 {
|
||||
config.QPS = 5
|
||||
}
|
||||
if config.Burst == 0 {
|
||||
config.Burst = 10
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *CoreClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/doc.go
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event] --input=[../../federation/apis/federation/,api/,extensions/]
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package internalversion
|
||||
151
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/event.go
generated
vendored
Normal file
151
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/event.go
generated
vendored
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// EventsGetter has a method to return a EventInterface.
|
||||
// A group's client should implement this interface.
|
||||
type EventsGetter interface {
|
||||
Events(namespace string) EventInterface
|
||||
}
|
||||
|
||||
// EventInterface has methods to work with Event resources.
|
||||
type EventInterface interface {
|
||||
Create(*api.Event) (*api.Event, error)
|
||||
Update(*api.Event) (*api.Event, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*api.Event, error)
|
||||
List(opts api.ListOptions) (*api.EventList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Event, err error)
|
||||
EventExpansion
|
||||
}
|
||||
|
||||
// events implements EventInterface
|
||||
type events struct {
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newEvents returns a Events
|
||||
func newEvents(c *CoreClient, namespace string) *events {
|
||||
return &events{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a event and creates it. Returns the server's representation of the event, and an error, if there is any.
|
||||
func (c *events) Create(event *api.Event) (result *api.Event, err error) {
|
||||
result = &api.Event{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
Body(event).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a event and updates it. Returns the server's representation of the event, and an error, if there is any.
|
||||
func (c *events) Update(event *api.Event) (result *api.Event, err error) {
|
||||
result = &api.Event{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
Name(event.Name).
|
||||
Body(event).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the event and deletes it. Returns an error if one occurs.
|
||||
func (c *events) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *events) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the event, and returns the corresponding event object, and an error if there is any.
|
||||
func (c *events) Get(name string) (result *api.Event, err error) {
|
||||
result = &api.Event{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Events that match those selectors.
|
||||
func (c *events) List(opts api.ListOptions) (result *api.EventList, err error) {
|
||||
result = &api.EventList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested events.
|
||||
func (c *events) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched event.
|
||||
func (c *events) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Event, err error) {
|
||||
result = &api.Event{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
35
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/BUILD
generated
vendored
Normal file
35
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"fake_configmap.go",
|
||||
"fake_core_client.go",
|
||||
"fake_event.go",
|
||||
"fake_namespace.go",
|
||||
"fake_namespace_expansion.go",
|
||||
"fake_secret.go",
|
||||
"fake_service.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/client/restclient:go_default_library",
|
||||
"//pkg/client/testing/core:go_default_library",
|
||||
"//pkg/labels:go_default_library",
|
||||
"//pkg/runtime/schema:go_default_library",
|
||||
"//pkg/watch:go_default_library",
|
||||
],
|
||||
)
|
||||
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/doc.go
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event] --input=[../../federation/apis/federation/,api/,extensions/]
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeConfigMaps implements ConfigMapInterface
|
||||
type FakeConfigMaps struct {
|
||||
Fake *FakeCore
|
||||
ns string
|
||||
}
|
||||
|
||||
var configmapsResource = schema.GroupVersionResource{Group: "", Version: "", Resource: "configmaps"}
|
||||
|
||||
func (c *FakeConfigMaps) Create(configMap *api.ConfigMap) (result *api.ConfigMap, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(configmapsResource, c.ns, configMap), &api.ConfigMap{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.ConfigMap), err
|
||||
}
|
||||
|
||||
func (c *FakeConfigMaps) Update(configMap *api.ConfigMap) (result *api.ConfigMap, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(configmapsResource, c.ns, configMap), &api.ConfigMap{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.ConfigMap), err
|
||||
}
|
||||
|
||||
func (c *FakeConfigMaps) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(configmapsResource, c.ns, name), &api.ConfigMap{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeConfigMaps) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(configmapsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &api.ConfigMapList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeConfigMaps) Get(name string) (result *api.ConfigMap, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(configmapsResource, c.ns, name), &api.ConfigMap{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.ConfigMap), err
|
||||
}
|
||||
|
||||
func (c *FakeConfigMaps) List(opts api.ListOptions) (result *api.ConfigMapList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(configmapsResource, c.ns, opts), &api.ConfigMapList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &api.ConfigMapList{}
|
||||
for _, item := range obj.(*api.ConfigMapList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested configMaps.
|
||||
func (c *FakeConfigMaps) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(configmapsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched configMap.
|
||||
func (c *FakeConfigMaps) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.ConfigMap, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewPatchSubresourceAction(configmapsResource, c.ns, name, data, subresources...), &api.ConfigMap{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.ConfigMap), err
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
internalversion "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
)
|
||||
|
||||
type FakeCore struct {
|
||||
*core.Fake
|
||||
}
|
||||
|
||||
func (c *FakeCore) ConfigMaps(namespace string) internalversion.ConfigMapInterface {
|
||||
return &FakeConfigMaps{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCore) Events(namespace string) internalversion.EventInterface {
|
||||
return &FakeEvents{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCore) Namespaces() internalversion.NamespaceInterface {
|
||||
return &FakeNamespaces{c}
|
||||
}
|
||||
|
||||
func (c *FakeCore) Secrets(namespace string) internalversion.SecretInterface {
|
||||
return &FakeSecrets{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeCore) Services(namespace string) internalversion.ServiceInterface {
|
||||
return &FakeServices{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeCore) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
116
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/fake_event.go
generated
vendored
Normal file
116
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/fake_event.go
generated
vendored
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeEvents implements EventInterface
|
||||
type FakeEvents struct {
|
||||
Fake *FakeCore
|
||||
ns string
|
||||
}
|
||||
|
||||
var eventsResource = schema.GroupVersionResource{Group: "", Version: "", Resource: "events"}
|
||||
|
||||
func (c *FakeEvents) Create(event *api.Event) (result *api.Event, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(eventsResource, c.ns, event), &api.Event{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Event), err
|
||||
}
|
||||
|
||||
func (c *FakeEvents) Update(event *api.Event) (result *api.Event, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(eventsResource, c.ns, event), &api.Event{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Event), err
|
||||
}
|
||||
|
||||
func (c *FakeEvents) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(eventsResource, c.ns, name), &api.Event{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeEvents) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(eventsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &api.EventList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeEvents) Get(name string) (result *api.Event, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(eventsResource, c.ns, name), &api.Event{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Event), err
|
||||
}
|
||||
|
||||
func (c *FakeEvents) List(opts api.ListOptions) (result *api.EventList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(eventsResource, c.ns, opts), &api.EventList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &api.EventList{}
|
||||
for _, item := range obj.(*api.EventList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested events.
|
||||
func (c *FakeEvents) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(eventsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched event.
|
||||
func (c *FakeEvents) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Event, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewPatchSubresourceAction(eventsResource, c.ns, name, data, subresources...), &api.Event{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Event), err
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeNamespaces implements NamespaceInterface
|
||||
type FakeNamespaces struct {
|
||||
Fake *FakeCore
|
||||
}
|
||||
|
||||
var namespacesResource = schema.GroupVersionResource{Group: "", Version: "", Resource: "namespaces"}
|
||||
|
||||
func (c *FakeNamespaces) Create(namespace *api.Namespace) (result *api.Namespace, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootCreateAction(namespacesResource, namespace), &api.Namespace{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Update(namespace *api.Namespace) (result *api.Namespace, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootUpdateAction(namespacesResource, namespace), &api.Namespace{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) UpdateStatus(namespace *api.Namespace) (*api.Namespace, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootUpdateSubresourceAction(namespacesResource, "status", namespace), &api.Namespace{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewRootDeleteAction(namespacesResource, name), &api.Namespace{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewRootDeleteCollectionAction(namespacesResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &api.NamespaceList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) Get(name string) (result *api.Namespace, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootGetAction(namespacesResource, name), &api.Namespace{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
||||
func (c *FakeNamespaces) List(opts api.ListOptions) (result *api.NamespaceList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootListAction(namespacesResource, opts), &api.NamespaceList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &api.NamespaceList{}
|
||||
for _, item := range obj.(*api.NamespaceList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested namespaces.
|
||||
func (c *FakeNamespaces) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewRootWatchAction(namespacesResource, opts))
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched namespace.
|
||||
func (c *FakeNamespaces) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Namespace, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootPatchSubresourceAction(namespacesResource, name, data, subresources...), &api.Namespace{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/client/testing/core"
|
||||
)
|
||||
|
||||
func (c *FakeNamespaces) Finalize(namespace *api.Namespace) (*api.Namespace, error) {
|
||||
action := core.CreateActionImpl{}
|
||||
action.Verb = "create"
|
||||
action.Resource = namespacesResource
|
||||
action.Subresource = "finalize"
|
||||
action.Object = namespace
|
||||
|
||||
obj, err := c.Fake.Invokes(action, namespace)
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return obj.(*api.Namespace), err
|
||||
}
|
||||
116
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/fake_secret.go
generated
vendored
Normal file
116
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/fake_secret.go
generated
vendored
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeSecrets implements SecretInterface
|
||||
type FakeSecrets struct {
|
||||
Fake *FakeCore
|
||||
ns string
|
||||
}
|
||||
|
||||
var secretsResource = schema.GroupVersionResource{Group: "", Version: "", Resource: "secrets"}
|
||||
|
||||
func (c *FakeSecrets) Create(secret *api.Secret) (result *api.Secret, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(secretsResource, c.ns, secret), &api.Secret{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Secret), err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) Update(secret *api.Secret) (result *api.Secret, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(secretsResource, c.ns, secret), &api.Secret{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Secret), err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(secretsResource, c.ns, name), &api.Secret{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(secretsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &api.SecretList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) Get(name string) (result *api.Secret, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(secretsResource, c.ns, name), &api.Secret{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Secret), err
|
||||
}
|
||||
|
||||
func (c *FakeSecrets) List(opts api.ListOptions) (result *api.SecretList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(secretsResource, c.ns, opts), &api.SecretList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &api.SecretList{}
|
||||
for _, item := range obj.(*api.SecretList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested secrets.
|
||||
func (c *FakeSecrets) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(secretsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched secret.
|
||||
func (c *FakeSecrets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Secret, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewPatchSubresourceAction(secretsResource, c.ns, name, data, subresources...), &api.Secret{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Secret), err
|
||||
}
|
||||
126
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/fake_service.go
generated
vendored
Normal file
126
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/fake/fake_service.go
generated
vendored
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeServices implements ServiceInterface
|
||||
type FakeServices struct {
|
||||
Fake *FakeCore
|
||||
ns string
|
||||
}
|
||||
|
||||
var servicesResource = schema.GroupVersionResource{Group: "", Version: "", Resource: "services"}
|
||||
|
||||
func (c *FakeServices) Create(service *api.Service) (result *api.Service, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(servicesResource, c.ns, service), &api.Service{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Service), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) Update(service *api.Service) (result *api.Service, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(servicesResource, c.ns, service), &api.Service{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Service), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) UpdateStatus(service *api.Service) (*api.Service, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateSubresourceAction(servicesResource, "status", c.ns, service), &api.Service{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Service), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(servicesResource, c.ns, name), &api.Service{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeServices) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(servicesResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &api.ServiceList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeServices) Get(name string) (result *api.Service, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(servicesResource, c.ns, name), &api.Service{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Service), err
|
||||
}
|
||||
|
||||
func (c *FakeServices) List(opts api.ListOptions) (result *api.ServiceList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(servicesResource, c.ns, opts), &api.ServiceList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &api.ServiceList{}
|
||||
for _, item := range obj.(*api.ServiceList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested services.
|
||||
func (c *FakeServices) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(servicesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched service.
|
||||
func (c *FakeServices) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Service, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewPatchSubresourceAction(servicesResource, c.ns, name, data, subresources...), &api.Service{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*api.Service), err
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
type ConfigMapExpansion interface{}
|
||||
|
||||
type EventExpansion interface{}
|
||||
|
||||
type SecretExpansion interface{}
|
||||
|
||||
type ServiceExpansion interface{}
|
||||
154
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/namespace.go
generated
vendored
Normal file
154
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/namespace.go
generated
vendored
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// NamespacesGetter has a method to return a NamespaceInterface.
|
||||
// A group's client should implement this interface.
|
||||
type NamespacesGetter interface {
|
||||
Namespaces() NamespaceInterface
|
||||
}
|
||||
|
||||
// NamespaceInterface has methods to work with Namespace resources.
|
||||
type NamespaceInterface interface {
|
||||
Create(*api.Namespace) (*api.Namespace, error)
|
||||
Update(*api.Namespace) (*api.Namespace, error)
|
||||
UpdateStatus(*api.Namespace) (*api.Namespace, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*api.Namespace, error)
|
||||
List(opts api.ListOptions) (*api.NamespaceList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Namespace, err error)
|
||||
NamespaceExpansion
|
||||
}
|
||||
|
||||
// namespaces implements NamespaceInterface
|
||||
type namespaces struct {
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newNamespaces returns a Namespaces
|
||||
func newNamespaces(c *CoreClient) *namespaces {
|
||||
return &namespaces{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a namespace and creates it. Returns the server's representation of the namespace, and an error, if there is any.
|
||||
func (c *namespaces) Create(namespace *api.Namespace) (result *api.Namespace, err error) {
|
||||
result = &api.Namespace{}
|
||||
err = c.client.Post().
|
||||
Resource("namespaces").
|
||||
Body(namespace).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a namespace and updates it. Returns the server's representation of the namespace, and an error, if there is any.
|
||||
func (c *namespaces) Update(namespace *api.Namespace) (result *api.Namespace, err error) {
|
||||
result = &api.Namespace{}
|
||||
err = c.client.Put().
|
||||
Resource("namespaces").
|
||||
Name(namespace.Name).
|
||||
Body(namespace).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *namespaces) UpdateStatus(namespace *api.Namespace) (result *api.Namespace, err error) {
|
||||
result = &api.Namespace{}
|
||||
err = c.client.Put().
|
||||
Resource("namespaces").
|
||||
Name(namespace.Name).
|
||||
SubResource("status").
|
||||
Body(namespace).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the namespace and deletes it. Returns an error if one occurs.
|
||||
func (c *namespaces) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("namespaces").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *namespaces) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("namespaces").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the namespace, and returns the corresponding namespace object, and an error if there is any.
|
||||
func (c *namespaces) Get(name string) (result *api.Namespace, err error) {
|
||||
result = &api.Namespace{}
|
||||
err = c.client.Get().
|
||||
Resource("namespaces").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Namespaces that match those selectors.
|
||||
func (c *namespaces) List(opts api.ListOptions) (result *api.NamespaceList, err error) {
|
||||
result = &api.NamespaceList{}
|
||||
err = c.client.Get().
|
||||
Resource("namespaces").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested namespaces.
|
||||
func (c *namespaces) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Resource("namespaces").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched namespace.
|
||||
func (c *namespaces) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Namespace, err error) {
|
||||
result = &api.Namespace{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("namespaces").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import "k8s.io/kubernetes/pkg/api"
|
||||
|
||||
// The NamespaceExpansion interface allows manually adding extra methods to the NamespaceInterface.
|
||||
type NamespaceExpansion interface {
|
||||
Finalize(item *api.Namespace) (*api.Namespace, error)
|
||||
}
|
||||
|
||||
// Finalize takes the representation of a namespace to update. Returns the server's representation of the namespace, and an error, if it occurs.
|
||||
func (c *namespaces) Finalize(namespace *api.Namespace) (result *api.Namespace, err error) {
|
||||
result = &api.Namespace{}
|
||||
err = c.client.Put().Resource("namespaces").Name(namespace.Name).SubResource("finalize").Body(namespace).Do().Into(result)
|
||||
return
|
||||
}
|
||||
151
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/secret.go
generated
vendored
Normal file
151
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/secret.go
generated
vendored
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// SecretsGetter has a method to return a SecretInterface.
|
||||
// A group's client should implement this interface.
|
||||
type SecretsGetter interface {
|
||||
Secrets(namespace string) SecretInterface
|
||||
}
|
||||
|
||||
// SecretInterface has methods to work with Secret resources.
|
||||
type SecretInterface interface {
|
||||
Create(*api.Secret) (*api.Secret, error)
|
||||
Update(*api.Secret) (*api.Secret, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*api.Secret, error)
|
||||
List(opts api.ListOptions) (*api.SecretList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Secret, err error)
|
||||
SecretExpansion
|
||||
}
|
||||
|
||||
// secrets implements SecretInterface
|
||||
type secrets struct {
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newSecrets returns a Secrets
|
||||
func newSecrets(c *CoreClient, namespace string) *secrets {
|
||||
return &secrets{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a secret and creates it. Returns the server's representation of the secret, and an error, if there is any.
|
||||
func (c *secrets) Create(secret *api.Secret) (result *api.Secret, err error) {
|
||||
result = &api.Secret{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("secrets").
|
||||
Body(secret).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a secret and updates it. Returns the server's representation of the secret, and an error, if there is any.
|
||||
func (c *secrets) Update(secret *api.Secret) (result *api.Secret, err error) {
|
||||
result = &api.Secret{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("secrets").
|
||||
Name(secret.Name).
|
||||
Body(secret).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the secret and deletes it. Returns an error if one occurs.
|
||||
func (c *secrets) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("secrets").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *secrets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("secrets").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the secret, and returns the corresponding secret object, and an error if there is any.
|
||||
func (c *secrets) Get(name string) (result *api.Secret, err error) {
|
||||
result = &api.Secret{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("secrets").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Secrets that match those selectors.
|
||||
func (c *secrets) List(opts api.ListOptions) (result *api.SecretList, err error) {
|
||||
result = &api.SecretList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("secrets").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested secrets.
|
||||
func (c *secrets) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("secrets").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched secret.
|
||||
func (c *secrets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Secret, err error) {
|
||||
result = &api.Secret{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("secrets").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
165
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/service.go
generated
vendored
Normal file
165
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/core/internalversion/service.go
generated
vendored
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// ServicesGetter has a method to return a ServiceInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ServicesGetter interface {
|
||||
Services(namespace string) ServiceInterface
|
||||
}
|
||||
|
||||
// ServiceInterface has methods to work with Service resources.
|
||||
type ServiceInterface interface {
|
||||
Create(*api.Service) (*api.Service, error)
|
||||
Update(*api.Service) (*api.Service, error)
|
||||
UpdateStatus(*api.Service) (*api.Service, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*api.Service, error)
|
||||
List(opts api.ListOptions) (*api.ServiceList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Service, err error)
|
||||
ServiceExpansion
|
||||
}
|
||||
|
||||
// services implements ServiceInterface
|
||||
type services struct {
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newServices returns a Services
|
||||
func newServices(c *CoreClient, namespace string) *services {
|
||||
return &services{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a service and creates it. Returns the server's representation of the service, and an error, if there is any.
|
||||
func (c *services) Create(service *api.Service) (result *api.Service, err error) {
|
||||
result = &api.Service{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
Body(service).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a service and updates it. Returns the server's representation of the service, and an error, if there is any.
|
||||
func (c *services) Update(service *api.Service) (result *api.Service, err error) {
|
||||
result = &api.Service{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
Name(service.Name).
|
||||
Body(service).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *services) UpdateStatus(service *api.Service) (result *api.Service, err error) {
|
||||
result = &api.Service{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
Name(service.Name).
|
||||
SubResource("status").
|
||||
Body(service).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the service and deletes it. Returns an error if one occurs.
|
||||
func (c *services) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *services) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the service, and returns the corresponding service object, and an error if there is any.
|
||||
func (c *services) Get(name string) (result *api.Service, err error) {
|
||||
result = &api.Service{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Services that match those selectors.
|
||||
func (c *services) List(opts api.ListOptions) (result *api.ServiceList, err error) {
|
||||
result = &api.ServiceList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested services.
|
||||
func (c *services) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched service.
|
||||
func (c *services) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *api.Service, err error) {
|
||||
result = &api.Service{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
32
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/BUILD
generated
vendored
Normal file
32
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"daemonset.go",
|
||||
"deployment.go",
|
||||
"doc.go",
|
||||
"extensions_client.go",
|
||||
"generated_expansion.go",
|
||||
"ingress.go",
|
||||
"replicaset.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apimachinery/registered:go_default_library",
|
||||
"//pkg/apis/extensions:go_default_library",
|
||||
"//pkg/client/restclient:go_default_library",
|
||||
"//pkg/watch:go_default_library",
|
||||
],
|
||||
)
|
||||
166
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/daemonset.go
generated
vendored
Normal file
166
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/daemonset.go
generated
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// DaemonSetsGetter has a method to return a DaemonSetInterface.
|
||||
// A group's client should implement this interface.
|
||||
type DaemonSetsGetter interface {
|
||||
DaemonSets(namespace string) DaemonSetInterface
|
||||
}
|
||||
|
||||
// DaemonSetInterface has methods to work with DaemonSet resources.
|
||||
type DaemonSetInterface interface {
|
||||
Create(*extensions.DaemonSet) (*extensions.DaemonSet, error)
|
||||
Update(*extensions.DaemonSet) (*extensions.DaemonSet, error)
|
||||
UpdateStatus(*extensions.DaemonSet) (*extensions.DaemonSet, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*extensions.DaemonSet, error)
|
||||
List(opts api.ListOptions) (*extensions.DaemonSetList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.DaemonSet, err error)
|
||||
DaemonSetExpansion
|
||||
}
|
||||
|
||||
// daemonSets implements DaemonSetInterface
|
||||
type daemonSets struct {
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDaemonSets returns a DaemonSets
|
||||
func newDaemonSets(c *ExtensionsClient, namespace string) *daemonSets {
|
||||
return &daemonSets{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a daemonSet and creates it. Returns the server's representation of the daemonSet, and an error, if there is any.
|
||||
func (c *daemonSets) Create(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
|
||||
result = &extensions.DaemonSet{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
Body(daemonSet).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a daemonSet and updates it. Returns the server's representation of the daemonSet, and an error, if there is any.
|
||||
func (c *daemonSets) Update(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
|
||||
result = &extensions.DaemonSet{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
Name(daemonSet.Name).
|
||||
Body(daemonSet).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *daemonSets) UpdateStatus(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
|
||||
result = &extensions.DaemonSet{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
Name(daemonSet.Name).
|
||||
SubResource("status").
|
||||
Body(daemonSet).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the daemonSet and deletes it. Returns an error if one occurs.
|
||||
func (c *daemonSets) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *daemonSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the daemonSet, and returns the corresponding daemonSet object, and an error if there is any.
|
||||
func (c *daemonSets) Get(name string) (result *extensions.DaemonSet, err error) {
|
||||
result = &extensions.DaemonSet{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of DaemonSets that match those selectors.
|
||||
func (c *daemonSets) List(opts api.ListOptions) (result *extensions.DaemonSetList, err error) {
|
||||
result = &extensions.DaemonSetList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested daemonSets.
|
||||
func (c *daemonSets) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched daemonSet.
|
||||
func (c *daemonSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.DaemonSet, err error) {
|
||||
result = &extensions.DaemonSet{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("daemonsets").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
166
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/deployment.go
generated
vendored
Normal file
166
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/deployment.go
generated
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// DeploymentsGetter has a method to return a DeploymentInterface.
|
||||
// A group's client should implement this interface.
|
||||
type DeploymentsGetter interface {
|
||||
Deployments(namespace string) DeploymentInterface
|
||||
}
|
||||
|
||||
// DeploymentInterface has methods to work with Deployment resources.
|
||||
type DeploymentInterface interface {
|
||||
Create(*extensions.Deployment) (*extensions.Deployment, error)
|
||||
Update(*extensions.Deployment) (*extensions.Deployment, error)
|
||||
UpdateStatus(*extensions.Deployment) (*extensions.Deployment, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*extensions.Deployment, error)
|
||||
List(opts api.ListOptions) (*extensions.DeploymentList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.Deployment, err error)
|
||||
DeploymentExpansion
|
||||
}
|
||||
|
||||
// deployments implements DeploymentInterface
|
||||
type deployments struct {
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newDeployments returns a Deployments
|
||||
func newDeployments(c *ExtensionsClient, namespace string) *deployments {
|
||||
return &deployments{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a deployment and creates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *deployments) Create(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
|
||||
result = &extensions.Deployment{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
Body(deployment).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a deployment and updates it. Returns the server's representation of the deployment, and an error, if there is any.
|
||||
func (c *deployments) Update(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
|
||||
result = &extensions.Deployment{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
Name(deployment.Name).
|
||||
Body(deployment).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *deployments) UpdateStatus(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
|
||||
result = &extensions.Deployment{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
Name(deployment.Name).
|
||||
SubResource("status").
|
||||
Body(deployment).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the deployment and deletes it. Returns an error if one occurs.
|
||||
func (c *deployments) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *deployments) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the deployment, and returns the corresponding deployment object, and an error if there is any.
|
||||
func (c *deployments) Get(name string) (result *extensions.Deployment, err error) {
|
||||
result = &extensions.Deployment{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Deployments that match those selectors.
|
||||
func (c *deployments) List(opts api.ListOptions) (result *extensions.DeploymentList, err error) {
|
||||
result = &extensions.DeploymentList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested deployments.
|
||||
func (c *deployments) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (c *deployments) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.Deployment, err error) {
|
||||
result = &extensions.Deployment{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/doc.go
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event] --input=[../../federation/apis/federation/,api/,extensions/]
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package internalversion
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
registered "k8s.io/kubernetes/pkg/apimachinery/registered"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
)
|
||||
|
||||
type ExtensionsInterface interface {
|
||||
RESTClient() restclient.Interface
|
||||
DaemonSetsGetter
|
||||
DeploymentsGetter
|
||||
IngressesGetter
|
||||
ReplicaSetsGetter
|
||||
}
|
||||
|
||||
// ExtensionsClient is used to interact with features provided by the k8s.io/kubernetes/pkg/apimachinery/registered.Group group.
|
||||
type ExtensionsClient struct {
|
||||
restClient restclient.Interface
|
||||
}
|
||||
|
||||
func (c *ExtensionsClient) DaemonSets(namespace string) DaemonSetInterface {
|
||||
return newDaemonSets(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ExtensionsClient) Deployments(namespace string) DeploymentInterface {
|
||||
return newDeployments(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ExtensionsClient) Ingresses(namespace string) IngressInterface {
|
||||
return newIngresses(c, namespace)
|
||||
}
|
||||
|
||||
func (c *ExtensionsClient) ReplicaSets(namespace string) ReplicaSetInterface {
|
||||
return newReplicaSets(c, namespace)
|
||||
}
|
||||
|
||||
// NewForConfig creates a new ExtensionsClient for the given config.
|
||||
func NewForConfig(c *restclient.Config) (*ExtensionsClient, error) {
|
||||
config := *c
|
||||
if err := setConfigDefaults(&config); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
client, err := restclient.RESTClientFor(&config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &ExtensionsClient{client}, nil
|
||||
}
|
||||
|
||||
// NewForConfigOrDie creates a new ExtensionsClient for the given config and
|
||||
// panics if there is an error in the config.
|
||||
func NewForConfigOrDie(c *restclient.Config) *ExtensionsClient {
|
||||
client, err := NewForConfig(c)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return client
|
||||
}
|
||||
|
||||
// New creates a new ExtensionsClient for the given RESTClient.
|
||||
func New(c restclient.Interface) *ExtensionsClient {
|
||||
return &ExtensionsClient{c}
|
||||
}
|
||||
|
||||
func setConfigDefaults(config *restclient.Config) error {
|
||||
// if extensions group is not registered, return an error
|
||||
g, err := registered.Group("extensions")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
config.APIPath = "/apis"
|
||||
if config.UserAgent == "" {
|
||||
config.UserAgent = restclient.DefaultKubernetesUserAgent()
|
||||
}
|
||||
if config.GroupVersion == nil || config.GroupVersion.Group != g.GroupVersion.Group {
|
||||
copyGroupVersion := g.GroupVersion
|
||||
config.GroupVersion = ©GroupVersion
|
||||
}
|
||||
config.NegotiatedSerializer = api.Codecs
|
||||
|
||||
if config.QPS == 0 {
|
||||
config.QPS = 5
|
||||
}
|
||||
if config.Burst == 0 {
|
||||
config.Burst = 10
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *ExtensionsClient) RESTClient() restclient.Interface {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.restClient
|
||||
}
|
||||
34
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake/BUILD
generated
vendored
Normal file
34
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"fake_daemonset.go",
|
||||
"fake_deployment.go",
|
||||
"fake_extensions_client.go",
|
||||
"fake_ingress.go",
|
||||
"fake_replicaset.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apis/extensions:go_default_library",
|
||||
"//pkg/client/restclient:go_default_library",
|
||||
"//pkg/client/testing/core:go_default_library",
|
||||
"//pkg/labels:go_default_library",
|
||||
"//pkg/runtime/schema:go_default_library",
|
||||
"//pkg/watch:go_default_library",
|
||||
],
|
||||
)
|
||||
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake/doc.go
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/fake/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event] --input=[../../federation/apis/federation/,api/,extensions/]
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeDaemonSets implements DaemonSetInterface
|
||||
type FakeDaemonSets struct {
|
||||
Fake *FakeExtensions
|
||||
ns string
|
||||
}
|
||||
|
||||
var daemonsetsResource = schema.GroupVersionResource{Group: "extensions", Version: "", Resource: "daemonsets"}
|
||||
|
||||
func (c *FakeDaemonSets) Create(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(daemonsetsResource, c.ns, daemonSet), &extensions.DaemonSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.DaemonSet), err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) Update(daemonSet *extensions.DaemonSet) (result *extensions.DaemonSet, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(daemonsetsResource, c.ns, daemonSet), &extensions.DaemonSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.DaemonSet), err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) UpdateStatus(daemonSet *extensions.DaemonSet) (*extensions.DaemonSet, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateSubresourceAction(daemonsetsResource, "status", c.ns, daemonSet), &extensions.DaemonSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.DaemonSet), err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(daemonsetsResource, c.ns, name), &extensions.DaemonSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(daemonsetsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &extensions.DaemonSetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) Get(name string) (result *extensions.DaemonSet, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(daemonsetsResource, c.ns, name), &extensions.DaemonSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.DaemonSet), err
|
||||
}
|
||||
|
||||
func (c *FakeDaemonSets) List(opts api.ListOptions) (result *extensions.DaemonSetList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(daemonsetsResource, c.ns, opts), &extensions.DaemonSetList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &extensions.DaemonSetList{}
|
||||
for _, item := range obj.(*extensions.DaemonSetList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested daemonSets.
|
||||
func (c *FakeDaemonSets) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(daemonsetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched daemonSet.
|
||||
func (c *FakeDaemonSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.DaemonSet, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, data, subresources...), &extensions.DaemonSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.DaemonSet), err
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeDeployments implements DeploymentInterface
|
||||
type FakeDeployments struct {
|
||||
Fake *FakeExtensions
|
||||
ns string
|
||||
}
|
||||
|
||||
var deploymentsResource = schema.GroupVersionResource{Group: "extensions", Version: "", Resource: "deployments"}
|
||||
|
||||
func (c *FakeDeployments) Create(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(deploymentsResource, c.ns, deployment), &extensions.Deployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Deployment), err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) Update(deployment *extensions.Deployment) (result *extensions.Deployment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(deploymentsResource, c.ns, deployment), &extensions.Deployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Deployment), err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) UpdateStatus(deployment *extensions.Deployment) (*extensions.Deployment, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateSubresourceAction(deploymentsResource, "status", c.ns, deployment), &extensions.Deployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Deployment), err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(deploymentsResource, c.ns, name), &extensions.Deployment{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(deploymentsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &extensions.DeploymentList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) Get(name string) (result *extensions.Deployment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(deploymentsResource, c.ns, name), &extensions.Deployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Deployment), err
|
||||
}
|
||||
|
||||
func (c *FakeDeployments) List(opts api.ListOptions) (result *extensions.DeploymentList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(deploymentsResource, c.ns, opts), &extensions.DeploymentList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &extensions.DeploymentList{}
|
||||
for _, item := range obj.(*extensions.DeploymentList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested deployments.
|
||||
func (c *FakeDeployments) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(deploymentsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched deployment.
|
||||
func (c *FakeDeployments) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.Deployment, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewPatchSubresourceAction(deploymentsResource, c.ns, name, data, subresources...), &extensions.Deployment{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Deployment), err
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
internalversion "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
)
|
||||
|
||||
type FakeExtensions struct {
|
||||
*core.Fake
|
||||
}
|
||||
|
||||
func (c *FakeExtensions) DaemonSets(namespace string) internalversion.DaemonSetInterface {
|
||||
return &FakeDaemonSets{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeExtensions) Deployments(namespace string) internalversion.DeploymentInterface {
|
||||
return &FakeDeployments{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeExtensions) Ingresses(namespace string) internalversion.IngressInterface {
|
||||
return &FakeIngresses{c, namespace}
|
||||
}
|
||||
|
||||
func (c *FakeExtensions) ReplicaSets(namespace string) internalversion.ReplicaSetInterface {
|
||||
return &FakeReplicaSets{c, namespace}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeExtensions) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeIngresses implements IngressInterface
|
||||
type FakeIngresses struct {
|
||||
Fake *FakeExtensions
|
||||
ns string
|
||||
}
|
||||
|
||||
var ingressesResource = schema.GroupVersionResource{Group: "extensions", Version: "", Resource: "ingresses"}
|
||||
|
||||
func (c *FakeIngresses) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(ingressesResource, c.ns, ingress), &extensions.Ingress{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Ingress), err
|
||||
}
|
||||
|
||||
func (c *FakeIngresses) Update(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(ingressesResource, c.ns, ingress), &extensions.Ingress{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Ingress), err
|
||||
}
|
||||
|
||||
func (c *FakeIngresses) UpdateStatus(ingress *extensions.Ingress) (*extensions.Ingress, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &extensions.Ingress{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Ingress), err
|
||||
}
|
||||
|
||||
func (c *FakeIngresses) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(ingressesResource, c.ns, name), &extensions.Ingress{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeIngresses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(ingressesResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &extensions.IngressList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeIngresses) Get(name string) (result *extensions.Ingress, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(ingressesResource, c.ns, name), &extensions.Ingress{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Ingress), err
|
||||
}
|
||||
|
||||
func (c *FakeIngresses) List(opts api.ListOptions) (result *extensions.IngressList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(ingressesResource, c.ns, opts), &extensions.IngressList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &extensions.IngressList{}
|
||||
for _, item := range obj.(*extensions.IngressList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested ingresses.
|
||||
func (c *FakeIngresses) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(ingressesResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched ingress.
|
||||
func (c *FakeIngresses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.Ingress, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewPatchSubresourceAction(ingressesResource, c.ns, name, data, subresources...), &extensions.Ingress{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.Ingress), err
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeReplicaSets implements ReplicaSetInterface
|
||||
type FakeReplicaSets struct {
|
||||
Fake *FakeExtensions
|
||||
ns string
|
||||
}
|
||||
|
||||
var replicasetsResource = schema.GroupVersionResource{Group: "extensions", Version: "", Resource: "replicasets"}
|
||||
|
||||
func (c *FakeReplicaSets) Create(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewCreateAction(replicasetsResource, c.ns, replicaSet), &extensions.ReplicaSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.ReplicaSet), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicaSets) Update(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateAction(replicasetsResource, c.ns, replicaSet), &extensions.ReplicaSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.ReplicaSet), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicaSets) UpdateStatus(replicaSet *extensions.ReplicaSet) (*extensions.ReplicaSet, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewUpdateSubresourceAction(replicasetsResource, "status", c.ns, replicaSet), &extensions.ReplicaSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.ReplicaSet), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicaSets) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewDeleteAction(replicasetsResource, c.ns, name), &extensions.ReplicaSet{})
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeReplicaSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewDeleteCollectionAction(replicasetsResource, c.ns, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &extensions.ReplicaSetList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeReplicaSets) Get(name string) (result *extensions.ReplicaSet, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewGetAction(replicasetsResource, c.ns, name), &extensions.ReplicaSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.ReplicaSet), err
|
||||
}
|
||||
|
||||
func (c *FakeReplicaSets) List(opts api.ListOptions) (result *extensions.ReplicaSetList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewListAction(replicasetsResource, c.ns, opts), &extensions.ReplicaSetList{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &extensions.ReplicaSetList{}
|
||||
for _, item := range obj.(*extensions.ReplicaSetList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested replicaSets.
|
||||
func (c *FakeReplicaSets) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewWatchAction(replicasetsResource, c.ns, opts))
|
||||
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched replicaSet.
|
||||
func (c *FakeReplicaSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.ReplicaSet, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewPatchSubresourceAction(replicasetsResource, c.ns, name, data, subresources...), &extensions.ReplicaSet{})
|
||||
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*extensions.ReplicaSet), err
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
type DaemonSetExpansion interface{}
|
||||
|
||||
type DeploymentExpansion interface{}
|
||||
|
||||
type IngressExpansion interface{}
|
||||
|
||||
type ReplicaSetExpansion interface{}
|
||||
166
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/ingress.go
generated
vendored
Normal file
166
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/ingress.go
generated
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// IngressesGetter has a method to return a IngressInterface.
|
||||
// A group's client should implement this interface.
|
||||
type IngressesGetter interface {
|
||||
Ingresses(namespace string) IngressInterface
|
||||
}
|
||||
|
||||
// IngressInterface has methods to work with Ingress resources.
|
||||
type IngressInterface interface {
|
||||
Create(*extensions.Ingress) (*extensions.Ingress, error)
|
||||
Update(*extensions.Ingress) (*extensions.Ingress, error)
|
||||
UpdateStatus(*extensions.Ingress) (*extensions.Ingress, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*extensions.Ingress, error)
|
||||
List(opts api.ListOptions) (*extensions.IngressList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.Ingress, err error)
|
||||
IngressExpansion
|
||||
}
|
||||
|
||||
// ingresses implements IngressInterface
|
||||
type ingresses struct {
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newIngresses returns a Ingresses
|
||||
func newIngresses(c *ExtensionsClient, namespace string) *ingresses {
|
||||
return &ingresses{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a ingress and creates it. Returns the server's representation of the ingress, and an error, if there is any.
|
||||
func (c *ingresses) Create(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
|
||||
result = &extensions.Ingress{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
Body(ingress).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a ingress and updates it. Returns the server's representation of the ingress, and an error, if there is any.
|
||||
func (c *ingresses) Update(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
|
||||
result = &extensions.Ingress{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
Name(ingress.Name).
|
||||
Body(ingress).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *ingresses) UpdateStatus(ingress *extensions.Ingress) (result *extensions.Ingress, err error) {
|
||||
result = &extensions.Ingress{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
Name(ingress.Name).
|
||||
SubResource("status").
|
||||
Body(ingress).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the ingress and deletes it. Returns an error if one occurs.
|
||||
func (c *ingresses) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *ingresses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any.
|
||||
func (c *ingresses) Get(name string) (result *extensions.Ingress, err error) {
|
||||
result = &extensions.Ingress{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Ingresses that match those selectors.
|
||||
func (c *ingresses) List(opts api.ListOptions) (result *extensions.IngressList, err error) {
|
||||
result = &extensions.IngressList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested ingresses.
|
||||
func (c *ingresses) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched ingress.
|
||||
func (c *ingresses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.Ingress, err error) {
|
||||
result = &extensions.Ingress{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
166
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/replicaset.go
generated
vendored
Normal file
166
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/extensions/internalversion/replicaset.go
generated
vendored
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
extensions "k8s.io/kubernetes/pkg/apis/extensions"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// ReplicaSetsGetter has a method to return a ReplicaSetInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ReplicaSetsGetter interface {
|
||||
ReplicaSets(namespace string) ReplicaSetInterface
|
||||
}
|
||||
|
||||
// ReplicaSetInterface has methods to work with ReplicaSet resources.
|
||||
type ReplicaSetInterface interface {
|
||||
Create(*extensions.ReplicaSet) (*extensions.ReplicaSet, error)
|
||||
Update(*extensions.ReplicaSet) (*extensions.ReplicaSet, error)
|
||||
UpdateStatus(*extensions.ReplicaSet) (*extensions.ReplicaSet, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*extensions.ReplicaSet, error)
|
||||
List(opts api.ListOptions) (*extensions.ReplicaSetList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.ReplicaSet, err error)
|
||||
ReplicaSetExpansion
|
||||
}
|
||||
|
||||
// replicaSets implements ReplicaSetInterface
|
||||
type replicaSets struct {
|
||||
client restclient.Interface
|
||||
ns string
|
||||
}
|
||||
|
||||
// newReplicaSets returns a ReplicaSets
|
||||
func newReplicaSets(c *ExtensionsClient, namespace string) *replicaSets {
|
||||
return &replicaSets{
|
||||
client: c.RESTClient(),
|
||||
ns: namespace,
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a replicaSet and creates it. Returns the server's representation of the replicaSet, and an error, if there is any.
|
||||
func (c *replicaSets) Create(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) {
|
||||
result = &extensions.ReplicaSet{}
|
||||
err = c.client.Post().
|
||||
Namespace(c.ns).
|
||||
Resource("replicasets").
|
||||
Body(replicaSet).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a replicaSet and updates it. Returns the server's representation of the replicaSet, and an error, if there is any.
|
||||
func (c *replicaSets) Update(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) {
|
||||
result = &extensions.ReplicaSet{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("replicasets").
|
||||
Name(replicaSet.Name).
|
||||
Body(replicaSet).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *replicaSets) UpdateStatus(replicaSet *extensions.ReplicaSet) (result *extensions.ReplicaSet, err error) {
|
||||
result = &extensions.ReplicaSet{}
|
||||
err = c.client.Put().
|
||||
Namespace(c.ns).
|
||||
Resource("replicasets").
|
||||
Name(replicaSet.Name).
|
||||
SubResource("status").
|
||||
Body(replicaSet).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the replicaSet and deletes it. Returns an error if one occurs.
|
||||
func (c *replicaSets) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("replicasets").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *replicaSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Namespace(c.ns).
|
||||
Resource("replicasets").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the replicaSet, and returns the corresponding replicaSet object, and an error if there is any.
|
||||
func (c *replicaSets) Get(name string) (result *extensions.ReplicaSet, err error) {
|
||||
result = &extensions.ReplicaSet{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("replicasets").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of ReplicaSets that match those selectors.
|
||||
func (c *replicaSets) List(opts api.ListOptions) (result *extensions.ReplicaSetList, err error) {
|
||||
result = &extensions.ReplicaSetList{}
|
||||
err = c.client.Get().
|
||||
Namespace(c.ns).
|
||||
Resource("replicasets").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested replicaSets.
|
||||
func (c *replicaSets) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Namespace(c.ns).
|
||||
Resource("replicasets").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched replicaSet.
|
||||
func (c *replicaSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *extensions.ReplicaSet, err error) {
|
||||
result = &extensions.ReplicaSet{}
|
||||
err = c.client.Patch(pt).
|
||||
Namespace(c.ns).
|
||||
Resource("replicasets").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
29
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/BUILD
generated
vendored
Normal file
29
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"cluster.go",
|
||||
"doc.go",
|
||||
"federation_client.go",
|
||||
"generated_expansion.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/federation:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/apimachinery/registered:go_default_library",
|
||||
"//pkg/client/restclient:go_default_library",
|
||||
"//pkg/watch:go_default_library",
|
||||
],
|
||||
)
|
||||
155
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/cluster.go
generated
vendored
Normal file
155
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/cluster.go
generated
vendored
Normal file
|
|
@ -0,0 +1,155 @@
|
|||
/*
|
||||
Copyright 2016 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 internalversion
|
||||
|
||||
import (
|
||||
federation "k8s.io/kubernetes/federation/apis/federation"
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// ClustersGetter has a method to return a ClusterInterface.
|
||||
// A group's client should implement this interface.
|
||||
type ClustersGetter interface {
|
||||
Clusters() ClusterInterface
|
||||
}
|
||||
|
||||
// ClusterInterface has methods to work with Cluster resources.
|
||||
type ClusterInterface interface {
|
||||
Create(*federation.Cluster) (*federation.Cluster, error)
|
||||
Update(*federation.Cluster) (*federation.Cluster, error)
|
||||
UpdateStatus(*federation.Cluster) (*federation.Cluster, error)
|
||||
Delete(name string, options *api.DeleteOptions) error
|
||||
DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error
|
||||
Get(name string) (*federation.Cluster, error)
|
||||
List(opts api.ListOptions) (*federation.ClusterList, error)
|
||||
Watch(opts api.ListOptions) (watch.Interface, error)
|
||||
Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *federation.Cluster, err error)
|
||||
ClusterExpansion
|
||||
}
|
||||
|
||||
// clusters implements ClusterInterface
|
||||
type clusters struct {
|
||||
client restclient.Interface
|
||||
}
|
||||
|
||||
// newClusters returns a Clusters
|
||||
func newClusters(c *FederationClient) *clusters {
|
||||
return &clusters{
|
||||
client: c.RESTClient(),
|
||||
}
|
||||
}
|
||||
|
||||
// Create takes the representation of a cluster and creates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *clusters) Create(cluster *federation.Cluster) (result *federation.Cluster, err error) {
|
||||
result = &federation.Cluster{}
|
||||
err = c.client.Post().
|
||||
Resource("clusters").
|
||||
Body(cluster).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Update takes the representation of a cluster and updates it. Returns the server's representation of the cluster, and an error, if there is any.
|
||||
func (c *clusters) Update(cluster *federation.Cluster) (result *federation.Cluster, err error) {
|
||||
result = &federation.Cluster{}
|
||||
err = c.client.Put().
|
||||
Resource("clusters").
|
||||
Name(cluster.Name).
|
||||
Body(cluster).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *clusters) UpdateStatus(cluster *federation.Cluster) (result *federation.Cluster, err error) {
|
||||
result = &federation.Cluster{}
|
||||
err = c.client.Put().
|
||||
Resource("clusters").
|
||||
Name(cluster.Name).
|
||||
SubResource("status").
|
||||
Body(cluster).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete takes name of the cluster and deletes it. Returns an error if one occurs.
|
||||
func (c *clusters) Delete(name string, options *api.DeleteOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusters").
|
||||
Name(name).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *clusters) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
Resource("clusters").
|
||||
VersionedParams(&listOptions, api.ParameterCodec).
|
||||
Body(options).
|
||||
Do().
|
||||
Error()
|
||||
}
|
||||
|
||||
// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any.
|
||||
func (c *clusters) Get(name string) (result *federation.Cluster, err error) {
|
||||
result = &federation.Cluster{}
|
||||
err = c.client.Get().
|
||||
Resource("clusters").
|
||||
Name(name).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// List takes label and field selectors, and returns the list of Clusters that match those selectors.
|
||||
func (c *clusters) List(opts api.ListOptions) (result *federation.ClusterList, err error) {
|
||||
result = &federation.ClusterList{}
|
||||
err = c.client.Get().
|
||||
Resource("clusters").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusters.
|
||||
func (c *clusters) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.client.Get().
|
||||
Prefix("watch").
|
||||
Resource("clusters").
|
||||
VersionedParams(&opts, api.ParameterCodec).
|
||||
Watch()
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched cluster.
|
||||
func (c *clusters) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *federation.Cluster, err error) {
|
||||
result = &federation.Cluster{}
|
||||
err = c.client.Patch(pt).
|
||||
Resource("clusters").
|
||||
SubResource(subresources...).
|
||||
Name(name).
|
||||
Body(data).
|
||||
Do().
|
||||
Into(result)
|
||||
return
|
||||
}
|
||||
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/doc.go
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event] --input=[../../federation/apis/federation/,api/,extensions/]
|
||||
|
||||
// This package has the automatically generated typed clients.
|
||||
package internalversion
|
||||
31
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake/BUILD
generated
vendored
Normal file
31
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_binary",
|
||||
"go_library",
|
||||
"go_test",
|
||||
"cgo_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"doc.go",
|
||||
"fake_cluster.go",
|
||||
"fake_federation_client.go",
|
||||
],
|
||||
tags = ["automanaged"],
|
||||
deps = [
|
||||
"//federation/apis/federation:go_default_library",
|
||||
"//federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion:go_default_library",
|
||||
"//pkg/api:go_default_library",
|
||||
"//pkg/client/restclient:go_default_library",
|
||||
"//pkg/client/testing/core:go_default_library",
|
||||
"//pkg/labels:go_default_library",
|
||||
"//pkg/runtime/schema:go_default_library",
|
||||
"//pkg/watch:go_default_library",
|
||||
],
|
||||
)
|
||||
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake/doc.go
generated
vendored
Normal file
20
vendor/k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion/fake/doc.go
generated
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
Copyright 2016 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.
|
||||
*/
|
||||
|
||||
// This package is generated by client-gen with arguments: --clientset-name=federation_internalclientset --clientset-path=k8s.io/kubernetes/federation/client/clientset_generated --included-types-overrides=[api/Service,api/Namespace,extensions/ReplicaSet,api/Secret,extensions/Ingress,extensions/Deployment,extensions/DaemonSet,api/ConfigMap,api/Event] --input=[../../federation/apis/federation/,api/,extensions/]
|
||||
|
||||
// Package fake has the automatically generated clients.
|
||||
package fake
|
||||
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
federation "k8s.io/kubernetes/federation/apis/federation"
|
||||
api "k8s.io/kubernetes/pkg/api"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
labels "k8s.io/kubernetes/pkg/labels"
|
||||
schema "k8s.io/kubernetes/pkg/runtime/schema"
|
||||
watch "k8s.io/kubernetes/pkg/watch"
|
||||
)
|
||||
|
||||
// FakeClusters implements ClusterInterface
|
||||
type FakeClusters struct {
|
||||
Fake *FakeFederation
|
||||
}
|
||||
|
||||
var clustersResource = schema.GroupVersionResource{Group: "federation", Version: "", Resource: "clusters"}
|
||||
|
||||
func (c *FakeClusters) Create(cluster *federation.Cluster) (result *federation.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootCreateAction(clustersResource, cluster), &federation.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*federation.Cluster), err
|
||||
}
|
||||
|
||||
func (c *FakeClusters) Update(cluster *federation.Cluster) (result *federation.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootUpdateAction(clustersResource, cluster), &federation.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*federation.Cluster), err
|
||||
}
|
||||
|
||||
func (c *FakeClusters) UpdateStatus(cluster *federation.Cluster) (*federation.Cluster, error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &federation.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*federation.Cluster), err
|
||||
}
|
||||
|
||||
func (c *FakeClusters) Delete(name string, options *api.DeleteOptions) error {
|
||||
_, err := c.Fake.
|
||||
Invokes(core.NewRootDeleteAction(clustersResource, name), &federation.Cluster{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeClusters) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
action := core.NewRootDeleteCollectionAction(clustersResource, listOptions)
|
||||
|
||||
_, err := c.Fake.Invokes(action, &federation.ClusterList{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *FakeClusters) Get(name string) (result *federation.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootGetAction(clustersResource, name), &federation.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*federation.Cluster), err
|
||||
}
|
||||
|
||||
func (c *FakeClusters) List(opts api.ListOptions) (result *federation.ClusterList, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootListAction(clustersResource, opts), &federation.ClusterList{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
label, _, _ := core.ExtractFromListOptions(opts)
|
||||
if label == nil {
|
||||
label = labels.Everything()
|
||||
}
|
||||
list := &federation.ClusterList{}
|
||||
for _, item := range obj.(*federation.ClusterList).Items {
|
||||
if label.Matches(labels.Set(item.Labels)) {
|
||||
list.Items = append(list.Items, item)
|
||||
}
|
||||
}
|
||||
return list, err
|
||||
}
|
||||
|
||||
// Watch returns a watch.Interface that watches the requested clusters.
|
||||
func (c *FakeClusters) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return c.Fake.
|
||||
InvokesWatch(core.NewRootWatchAction(clustersResource, opts))
|
||||
}
|
||||
|
||||
// Patch applies the patch and returns the patched cluster.
|
||||
func (c *FakeClusters) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *federation.Cluster, err error) {
|
||||
obj, err := c.Fake.
|
||||
Invokes(core.NewRootPatchSubresourceAction(clustersResource, name, data, subresources...), &federation.Cluster{})
|
||||
if obj == nil {
|
||||
return nil, err
|
||||
}
|
||||
return obj.(*federation.Cluster), err
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
Copyright 2016 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 fake
|
||||
|
||||
import (
|
||||
internalversion "k8s.io/kubernetes/federation/client/clientset_generated/federation_internalclientset/typed/federation/internalversion"
|
||||
restclient "k8s.io/kubernetes/pkg/client/restclient"
|
||||
core "k8s.io/kubernetes/pkg/client/testing/core"
|
||||
)
|
||||
|
||||
type FakeFederation struct {
|
||||
*core.Fake
|
||||
}
|
||||
|
||||
func (c *FakeFederation) Clusters() internalversion.ClusterInterface {
|
||||
return &FakeClusters{c}
|
||||
}
|
||||
|
||||
// RESTClient returns a RESTClient that is used to communicate
|
||||
// with API server by this client implementation.
|
||||
func (c *FakeFederation) RESTClient() restclient.Interface {
|
||||
var ret *restclient.RESTClient
|
||||
return ret
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue