1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-05 08:50:13 +00:00

vendor update

This commit is contained in:
moelsayed
2019-06-25 22:12:30 +02:00
committed by Alena Prokharchyk
parent 2c907f9f21
commit 68479ed271
10 changed files with 732 additions and 7 deletions

View File

@@ -167,10 +167,10 @@ type GoogleOauthConfig struct {
metav1.ObjectMeta `json:"metadata,omitempty"`
AuthConfig `json:",inline" mapstructure:",squash"`
OauthCredential string `json:"oauthCredential,omitempty" norman:"required,type=password"`
ServiceAccountCredential string `json:"serviceAccountCredential,omitempty" norman:"required,type=password"`
AdminEmail string `json:"adminEmail,omitempty"`
Hostname string `json:"hostname,omitempty" norman:"required,noupdate"`
OauthCredential string `json:"oauthCredential,omitempty" norman:"required,type=password,notnullable"`
ServiceAccountCredential string `json:"serviceAccountCredential,omitempty" norman:"required,type=password,notnullable"`
AdminEmail string `json:"adminEmail,omitempty" norman:"required,notnullable"`
Hostname string `json:"hostname,omitempty" norman:"required,notnullable,noupdate"`
UserInfoEndpoint string `json:"userInfoEndpoint" norman:"default=https://openidconnect.googleapis.com/v1/userinfo,required,notnullable"`
}

View File

@@ -35,8 +35,8 @@ type S3BackupConfig struct {
Region string `yaml:"region" json:"region,omitempty"`
// Endpoint is used if this is not an AWS API
Endpoint string `yaml:"endpoint" json:"endpoint"`
// EndpointCA is used to connect to custom s3 endpoints
EndpointCA string `yaml:"endpoint_ca" json:"endpointCa,omitempty"`
// CustomCA is used to connect to custom s3 endpoints
CustomCA string `yaml:"custom_ca" json:"customCa,omitempty"`
}
type EtcdBackup struct {
types.Namespaced

View File

@@ -0,0 +1,56 @@
package v3
import (
"github.com/rancher/norman/condition"
"github.com/rancher/norman/types"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
ClusterScanConditionCreated condition.Cond = "Created"
ClusterScanConditionCompleted condition.Cond = "Completed"
)
type ClusterScanConfig struct {
}
type ClusterScanCondition struct {
// Type of condition.
Type string `json:"type"`
// Status of the condition, one of True, False, Unknown.
Status v1.ConditionStatus `json:"status"`
// The last time this condition was updated.
LastUpdateTime string `json:"lastUpdateTime,omitempty"`
// Last time the condition transitioned from one status to another.
LastTransitionTime string `json:"lastTransitionTime,omitempty"`
// The reason for the condition's last transition.
Reason string `json:"reason,omitempty"`
// Human-readable message indicating details about last transition
Message string `json:"message,omitempty"`
}
type ClusterScanSpec struct {
ScanType string `json:"scanType"`
// cluster ID
ClusterID string `json:"clusterId,omitempty" norman:"required,type=reference[cluster]"`
// manual flag
Manual bool `yaml:"manual" json:"manual,omitempty"`
// scanConfig
ScanConfig ClusterScanConfig `yaml:",omitempty" json:"scanConfig,omitempty"`
}
type ClusterScanStatus struct {
Conditions []ClusterScanCondition `json:"conditions"`
}
type ClusterScan struct {
types.Namespaced
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterScanSpec `json:"spec"`
Status ClusterScanStatus `yaml:"status" json:"status,omitempty"`
}

View File

@@ -30,6 +30,7 @@ const (
ClusterActionBackupEtcd = "backupEtcd"
ClusterActionRestoreFromEtcdBackup = "restoreFromEtcdBackup"
ClusterActionRotateCertificates = "rotateCertificates"
ClusterActionRunCISScan = "runSecurityScan"
// ClusterConditionReady Cluster ready to serve API (healthy when true, unhealthy when false)
ClusterConditionReady condition.Cond = "Ready"

View File

@@ -0,0 +1,452 @@
package v3
import (
"context"
"github.com/rancher/norman/controller"
"github.com/rancher/norman/objectclient"
"github.com/rancher/norman/resource"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/tools/cache"
)
var (
ClusterScanGroupVersionKind = schema.GroupVersionKind{
Version: Version,
Group: GroupName,
Kind: "ClusterScan",
}
ClusterScanResource = metav1.APIResource{
Name: "clusterscans",
SingularName: "clusterscan",
Namespaced: true,
Kind: ClusterScanGroupVersionKind.Kind,
}
ClusterScanGroupVersionResource = schema.GroupVersionResource{
Group: GroupName,
Version: Version,
Resource: "clusterscans",
}
)
func init() {
resource.Put(ClusterScanGroupVersionResource)
}
func NewClusterScan(namespace, name string, obj ClusterScan) *ClusterScan {
obj.APIVersion, obj.Kind = ClusterScanGroupVersionKind.ToAPIVersionAndKind()
obj.Name = name
obj.Namespace = namespace
return &obj
}
type ClusterScanList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []ClusterScan `json:"items"`
}
type ClusterScanHandlerFunc func(key string, obj *ClusterScan) (runtime.Object, error)
type ClusterScanChangeHandlerFunc func(obj *ClusterScan) (runtime.Object, error)
type ClusterScanLister interface {
List(namespace string, selector labels.Selector) (ret []*ClusterScan, err error)
Get(namespace, name string) (*ClusterScan, error)
}
type ClusterScanController interface {
Generic() controller.GenericController
Informer() cache.SharedIndexInformer
Lister() ClusterScanLister
AddHandler(ctx context.Context, name string, handler ClusterScanHandlerFunc)
AddClusterScopedHandler(ctx context.Context, name, clusterName string, handler ClusterScanHandlerFunc)
Enqueue(namespace, name string)
Sync(ctx context.Context) error
Start(ctx context.Context, threadiness int) error
}
type ClusterScanInterface interface {
ObjectClient() *objectclient.ObjectClient
Create(*ClusterScan) (*ClusterScan, error)
GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterScan, error)
Get(name string, opts metav1.GetOptions) (*ClusterScan, error)
Update(*ClusterScan) (*ClusterScan, error)
Delete(name string, options *metav1.DeleteOptions) error
DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error
List(opts metav1.ListOptions) (*ClusterScanList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error
Controller() ClusterScanController
AddHandler(ctx context.Context, name string, sync ClusterScanHandlerFunc)
AddLifecycle(ctx context.Context, name string, lifecycle ClusterScanLifecycle)
AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterScanHandlerFunc)
AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterScanLifecycle)
}
type clusterScanLister struct {
controller *clusterScanController
}
func (l *clusterScanLister) List(namespace string, selector labels.Selector) (ret []*ClusterScan, err error) {
err = cache.ListAllByNamespace(l.controller.Informer().GetIndexer(), namespace, selector, func(obj interface{}) {
ret = append(ret, obj.(*ClusterScan))
})
return
}
func (l *clusterScanLister) Get(namespace, name string) (*ClusterScan, error) {
var key string
if namespace != "" {
key = namespace + "/" + name
} else {
key = name
}
obj, exists, err := l.controller.Informer().GetIndexer().GetByKey(key)
if err != nil {
return nil, err
}
if !exists {
return nil, errors.NewNotFound(schema.GroupResource{
Group: ClusterScanGroupVersionKind.Group,
Resource: "clusterScan",
}, key)
}
return obj.(*ClusterScan), nil
}
type clusterScanController struct {
controller.GenericController
}
func (c *clusterScanController) Generic() controller.GenericController {
return c.GenericController
}
func (c *clusterScanController) Lister() ClusterScanLister {
return &clusterScanLister{
controller: c,
}
}
func (c *clusterScanController) AddHandler(ctx context.Context, name string, handler ClusterScanHandlerFunc) {
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if obj == nil {
return handler(key, nil)
} else if v, ok := obj.(*ClusterScan); ok {
return handler(key, v)
} else {
return nil, nil
}
})
}
func (c *clusterScanController) AddClusterScopedHandler(ctx context.Context, name, cluster string, handler ClusterScanHandlerFunc) {
resource.PutClusterScoped(ClusterScanGroupVersionResource)
c.GenericController.AddHandler(ctx, name, func(key string, obj interface{}) (interface{}, error) {
if obj == nil {
return handler(key, nil)
} else if v, ok := obj.(*ClusterScan); ok && controller.ObjectInCluster(cluster, obj) {
return handler(key, v)
} else {
return nil, nil
}
})
}
type clusterScanFactory struct {
}
func (c clusterScanFactory) Object() runtime.Object {
return &ClusterScan{}
}
func (c clusterScanFactory) List() runtime.Object {
return &ClusterScanList{}
}
func (s *clusterScanClient) Controller() ClusterScanController {
s.client.Lock()
defer s.client.Unlock()
c, ok := s.client.clusterScanControllers[s.ns]
if ok {
return c
}
genericController := controller.NewGenericController(ClusterScanGroupVersionKind.Kind+"Controller",
s.objectClient)
c = &clusterScanController{
GenericController: genericController,
}
s.client.clusterScanControllers[s.ns] = c
s.client.starters = append(s.client.starters, c)
return c
}
type clusterScanClient struct {
client *Client
ns string
objectClient *objectclient.ObjectClient
controller ClusterScanController
}
func (s *clusterScanClient) ObjectClient() *objectclient.ObjectClient {
return s.objectClient
}
func (s *clusterScanClient) Create(o *ClusterScan) (*ClusterScan, error) {
obj, err := s.objectClient.Create(o)
return obj.(*ClusterScan), err
}
func (s *clusterScanClient) Get(name string, opts metav1.GetOptions) (*ClusterScan, error) {
obj, err := s.objectClient.Get(name, opts)
return obj.(*ClusterScan), err
}
func (s *clusterScanClient) GetNamespaced(namespace, name string, opts metav1.GetOptions) (*ClusterScan, error) {
obj, err := s.objectClient.GetNamespaced(namespace, name, opts)
return obj.(*ClusterScan), err
}
func (s *clusterScanClient) Update(o *ClusterScan) (*ClusterScan, error) {
obj, err := s.objectClient.Update(o.Name, o)
return obj.(*ClusterScan), err
}
func (s *clusterScanClient) Delete(name string, options *metav1.DeleteOptions) error {
return s.objectClient.Delete(name, options)
}
func (s *clusterScanClient) DeleteNamespaced(namespace, name string, options *metav1.DeleteOptions) error {
return s.objectClient.DeleteNamespaced(namespace, name, options)
}
func (s *clusterScanClient) List(opts metav1.ListOptions) (*ClusterScanList, error) {
obj, err := s.objectClient.List(opts)
return obj.(*ClusterScanList), err
}
func (s *clusterScanClient) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return s.objectClient.Watch(opts)
}
// Patch applies the patch and returns the patched deployment.
func (s *clusterScanClient) Patch(o *ClusterScan, patchType types.PatchType, data []byte, subresources ...string) (*ClusterScan, error) {
obj, err := s.objectClient.Patch(o.Name, o, patchType, data, subresources...)
return obj.(*ClusterScan), err
}
func (s *clusterScanClient) DeleteCollection(deleteOpts *metav1.DeleteOptions, listOpts metav1.ListOptions) error {
return s.objectClient.DeleteCollection(deleteOpts, listOpts)
}
func (s *clusterScanClient) AddHandler(ctx context.Context, name string, sync ClusterScanHandlerFunc) {
s.Controller().AddHandler(ctx, name, sync)
}
func (s *clusterScanClient) AddLifecycle(ctx context.Context, name string, lifecycle ClusterScanLifecycle) {
sync := NewClusterScanLifecycleAdapter(name, false, s, lifecycle)
s.Controller().AddHandler(ctx, name, sync)
}
func (s *clusterScanClient) AddClusterScopedHandler(ctx context.Context, name, clusterName string, sync ClusterScanHandlerFunc) {
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
}
func (s *clusterScanClient) AddClusterScopedLifecycle(ctx context.Context, name, clusterName string, lifecycle ClusterScanLifecycle) {
sync := NewClusterScanLifecycleAdapter(name+"_"+clusterName, true, s, lifecycle)
s.Controller().AddClusterScopedHandler(ctx, name, clusterName, sync)
}
type ClusterScanIndexer func(obj *ClusterScan) ([]string, error)
type ClusterScanClientCache interface {
Get(namespace, name string) (*ClusterScan, error)
List(namespace string, selector labels.Selector) ([]*ClusterScan, error)
Index(name string, indexer ClusterScanIndexer)
GetIndexed(name, key string) ([]*ClusterScan, error)
}
type ClusterScanClient interface {
Create(*ClusterScan) (*ClusterScan, error)
Get(namespace, name string, opts metav1.GetOptions) (*ClusterScan, error)
Update(*ClusterScan) (*ClusterScan, error)
Delete(namespace, name string, options *metav1.DeleteOptions) error
List(namespace string, opts metav1.ListOptions) (*ClusterScanList, error)
Watch(opts metav1.ListOptions) (watch.Interface, error)
Cache() ClusterScanClientCache
OnCreate(ctx context.Context, name string, sync ClusterScanChangeHandlerFunc)
OnChange(ctx context.Context, name string, sync ClusterScanChangeHandlerFunc)
OnRemove(ctx context.Context, name string, sync ClusterScanChangeHandlerFunc)
Enqueue(namespace, name string)
Generic() controller.GenericController
ObjectClient() *objectclient.ObjectClient
Interface() ClusterScanInterface
}
type clusterScanClientCache struct {
client *clusterScanClient2
}
type clusterScanClient2 struct {
iface ClusterScanInterface
controller ClusterScanController
}
func (n *clusterScanClient2) Interface() ClusterScanInterface {
return n.iface
}
func (n *clusterScanClient2) Generic() controller.GenericController {
return n.iface.Controller().Generic()
}
func (n *clusterScanClient2) ObjectClient() *objectclient.ObjectClient {
return n.Interface().ObjectClient()
}
func (n *clusterScanClient2) Enqueue(namespace, name string) {
n.iface.Controller().Enqueue(namespace, name)
}
func (n *clusterScanClient2) Create(obj *ClusterScan) (*ClusterScan, error) {
return n.iface.Create(obj)
}
func (n *clusterScanClient2) Get(namespace, name string, opts metav1.GetOptions) (*ClusterScan, error) {
return n.iface.GetNamespaced(namespace, name, opts)
}
func (n *clusterScanClient2) Update(obj *ClusterScan) (*ClusterScan, error) {
return n.iface.Update(obj)
}
func (n *clusterScanClient2) Delete(namespace, name string, options *metav1.DeleteOptions) error {
return n.iface.DeleteNamespaced(namespace, name, options)
}
func (n *clusterScanClient2) List(namespace string, opts metav1.ListOptions) (*ClusterScanList, error) {
return n.iface.List(opts)
}
func (n *clusterScanClient2) Watch(opts metav1.ListOptions) (watch.Interface, error) {
return n.iface.Watch(opts)
}
func (n *clusterScanClientCache) Get(namespace, name string) (*ClusterScan, error) {
return n.client.controller.Lister().Get(namespace, name)
}
func (n *clusterScanClientCache) List(namespace string, selector labels.Selector) ([]*ClusterScan, error) {
return n.client.controller.Lister().List(namespace, selector)
}
func (n *clusterScanClient2) Cache() ClusterScanClientCache {
n.loadController()
return &clusterScanClientCache{
client: n,
}
}
func (n *clusterScanClient2) OnCreate(ctx context.Context, name string, sync ClusterScanChangeHandlerFunc) {
n.loadController()
n.iface.AddLifecycle(ctx, name+"-create", &clusterScanLifecycleDelegate{create: sync})
}
func (n *clusterScanClient2) OnChange(ctx context.Context, name string, sync ClusterScanChangeHandlerFunc) {
n.loadController()
n.iface.AddLifecycle(ctx, name+"-change", &clusterScanLifecycleDelegate{update: sync})
}
func (n *clusterScanClient2) OnRemove(ctx context.Context, name string, sync ClusterScanChangeHandlerFunc) {
n.loadController()
n.iface.AddLifecycle(ctx, name, &clusterScanLifecycleDelegate{remove: sync})
}
func (n *clusterScanClientCache) Index(name string, indexer ClusterScanIndexer) {
err := n.client.controller.Informer().GetIndexer().AddIndexers(map[string]cache.IndexFunc{
name: func(obj interface{}) ([]string, error) {
if v, ok := obj.(*ClusterScan); ok {
return indexer(v)
}
return nil, nil
},
})
if err != nil {
panic(err)
}
}
func (n *clusterScanClientCache) GetIndexed(name, key string) ([]*ClusterScan, error) {
var result []*ClusterScan
objs, err := n.client.controller.Informer().GetIndexer().ByIndex(name, key)
if err != nil {
return nil, err
}
for _, obj := range objs {
if v, ok := obj.(*ClusterScan); ok {
result = append(result, v)
}
}
return result, nil
}
func (n *clusterScanClient2) loadController() {
if n.controller == nil {
n.controller = n.iface.Controller()
}
}
type clusterScanLifecycleDelegate struct {
create ClusterScanChangeHandlerFunc
update ClusterScanChangeHandlerFunc
remove ClusterScanChangeHandlerFunc
}
func (n *clusterScanLifecycleDelegate) HasCreate() bool {
return n.create != nil
}
func (n *clusterScanLifecycleDelegate) Create(obj *ClusterScan) (runtime.Object, error) {
if n.create == nil {
return obj, nil
}
return n.create(obj)
}
func (n *clusterScanLifecycleDelegate) HasFinalize() bool {
return n.remove != nil
}
func (n *clusterScanLifecycleDelegate) Remove(obj *ClusterScan) (runtime.Object, error) {
if n.remove == nil {
return obj, nil
}
return n.remove(obj)
}
func (n *clusterScanLifecycleDelegate) Updated(obj *ClusterScan) (runtime.Object, error) {
if n.update == nil {
return obj, nil
}
return n.update(obj)
}

View File

@@ -0,0 +1,62 @@
package v3
import (
"github.com/rancher/norman/lifecycle"
"k8s.io/apimachinery/pkg/runtime"
)
type ClusterScanLifecycle interface {
Create(obj *ClusterScan) (runtime.Object, error)
Remove(obj *ClusterScan) (runtime.Object, error)
Updated(obj *ClusterScan) (runtime.Object, error)
}
type clusterScanLifecycleAdapter struct {
lifecycle ClusterScanLifecycle
}
func (w *clusterScanLifecycleAdapter) HasCreate() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasCreate()
}
func (w *clusterScanLifecycleAdapter) HasFinalize() bool {
o, ok := w.lifecycle.(lifecycle.ObjectLifecycleCondition)
return !ok || o.HasFinalize()
}
func (w *clusterScanLifecycleAdapter) Create(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Create(obj.(*ClusterScan))
if o == nil {
return nil, err
}
return o, err
}
func (w *clusterScanLifecycleAdapter) Finalize(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Remove(obj.(*ClusterScan))
if o == nil {
return nil, err
}
return o, err
}
func (w *clusterScanLifecycleAdapter) Updated(obj runtime.Object) (runtime.Object, error) {
o, err := w.lifecycle.Updated(obj.(*ClusterScan))
if o == nil {
return nil, err
}
return o, err
}
func NewClusterScanLifecycleAdapter(name string, clusterScoped bool, client ClusterScanInterface, l ClusterScanLifecycle) ClusterScanHandlerFunc {
adapter := &clusterScanLifecycleAdapter{lifecycle: l}
syncFn := lifecycle.NewObjectLifecycleAdapter(name, clusterScoped, adapter, client.ObjectClient())
return func(key string, obj *ClusterScan) (runtime.Object, error) {
newObj, err := syncFn(key, obj)
if o, ok := newObj.(runtime.Object); ok {
return o, err
}
return nil, err
}
}

View File

@@ -1794,6 +1794,138 @@ func (in *ClusterRoleTemplateBindingList) DeepCopyObject() runtime.Object {
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterScan) DeepCopyInto(out *ClusterScan) {
*out = *in
out.Namespaced = in.Namespaced
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
out.Spec = in.Spec
in.Status.DeepCopyInto(&out.Status)
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScan.
func (in *ClusterScan) DeepCopy() *ClusterScan {
if in == nil {
return nil
}
out := new(ClusterScan)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterScan) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterScanCondition) DeepCopyInto(out *ClusterScanCondition) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanCondition.
func (in *ClusterScanCondition) DeepCopy() *ClusterScanCondition {
if in == nil {
return nil
}
out := new(ClusterScanCondition)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterScanConfig) DeepCopyInto(out *ClusterScanConfig) {
*out = *in
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanConfig.
func (in *ClusterScanConfig) DeepCopy() *ClusterScanConfig {
if in == nil {
return nil
}
out := new(ClusterScanConfig)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterScanList) DeepCopyInto(out *ClusterScanList) {
*out = *in
out.TypeMeta = in.TypeMeta
out.ListMeta = in.ListMeta
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]ClusterScan, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanList.
func (in *ClusterScanList) DeepCopy() *ClusterScanList {
if in == nil {
return nil
}
out := new(ClusterScanList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *ClusterScanList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterScanSpec) DeepCopyInto(out *ClusterScanSpec) {
*out = *in
out.ScanConfig = in.ScanConfig
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanSpec.
func (in *ClusterScanSpec) DeepCopy() *ClusterScanSpec {
if in == nil {
return nil
}
out := new(ClusterScanSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterScanStatus) DeepCopyInto(out *ClusterScanStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]ClusterScanCondition, len(*in))
copy(*out, *in)
}
return
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClusterScanStatus.
func (in *ClusterScanStatus) DeepCopy() *ClusterScanStatus {
if in == nil {
return nil
}
out := new(ClusterScanStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ClusterSpec) DeepCopyInto(out *ClusterSpec) {
*out = *in

View File

@@ -71,6 +71,7 @@ type Interface interface {
GlobalDNSProvidersGetter
KontainerDriversGetter
EtcdBackupsGetter
ClusterScansGetter
MonitorMetricsGetter
ClusterMonitorGraphsGetter
ProjectMonitorGraphsGetter
@@ -133,6 +134,7 @@ type Clients struct {
GlobalDNSProvider GlobalDNSProviderClient
KontainerDriver KontainerDriverClient
EtcdBackup EtcdBackupClient
ClusterScan ClusterScanClient
MonitorMetric MonitorMetricClient
ClusterMonitorGraph ClusterMonitorGraphClient
ProjectMonitorGraph ProjectMonitorGraphClient
@@ -197,6 +199,7 @@ type Client struct {
globalDnsProviderControllers map[string]GlobalDNSProviderController
kontainerDriverControllers map[string]KontainerDriverController
etcdBackupControllers map[string]EtcdBackupController
clusterScanControllers map[string]ClusterScanController
monitorMetricControllers map[string]MonitorMetricController
clusterMonitorGraphControllers map[string]ClusterMonitorGraphController
projectMonitorGraphControllers map[string]ProjectMonitorGraphController
@@ -391,6 +394,9 @@ func NewClientsFromInterface(iface Interface) *Clients {
EtcdBackup: &etcdBackupClient2{
iface: iface.EtcdBackups(""),
},
ClusterScan: &clusterScanClient2{
iface: iface.ClusterScans(""),
},
MonitorMetric: &monitorMetricClient2{
iface: iface.MonitorMetrics(""),
},
@@ -476,6 +482,7 @@ func NewForConfig(config rest.Config) (Interface, error) {
globalDnsProviderControllers: map[string]GlobalDNSProviderController{},
kontainerDriverControllers: map[string]KontainerDriverController{},
etcdBackupControllers: map[string]EtcdBackupController{},
clusterScanControllers: map[string]ClusterScanController{},
monitorMetricControllers: map[string]MonitorMetricController{},
clusterMonitorGraphControllers: map[string]ClusterMonitorGraphController{},
projectMonitorGraphControllers: map[string]ProjectMonitorGraphController{},
@@ -1160,6 +1167,19 @@ func (c *Client) EtcdBackups(namespace string) EtcdBackupInterface {
}
}
type ClusterScansGetter interface {
ClusterScans(namespace string) ClusterScanInterface
}
func (c *Client) ClusterScans(namespace string) ClusterScanInterface {
objectClient := objectclient.NewObjectClient(namespace, c.restClient, &ClusterScanResource, ClusterScanGroupVersionKind, clusterScanFactory{})
return &clusterScanClient{
ns: namespace,
client: c,
objectClient: objectClient,
}
}
type MonitorMetricsGetter interface {
MonitorMetrics(namespace string) MonitorMetricInterface
}

View File

@@ -135,6 +135,8 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&KontainerDriverList{},
&EtcdBackup{},
&EtcdBackupList{},
&ClusterScan{},
&ClusterScanList{},
&MonitorMetric{},
&MonitorMetricList{},
&ClusterMonitorGraph{},