This commit is contained in:
Jim Minter 2020-06-01 13:51:05 -05:00
Родитель 24289036c6
Коммит 4e9f661d1c
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 0730CBDA10D1A2D3
11 изменённых файлов: 916 добавлений и 1 удалений

7
Gopkg.lock сгенерированный
Просмотреть файл

@ -1116,11 +1116,14 @@
[[projects]]
branch = "master"
digest = "1:427e681e339e4f80cf1dd96f7e285f285b43fb52944a2672aeb9cb9e441c6671"
digest = "1:104cff75e431cc7578b2477bcf0ffacb7b08df5c80dee1799f73dd9f745428ba"
name = "github.com/openshift/machine-api-operator"
packages = [
"pkg/apis/machine",
"pkg/apis/machine/v1beta1",
"pkg/generated/clientset/versioned",
"pkg/generated/clientset/versioned/scheme",
"pkg/generated/clientset/versioned/typed/machine/v1beta1",
]
pruneopts = "UT"
revision = "a3345f5a437a8ca82be683c7c38fe49de64c2b5f"
@ -2014,6 +2017,7 @@
"github.com/openshift/installer/pkg/types/azure",
"github.com/openshift/installer/pkg/types/openstack/validation",
"github.com/openshift/installer/pkg/types/validation",
"github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned",
"github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1",
"github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned",
"github.com/openshift/machine-config-operator/pkg/generated/clientset/versioned/fake",
@ -2052,6 +2056,7 @@
"k8s.io/client-go/tools/clientcmd",
"k8s.io/client-go/tools/clientcmd/api/v1",
"k8s.io/client-go/tools/metrics",
"k8s.io/client-go/util/flowcontrol",
"k8s.io/client-go/util/retry",
]
solver-name = "gps-cdcl"

97
vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/clientset.go сгенерированный поставляемый Normal file
Просмотреть файл

@ -0,0 +1,97 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
package versioned
import (
"fmt"
machinev1beta1 "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/typed/machine/v1beta1"
discovery "k8s.io/client-go/discovery"
rest "k8s.io/client-go/rest"
flowcontrol "k8s.io/client-go/util/flowcontrol"
)
type Interface interface {
Discovery() discovery.DiscoveryInterface
MachineV1beta1() machinev1beta1.MachineV1beta1Interface
}
// Clientset contains the clients for groups. Each group has exactly one
// version included in a Clientset.
type Clientset struct {
*discovery.DiscoveryClient
machineV1beta1 *machinev1beta1.MachineV1beta1Client
}
// MachineV1beta1 retrieves the MachineV1beta1Client
func (c *Clientset) MachineV1beta1() machinev1beta1.MachineV1beta1Interface {
return c.machineV1beta1
}
// Discovery retrieves the DiscoveryClient
func (c *Clientset) Discovery() discovery.DiscoveryInterface {
if c == nil {
return nil
}
return c.DiscoveryClient
}
// NewForConfig creates a new Clientset for the given config.
// If config's RateLimiter is not set and QPS and Burst are acceptable,
// NewForConfig will generate a rate-limiter in configShallowCopy.
func NewForConfig(c *rest.Config) (*Clientset, error) {
configShallowCopy := *c
if configShallowCopy.RateLimiter == nil && configShallowCopy.QPS > 0 {
if configShallowCopy.Burst <= 0 {
return nil, fmt.Errorf("Burst is required to be greater than 0 when RateLimiter is not set and QPS is set to greater than 0")
}
configShallowCopy.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(configShallowCopy.QPS, configShallowCopy.Burst)
}
var cs Clientset
var err error
cs.machineV1beta1, err = machinev1beta1.NewForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfig(&configShallowCopy)
if err != nil {
return nil, err
}
return &cs, nil
}
// NewForConfigOrDie creates a new Clientset for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *Clientset {
var cs Clientset
cs.machineV1beta1 = machinev1beta1.NewForConfigOrDie(c)
cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c)
return &cs
}
// New creates a new Clientset for the given RESTClient.
func New(c rest.Interface) *Clientset {
var cs Clientset
cs.machineV1beta1 = machinev1beta1.New(c)
cs.DiscoveryClient = discovery.NewDiscoveryClient(c)
return &cs
}

20
vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/doc.go сгенерированный поставляемый Normal file
Просмотреть файл

@ -0,0 +1,20 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated clientset.
package versioned

20
vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme/doc.go сгенерированный поставляемый Normal file
Просмотреть файл

@ -0,0 +1,20 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
// This package contains the scheme of the automatically generated clientset.
package scheme

56
vendor/github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme/register.go сгенерированный поставляемый Normal file
Просмотреть файл

@ -0,0 +1,56 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
package scheme
import (
machinev1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
schema "k8s.io/apimachinery/pkg/runtime/schema"
serializer "k8s.io/apimachinery/pkg/runtime/serializer"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
)
var Scheme = runtime.NewScheme()
var Codecs = serializer.NewCodecFactory(Scheme)
var ParameterCodec = runtime.NewParameterCodec(Scheme)
var localSchemeBuilder = runtime.SchemeBuilder{
machinev1beta1.AddToScheme,
}
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
// of clientsets, like in:
//
// import (
// "k8s.io/client-go/kubernetes"
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
// )
//
// kclientset, _ := kubernetes.NewForConfig(c)
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
//
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
// correctly.
var AddToScheme = localSchemeBuilder.AddToScheme
func init() {
v1.AddToGroupVersion(Scheme, schema.GroupVersion{Version: "v1"})
utilruntime.Must(AddToScheme(Scheme))
}

Просмотреть файл

@ -0,0 +1,20 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
// This package has the automatically generated typed clients.
package v1beta1

Просмотреть файл

@ -0,0 +1,25 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
type MachineExpansion interface{}
type MachineHealthCheckExpansion interface{}
type MachineSetExpansion interface{}

Просмотреть файл

@ -0,0 +1,191 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"time"
v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
scheme "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// MachinesGetter has a method to return a MachineInterface.
// A group's client should implement this interface.
type MachinesGetter interface {
Machines(namespace string) MachineInterface
}
// MachineInterface has methods to work with Machine resources.
type MachineInterface interface {
Create(*v1beta1.Machine) (*v1beta1.Machine, error)
Update(*v1beta1.Machine) (*v1beta1.Machine, error)
UpdateStatus(*v1beta1.Machine) (*v1beta1.Machine, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1beta1.Machine, error)
List(opts v1.ListOptions) (*v1beta1.MachineList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Machine, err error)
MachineExpansion
}
// machines implements MachineInterface
type machines struct {
client rest.Interface
ns string
}
// newMachines returns a Machines
func newMachines(c *MachineV1beta1Client, namespace string) *machines {
return &machines{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any.
func (c *machines) Get(name string, options v1.GetOptions) (result *v1beta1.Machine, err error) {
result = &v1beta1.Machine{}
err = c.client.Get().
Namespace(c.ns).
Resource("machines").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of Machines that match those selectors.
func (c *machines) List(opts v1.ListOptions) (result *v1beta1.MachineList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.MachineList{}
err = c.client.Get().
Namespace(c.ns).
Resource("machines").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested machines.
func (c *machines) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("machines").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a machine and creates it. Returns the server's representation of the machine, and an error, if there is any.
func (c *machines) Create(machine *v1beta1.Machine) (result *v1beta1.Machine, err error) {
result = &v1beta1.Machine{}
err = c.client.Post().
Namespace(c.ns).
Resource("machines").
Body(machine).
Do().
Into(result)
return
}
// Update takes the representation of a machine and updates it. Returns the server's representation of the machine, and an error, if there is any.
func (c *machines) Update(machine *v1beta1.Machine) (result *v1beta1.Machine, err error) {
result = &v1beta1.Machine{}
err = c.client.Put().
Namespace(c.ns).
Resource("machines").
Name(machine.Name).
Body(machine).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *machines) UpdateStatus(machine *v1beta1.Machine) (result *v1beta1.Machine, err error) {
result = &v1beta1.Machine{}
err = c.client.Put().
Namespace(c.ns).
Resource("machines").
Name(machine.Name).
SubResource("status").
Body(machine).
Do().
Into(result)
return
}
// Delete takes name of the machine and deletes it. Returns an error if one occurs.
func (c *machines) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("machines").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *machines) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("machines").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched machine.
func (c *machines) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Machine, err error) {
result = &v1beta1.Machine{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("machines").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

Просмотреть файл

@ -0,0 +1,99 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
"github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme"
rest "k8s.io/client-go/rest"
)
type MachineV1beta1Interface interface {
RESTClient() rest.Interface
MachinesGetter
MachineHealthChecksGetter
MachineSetsGetter
}
// MachineV1beta1Client is used to interact with features provided by the machine.openshift.io group.
type MachineV1beta1Client struct {
restClient rest.Interface
}
func (c *MachineV1beta1Client) Machines(namespace string) MachineInterface {
return newMachines(c, namespace)
}
func (c *MachineV1beta1Client) MachineHealthChecks(namespace string) MachineHealthCheckInterface {
return newMachineHealthChecks(c, namespace)
}
func (c *MachineV1beta1Client) MachineSets(namespace string) MachineSetInterface {
return newMachineSets(c, namespace)
}
// NewForConfig creates a new MachineV1beta1Client for the given config.
func NewForConfig(c *rest.Config) (*MachineV1beta1Client, error) {
config := *c
if err := setConfigDefaults(&config); err != nil {
return nil, err
}
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &MachineV1beta1Client{client}, nil
}
// NewForConfigOrDie creates a new MachineV1beta1Client for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) *MachineV1beta1Client {
client, err := NewForConfig(c)
if err != nil {
panic(err)
}
return client
}
// New creates a new MachineV1beta1Client for the given RESTClient.
func New(c rest.Interface) *MachineV1beta1Client {
return &MachineV1beta1Client{c}
}
func setConfigDefaults(config *rest.Config) error {
gv := v1beta1.SchemeGroupVersion
config.GroupVersion = &gv
config.APIPath = "/apis"
config.NegotiatedSerializer = scheme.Codecs.WithoutConversion()
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}
return nil
}
// RESTClient returns a RESTClient that is used to communicate
// with API server by this client implementation.
func (c *MachineV1beta1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}

Просмотреть файл

@ -0,0 +1,191 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"time"
v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
scheme "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// MachineHealthChecksGetter has a method to return a MachineHealthCheckInterface.
// A group's client should implement this interface.
type MachineHealthChecksGetter interface {
MachineHealthChecks(namespace string) MachineHealthCheckInterface
}
// MachineHealthCheckInterface has methods to work with MachineHealthCheck resources.
type MachineHealthCheckInterface interface {
Create(*v1beta1.MachineHealthCheck) (*v1beta1.MachineHealthCheck, error)
Update(*v1beta1.MachineHealthCheck) (*v1beta1.MachineHealthCheck, error)
UpdateStatus(*v1beta1.MachineHealthCheck) (*v1beta1.MachineHealthCheck, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1beta1.MachineHealthCheck, error)
List(opts v1.ListOptions) (*v1beta1.MachineHealthCheckList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineHealthCheck, err error)
MachineHealthCheckExpansion
}
// machineHealthChecks implements MachineHealthCheckInterface
type machineHealthChecks struct {
client rest.Interface
ns string
}
// newMachineHealthChecks returns a MachineHealthChecks
func newMachineHealthChecks(c *MachineV1beta1Client, namespace string) *machineHealthChecks {
return &machineHealthChecks{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the machineHealthCheck, and returns the corresponding machineHealthCheck object, and an error if there is any.
func (c *machineHealthChecks) Get(name string, options v1.GetOptions) (result *v1beta1.MachineHealthCheck, err error) {
result = &v1beta1.MachineHealthCheck{}
err = c.client.Get().
Namespace(c.ns).
Resource("machinehealthchecks").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of MachineHealthChecks that match those selectors.
func (c *machineHealthChecks) List(opts v1.ListOptions) (result *v1beta1.MachineHealthCheckList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.MachineHealthCheckList{}
err = c.client.Get().
Namespace(c.ns).
Resource("machinehealthchecks").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested machineHealthChecks.
func (c *machineHealthChecks) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("machinehealthchecks").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a machineHealthCheck and creates it. Returns the server's representation of the machineHealthCheck, and an error, if there is any.
func (c *machineHealthChecks) Create(machineHealthCheck *v1beta1.MachineHealthCheck) (result *v1beta1.MachineHealthCheck, err error) {
result = &v1beta1.MachineHealthCheck{}
err = c.client.Post().
Namespace(c.ns).
Resource("machinehealthchecks").
Body(machineHealthCheck).
Do().
Into(result)
return
}
// Update takes the representation of a machineHealthCheck and updates it. Returns the server's representation of the machineHealthCheck, and an error, if there is any.
func (c *machineHealthChecks) Update(machineHealthCheck *v1beta1.MachineHealthCheck) (result *v1beta1.MachineHealthCheck, err error) {
result = &v1beta1.MachineHealthCheck{}
err = c.client.Put().
Namespace(c.ns).
Resource("machinehealthchecks").
Name(machineHealthCheck.Name).
Body(machineHealthCheck).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *machineHealthChecks) UpdateStatus(machineHealthCheck *v1beta1.MachineHealthCheck) (result *v1beta1.MachineHealthCheck, err error) {
result = &v1beta1.MachineHealthCheck{}
err = c.client.Put().
Namespace(c.ns).
Resource("machinehealthchecks").
Name(machineHealthCheck.Name).
SubResource("status").
Body(machineHealthCheck).
Do().
Into(result)
return
}
// Delete takes name of the machineHealthCheck and deletes it. Returns an error if one occurs.
func (c *machineHealthChecks) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("machinehealthchecks").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *machineHealthChecks) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("machinehealthchecks").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched machineHealthCheck.
func (c *machineHealthChecks) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineHealthCheck, err error) {
result = &v1beta1.MachineHealthCheck{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("machinehealthchecks").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}

Просмотреть файл

@ -0,0 +1,191 @@
/*
* 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.
*
* Copyright 2019 Red Hat, Inc.
*
*/
// Code generated by client-gen. DO NOT EDIT.
package v1beta1
import (
"time"
v1beta1 "github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1"
scheme "github.com/openshift/machine-api-operator/pkg/generated/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// MachineSetsGetter has a method to return a MachineSetInterface.
// A group's client should implement this interface.
type MachineSetsGetter interface {
MachineSets(namespace string) MachineSetInterface
}
// MachineSetInterface has methods to work with MachineSet resources.
type MachineSetInterface interface {
Create(*v1beta1.MachineSet) (*v1beta1.MachineSet, error)
Update(*v1beta1.MachineSet) (*v1beta1.MachineSet, error)
UpdateStatus(*v1beta1.MachineSet) (*v1beta1.MachineSet, error)
Delete(name string, options *v1.DeleteOptions) error
DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error
Get(name string, options v1.GetOptions) (*v1beta1.MachineSet, error)
List(opts v1.ListOptions) (*v1beta1.MachineSetList, error)
Watch(opts v1.ListOptions) (watch.Interface, error)
Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineSet, err error)
MachineSetExpansion
}
// machineSets implements MachineSetInterface
type machineSets struct {
client rest.Interface
ns string
}
// newMachineSets returns a MachineSets
func newMachineSets(c *MachineV1beta1Client, namespace string) *machineSets {
return &machineSets{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the machineSet, and returns the corresponding machineSet object, and an error if there is any.
func (c *machineSets) Get(name string, options v1.GetOptions) (result *v1beta1.MachineSet, err error) {
result = &v1beta1.MachineSet{}
err = c.client.Get().
Namespace(c.ns).
Resource("machinesets").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do().
Into(result)
return
}
// List takes label and field selectors, and returns the list of MachineSets that match those selectors.
func (c *machineSets) List(opts v1.ListOptions) (result *v1beta1.MachineSetList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1beta1.MachineSetList{}
err = c.client.Get().
Namespace(c.ns).
Resource("machinesets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do().
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested machineSets.
func (c *machineSets) Watch(opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("machinesets").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch()
}
// Create takes the representation of a machineSet and creates it. Returns the server's representation of the machineSet, and an error, if there is any.
func (c *machineSets) Create(machineSet *v1beta1.MachineSet) (result *v1beta1.MachineSet, err error) {
result = &v1beta1.MachineSet{}
err = c.client.Post().
Namespace(c.ns).
Resource("machinesets").
Body(machineSet).
Do().
Into(result)
return
}
// Update takes the representation of a machineSet and updates it. Returns the server's representation of the machineSet, and an error, if there is any.
func (c *machineSets) Update(machineSet *v1beta1.MachineSet) (result *v1beta1.MachineSet, err error) {
result = &v1beta1.MachineSet{}
err = c.client.Put().
Namespace(c.ns).
Resource("machinesets").
Name(machineSet.Name).
Body(machineSet).
Do().
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *machineSets) UpdateStatus(machineSet *v1beta1.MachineSet) (result *v1beta1.MachineSet, err error) {
result = &v1beta1.MachineSet{}
err = c.client.Put().
Namespace(c.ns).
Resource("machinesets").
Name(machineSet.Name).
SubResource("status").
Body(machineSet).
Do().
Into(result)
return
}
// Delete takes name of the machineSet and deletes it. Returns an error if one occurs.
func (c *machineSets) Delete(name string, options *v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("machinesets").
Name(name).
Body(options).
Do().
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *machineSets) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
var timeout time.Duration
if listOptions.TimeoutSeconds != nil {
timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("machinesets").
VersionedParams(&listOptions, scheme.ParameterCodec).
Timeout(timeout).
Body(options).
Do().
Error()
}
// Patch applies the patch and returns the patched machineSet.
func (c *machineSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.MachineSet, err error) {
result = &v1beta1.MachineSet{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("machinesets").
SubResource(subresources...).
Name(name).
Body(data).
Do().
Into(result)
return
}