diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go index 94de69de..8a6ba3c0 100644 --- a/cmd/webhook/main.go +++ b/cmd/webhook/main.go @@ -119,7 +119,7 @@ func run(ctx context.Context, cfg *rest.Config, options *config.Options) error { if err := webhookServer.RegisterValidators( clusternetwork.NewCnValidator(c.vcCache), nad.NewNadValidator(c.vmiCache), - vlanconfig.NewVlanConfigValidator(c.nadCache, c.vcCache, c.vsCache, c.vmiCache), + vlanconfig.NewVlanConfigValidator(c.nadCache, c.vcCache, c.vsCache, c.cnCache, c.vmiCache), ); err != nil { return fmt.Errorf("failed to register validators: %v", err) } diff --git a/go.mod b/go.mod index 50c7b856..bd0022ad 100644 --- a/go.mod +++ b/go.mod @@ -73,6 +73,7 @@ require ( github.com/rancher/lasso v0.0.0-20221227210133-6ea88ca2fbcc github.com/rancher/wrangler v1.1.1 github.com/sirupsen/logrus v1.9.0 + github.com/stretchr/testify v1.8.3 github.com/tidwall/sjson v1.2.5 github.com/urfave/cli v1.22.9 github.com/vishvananda/netlink v1.2.1-beta.2 @@ -144,6 +145,7 @@ require ( github.com/pborman/uuid v1.2.1 // indirect github.com/pierrec/lz4/v4 v4.1.15 // indirect github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.62.0 // indirect github.com/prometheus/client_golang v1.12.2 // indirect github.com/prometheus/client_model v0.3.0 // indirect diff --git a/pkg/utils/fakeclients/clusternetwork.go b/pkg/utils/fakeclients/clusternetwork.go index 68153ffa..39b33d4f 100644 --- a/pkg/utils/fakeclients/clusternetwork.go +++ b/pkg/utils/fakeclients/clusternetwork.go @@ -4,70 +4,85 @@ import ( "context" // "github.com/rancher/wrangler/v3/pkg/generic" - "github.com/rancher/wrangler/pkg/generic" +// "github.com/rancher/wrangler/pkg/generic" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/rest" +// "k8s.io/client-go/rest" "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1" networktype "github.com/harvester/harvester-network-controller/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1beta1" + networkctl "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io/v1beta1" ) -type VlanConfigClient func() networktype.VlanConfigInterface +type ClusterNetworkClient func() networktype.ClusterNetworkInterface -func (c VlanConfigClient) Create(s *v1beta1.VlanConfig) (*v1beta1.VlanConfig, error) { +func (c ClusterNetworkClient) Create(s *v1beta1.ClusterNetwork) (*v1beta1.ClusterNetwork, error) { return c().Create(context.TODO(), s, metav1.CreateOptions{}) } -func (c VlanConfigClient) Update(s *v1beta1.VlanConfig) (*v1beta1.VlanConfig, error) { +func (c ClusterNetworkClient) Update(s *v1beta1.ClusterNetwork) (*v1beta1.ClusterNetwork, error) { return c().Update(context.TODO(), s, metav1.UpdateOptions{}) } -func (c VlanConfigClient) UpdateStatus(_ *v1beta1.VlanConfig) (*v1beta1.VlanConfig, error) { +func (c ClusterNetworkClient) UpdateStatus(_ *v1beta1.ClusterNetwork) (*v1beta1.ClusterNetwork, error) { panic("implement me") } -func (c VlanConfigClient) Delete(name string, options *metav1.DeleteOptions) error { +func (c ClusterNetworkClient) Delete(name string, options *metav1.DeleteOptions) error { return c().Delete(context.TODO(), name, *options) } -func (c VlanConfigClient) Get(name string, options metav1.GetOptions) (*v1beta1.VlanConfig, error) { +func (c ClusterNetworkClient) Get(name string, options metav1.GetOptions) (*v1beta1.ClusterNetwork, error) { return c().Get(context.TODO(), name, options) } -func (c VlanConfigClient) List(opts metav1.ListOptions) (*v1beta1.VlanConfigList, error) { +func (c ClusterNetworkClient) List(opts metav1.ListOptions) (*v1beta1.ClusterNetworkList, error) { return c().List(context.TODO(), opts) } -func (c VlanConfigClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { +func (c ClusterNetworkClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { return c().Watch(context.TODO(), opts) } -func (c VlanConfigClient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VlanConfig, err error) { +func (c ClusterNetworkClient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ClusterNetwork, err error) { return c().Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) } -func (c VlanConfigClient) WithImpersonation(_ rest.ImpersonationConfig) (generic.NonNamespacedClientInterface[*v1beta1.VlanConfig, *v1beta1.VlanConfigList], error) { +/* +func (c ClusterNetworkClient) WithImpersonation(_ rest.ImpersonationConfig) (generic.NonNamespacedClientInterface[*v1beta1.ClusterNetwork, *v1beta1.ClusterNetworkList], error) { panic("implement me") } +*/ -type VlanConfigCache func() networktype.VlanConfigInterface +type ClusterNetworkCache func() networktype.ClusterNetworkInterface -func (c VlanConfigCache) Get(name string) (*v1beta1.VlanConfig, error) { +func (c ClusterNetworkCache) Get(name string) (*v1beta1.ClusterNetwork, error) { return c().Get(context.TODO(), name, metav1.GetOptions{}) } -func (c VlanConfigCache) List(_ labels.Selector) ([]*v1beta1.VlanConfig, error) { - panic("implement me") +func (c ClusterNetworkCache) List(selector labels.Selector) ([]*v1beta1.ClusterNetwork, error) { + list, err := c().List(context.TODO(), metav1.ListOptions{LabelSelector: selector.String()}) + if err != nil { + return nil, err + } + result := make([]*v1beta1.ClusterNetwork, 0, len(list.Items)) + for i := range list.Items { + result = append(result, &list.Items[i]) + } + return result, err } -func (c VlanConfigCache) AddIndexer(_ string, _ generic.Indexer[*v1beta1.VlanConfig]) { + +func (c ClusterNetworkCache) AddIndexer(_ string, _ networkctl.ClusterNetworkIndexer) { panic("implement me") } -func (c VlanConfigCache) GetByIndex(_, _ string) ([]*v1beta1.VlanConfig, error) { +// type ClusterNetworkIndexer func(obj *v1beta1.ClusterNetwork) ([]string, error) + + +func (c ClusterNetworkCache) GetByIndex(_, _ string) ([]*v1beta1.ClusterNetwork, error) { panic("implement me") } diff --git a/pkg/utils/fakeclients/vlanconfig.go b/pkg/utils/fakeclients/vlanconfig.go index baafa0bc..ab9b6a14 100644 --- a/pkg/utils/fakeclients/vlanconfig.go +++ b/pkg/utils/fakeclients/vlanconfig.go @@ -3,16 +3,14 @@ package fakeclients import ( "context" -// "github.com/rancher/wrangler/v3/pkg/generic" - "github.com/rancher/wrangler/pkg/generic" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/rest" "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1" networktype "github.com/harvester/harvester-network-controller/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1beta1" + networkctl "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io/v1beta1" ) type VlanConfigClient func() networktype.VlanConfigInterface @@ -49,9 +47,11 @@ func (c VlanConfigClient) Patch(name string, pt types.PatchType, data []byte, su return c().Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) } +/* func (c VlanConfigClient) WithImpersonation(_ rest.ImpersonationConfig) (generic.NonNamespacedClientInterface[*v1beta1.VlanConfig, *v1beta1.VlanConfigList], error) { panic("implement me") } +*/ type VlanConfigCache func() networktype.VlanConfigInterface @@ -59,11 +59,19 @@ func (c VlanConfigCache) Get(name string) (*v1beta1.VlanConfig, error) { return c().Get(context.TODO(), name, metav1.GetOptions{}) } -func (c VlanConfigCache) List(_ labels.Selector) ([]*v1beta1.VlanConfig, error) { - panic("implement me") +func (c VlanConfigCache) List(selector labels.Selector) ([]*v1beta1.VlanConfig, error) { + list, err := c().List(context.TODO(), metav1.ListOptions{LabelSelector: selector.String()}) + if err != nil { + return nil, err + } + result := make([]*v1beta1.VlanConfig, 0, len(list.Items)) + for i := range list.Items { + result = append(result, &list.Items[i]) + } + return result, err } -func (c VlanConfigCache) AddIndexer(_ string, _ generic.Indexer[*v1beta1.VlanConfig]) { +func (c VlanConfigCache) AddIndexer(_ string, _ networkctl.VlanConfigIndexer) { panic("implement me") } diff --git a/pkg/utils/fakeclients/vlanstatus.go b/pkg/utils/fakeclients/vlanstatus.go new file mode 100644 index 00000000..9ae7fa67 --- /dev/null +++ b/pkg/utils/fakeclients/vlanstatus.go @@ -0,0 +1,82 @@ +package fakeclients + +import ( + "context" + +// "github.com/rancher/wrangler/v3/pkg/generic" +// "github.com/rancher/wrangler/pkg/generic" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" +// "k8s.io/client-go/rest" + + "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1" + networktype "github.com/harvester/harvester-network-controller/pkg/generated/clientset/versioned/typed/network.harvesterhci.io/v1beta1" + networkctl "github.com/harvester/harvester-network-controller/pkg/generated/controllers/network.harvesterhci.io/v1beta1" +) + +type VlanStatusClient func() networktype.VlanStatusInterface + +func (c VlanStatusClient) Create(s *v1beta1.VlanStatus) (*v1beta1.VlanStatus, error) { + return c().Create(context.TODO(), s, metav1.CreateOptions{}) +} + +func (c VlanStatusClient) Update(s *v1beta1.VlanStatus) (*v1beta1.VlanStatus, error) { + return c().Update(context.TODO(), s, metav1.UpdateOptions{}) +} + +func (c VlanStatusClient) UpdateStatus(_ *v1beta1.VlanStatus) (*v1beta1.VlanStatus, error) { + panic("implement me") +} + +func (c VlanStatusClient) Delete(name string, options *metav1.DeleteOptions) error { + return c().Delete(context.TODO(), name, *options) +} + +func (c VlanStatusClient) Get(name string, options metav1.GetOptions) (*v1beta1.VlanStatus, error) { + return c().Get(context.TODO(), name, options) +} + +func (c VlanStatusClient) List(opts metav1.ListOptions) (*v1beta1.VlanStatusList, error) { + return c().List(context.TODO(), opts) +} + +func (c VlanStatusClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return c().Watch(context.TODO(), opts) +} + +func (c VlanStatusClient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VlanStatus, err error) { + return c().Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) +} + +/* +func (c VlanStatusClient) WithImpersonation(_ rest.ImpersonationConfig) (generic.NonNamespacedClientInterface[*v1beta1.VlanStatus, *v1beta1.VlanStatusList], error) { + panic("implement me") +} +*/ +type VlanStatusCache func() networktype.VlanStatusInterface + +func (c VlanStatusCache) Get(name string) (*v1beta1.VlanStatus, error) { + return c().Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c VlanStatusCache) List(selector labels.Selector) ([]*v1beta1.VlanStatus, error) { + list, err := c().List(context.TODO(), metav1.ListOptions{LabelSelector: selector.String()}) + if err != nil { + return nil, err + } + result := make([]*v1beta1.VlanStatus, 0, len(list.Items)) + for i := range list.Items { + result = append(result, &list.Items[i]) + } + return result, err +} + +func (c VlanStatusCache) AddIndexer(_ string, _ networkctl.VlanStatusIndexer) { + panic("implement me") +} + +func (c VlanStatusCache) GetByIndex(_, _ string) ([]*v1beta1.VlanStatus, error) { + panic("implement me") +} diff --git a/pkg/webhook/clusternetwork/validator_test.go b/pkg/webhook/clusternetwork/validator_test.go new file mode 100644 index 00000000..c2bfa9a2 --- /dev/null +++ b/pkg/webhook/clusternetwork/validator_test.go @@ -0,0 +1,182 @@ +package clusternetwork + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + networkv1 "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1" + "github.com/harvester/harvester-network-controller/pkg/generated/clientset/versioned/fake" + "github.com/harvester/harvester-network-controller/pkg/utils" + "github.com/harvester/harvester-network-controller/pkg/utils/fakeclients" +) + +const testCnName = "test-cn" + +func TestCreateClusterNetwork(t *testing.T) { + tests := []struct { + name string + returnErr bool + errKey string + currentCN *networkv1.ClusterNetwork + currentVC *networkv1.VlanConfig + newCN *networkv1.ClusterNetwork + }{ + { + name: "ClusterNetwork name is too long", + returnErr: true, + errKey: "the length of", + newCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: "thisNameIsTooLongToBeAccept", + Annotations: map[string]string{"test": "test"}, + }, + }, + }, + { + name: "ClusterNetwork is ok to create", + returnErr: false, + errKey: "", + newCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + assert.NotNil(t, tc.newCN) + if tc.newCN == nil { + return + } + + nchclientset := fake.NewSimpleClientset() + vcCache := fakeclients.VlanConfigCache(nchclientset.NetworkV1beta1().VlanConfigs) + + // client to inject test data + cnClient := fakeclients.ClusterNetworkClient(nchclientset.NetworkV1beta1().ClusterNetworks) + vcClient := fakeclients.VlanConfigClient(nchclientset.NetworkV1beta1().VlanConfigs) + + if tc.currentVC != nil { + vcClient.Create(tc.currentVC) + } + if tc.currentCN != nil { + cnClient.Create(tc.currentCN) + } + validator := NewCnValidator(vcCache) + err := validator.Create(nil, tc.newCN) + if tc.returnErr { + assert.NotNil(t, err) + assert.True(t, strings.Contains(err.Error(), tc.errKey)) + } + }) + } +} + +func TestDeleteClusterNetwork(t *testing.T) { + tests := []struct { + name string + returnErr bool + errKey string + currentCN *networkv1.ClusterNetwork // delete this one + currentVC *networkv1.VlanConfig + }{ + { + name: "ClusterNetwork mgmt is not allowed to be deleted", + returnErr: true, + errKey: "not allowed", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: utils.ManagementClusterNetworkName, + Annotations: map[string]string{"test": "test"}, + }, + }, + }, + { + name: "ClusterNetwork is not allowed to be deleted as VlanConfig is existing", + returnErr: true, + errKey: "still exist", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + currentVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "VC1", + Annotations: map[string]string{utils.KeyMatchedNodes: "[\"node1\"]"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 1500, + }, + }, + }, + }, + }, + { + name: "ClusterNetwork is allowed to be deleted", + returnErr: false, + errKey: "", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + currentVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "VC1", + Annotations: map[string]string{utils.KeyMatchedNodes: "[\"node1\"]"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: "unrelated", + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 1500, + }, + }, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + assert.NotNil(t, tc.currentCN) + if tc.currentCN == nil { + return + } + + nchclientset := fake.NewSimpleClientset() + vcCache := fakeclients.VlanConfigCache(nchclientset.NetworkV1beta1().VlanConfigs) + + // client to inject test data + cnClient := fakeclients.ClusterNetworkClient(nchclientset.NetworkV1beta1().ClusterNetworks) + vcClient := fakeclients.VlanConfigClient(nchclientset.NetworkV1beta1().VlanConfigs) + + if tc.currentVC != nil { + vcClient.Create(tc.currentVC) + } + if tc.currentCN != nil { + cnClient.Create(tc.currentCN) + } + validator := NewCnValidator(vcCache) + err := validator.Delete(nil, tc.currentCN) + if tc.returnErr { + assert.NotNil(t, err) + assert.True(t, strings.Contains(err.Error(), tc.errKey)) + } + }) + } +} diff --git a/pkg/webhook/nad/validator.go b/pkg/webhook/nad/validator.go index ce92c14a..ea211999 100644 --- a/pkg/webhook/nad/validator.go +++ b/pkg/webhook/nad/validator.go @@ -11,6 +11,7 @@ import ( cniv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" admissionregv1 "k8s.io/api/admissionregistration/v1" "k8s.io/apimachinery/pkg/runtime" + kubevirtv1 "kubevirt.io/api/core/v1" "github.com/harvester/harvester-network-controller/pkg/network/iface" "github.com/harvester/harvester-network-controller/pkg/utils" @@ -132,6 +133,11 @@ func (v *Validator) checkVmi(nad *cniv1.NetworkAttachmentDefinition) error { return err } + return v.warnVmi(nad, vmis) +} + +// for convenicen of test code +func (v *Validator) warnVmi(_ *cniv1.NetworkAttachmentDefinition, vmis []*kubevirtv1.VirtualMachineInstance) error { if len(vmis) > 0 { vmiNameList := make([]string, 0, len(vmis)) for _, vmi := range vmis { @@ -139,7 +145,6 @@ func (v *Validator) checkVmi(nad *cniv1.NetworkAttachmentDefinition) error { } return fmt.Errorf("it's still used by VM(s) %s which must be stopped at first", strings.Join(vmiNameList, ", ")) } - return nil } diff --git a/pkg/webhook/nad/validator_test.go b/pkg/webhook/nad/validator_test.go new file mode 100644 index 00000000..63356435 --- /dev/null +++ b/pkg/webhook/nad/validator_test.go @@ -0,0 +1,299 @@ +package nad + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + networkv1 "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1" + "github.com/harvester/harvester-network-controller/pkg/generated/clientset/versioned/fake" + "github.com/harvester/harvester-network-controller/pkg/utils" + "github.com/harvester/harvester-network-controller/pkg/utils/fakeclients" + harvesterfake "github.com/harvester/harvester/pkg/generated/clientset/versioned/fake" + harvesterfakeclients "github.com/harvester/harvester/pkg/util/fakeclients" + cniv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" + kubevirtv1 "kubevirt.io/api/core/v1" +) + +const ( + testCnName = "test-cn" + testNADConfig = "{\"cniVersion\":\"0.3.1\",\"name\":\"net1-vlan\",\"type\":\"bridge\",\"bridge\":\"harvester-br0\",\"promiscMode\":true,\"vlan\":300,\"ipam\":{}}" + testNADName = "testNad" + testVmName = "vm1" + testNamespace = "test" +) + +func TestCreateNAD(t *testing.T) { + tests := []struct { + name string + returnErr bool + errKey string + currentCN *networkv1.ClusterNetwork + currentVC *networkv1.VlanConfig + currentNAD *cniv1.NetworkAttachmentDefinition + newNAD *cniv1.NetworkAttachmentDefinition + }{ + { + name: "NAD is valid to create", + returnErr: false, + errKey: "", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newNAD: &cniv1.NetworkAttachmentDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: testNADName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: cniv1.NetworkAttachmentDefinitionSpec{ + Config: testNADConfig, + }, + }, + }, + { + name: "NAD has invalid config string", + returnErr: true, + errKey: "unmarshal", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newNAD: &cniv1.NetworkAttachmentDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: testNADName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: cniv1.NetworkAttachmentDefinitionSpec{ + Config: "{\"cniVersion\",\"name\":\"net1-vlan\",\"type\":\"bridge\",\"bridge\":\"harvester-br0\",\"promiscMode\":true,\"vlan\":300,\"ipam\":{}}", + }, + }, + }, + { + name: "NAD has invalid VLAN id which is -1", + returnErr: true, + errKey: "VLAN ID must", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newNAD: &cniv1.NetworkAttachmentDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: testNADName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: cniv1.NetworkAttachmentDefinitionSpec{ + Config: "{\"cniVersion\":\"0.3.1\",\"name\":\"net1-vlan\",\"type\":\"bridge\",\"bridge\":\"harvester-br0\",\"promiscMode\":true,\"vlan\":-1,\"ipam\":{}}", + }, + }, + }, + { + name: "NAD has invalid VLAN id which is 4095", + returnErr: true, + errKey: "VLAN ID must", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newNAD: &cniv1.NetworkAttachmentDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: testNADName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: cniv1.NetworkAttachmentDefinitionSpec{ + Config: "{\"cniVersion\":\"0.3.1\",\"name\":\"net1-vlan\",\"type\":\"bridge\",\"bridge\":\"harvester-br0\",\"promiscMode\":true,\"vlan\":4095,\"ipam\":{}}", + }, + }, + }, + { + name: "NAD has too long bridge name", + returnErr: true, + errKey: "the length of the brName", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newNAD: &cniv1.NetworkAttachmentDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: testNADName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: cniv1.NetworkAttachmentDefinitionSpec{ + Config: "{\"cniVersion\":\"0.3.1\",\"name\":\"net1-vlan\",\"type\":\"bridge\",\"bridge\":\"harvester-br0-too-long\",\"promiscMode\":true,\"vlan\":300,\"ipam\":{}}", + }, + }, + }, + { + name: "NAD has too short bridge name", + returnErr: true, + errKey: "the suffix of the brName", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newNAD: &cniv1.NetworkAttachmentDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: testNADName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: cniv1.NetworkAttachmentDefinitionSpec{ + Config: "{\"cniVersion\":\"0.3.1\",\"name\":\"net1-vlan\",\"type\":\"bridge\",\"bridge\":\"a\",\"promiscMode\":true,\"vlan\":300,\"ipam\":{}}", + }, + }, + }, + { + name: "NAD has invalid bridge suffix", + returnErr: true, + errKey: "the suffix of the brName", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newNAD: &cniv1.NetworkAttachmentDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: testNADName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: cniv1.NetworkAttachmentDefinitionSpec{ + Config: "{\"cniVersion\":\"0.3.1\",\"name\":\"net1-vlan\",\"type\":\"bridge\",\"suffix-br-\":\"a\",\"promiscMode\":true,\"vlan\":300,\"ipam\":{}}", + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + + assert.NotNil(t, tc.newNAD) + if tc.newNAD == nil { + return + } + + nchclientset := fake.NewSimpleClientset() + harvesterclientset := harvesterfake.NewSimpleClientset() + + vmiCache := harvesterfakeclients.VirtualMachineInstanceCache(harvesterclientset.KubevirtV1().VirtualMachineInstances) + + // client to inject test data + vcClient := fakeclients.VlanConfigClient(nchclientset.NetworkV1beta1().VlanConfigs) + cnClient := fakeclients.ClusterNetworkClient(nchclientset.NetworkV1beta1().ClusterNetworks) + + if tc.currentVC != nil { + vcClient.Create(tc.currentVC) + } + if tc.currentCN != nil { + cnClient.Create(tc.currentCN) + } + + validator := NewNadValidator(vmiCache) + + err := validator.Create(nil, tc.newNAD) + if tc.returnErr { + assert.NotNil(t, err) + assert.True(t, strings.Contains(err.Error(), tc.errKey)) + } + }) + } +} + +func TestDeleteNAD(t *testing.T) { + tests := []struct { + name string + returnErr bool + errKey string + currentNAD *cniv1.NetworkAttachmentDefinition + usedVMs []*kubevirtv1.VirtualMachineInstance + }{ + { + name: "NAD has used VMs and can not be deleted", + returnErr: true, + errKey: testVmName, + currentNAD: &cniv1.NetworkAttachmentDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: testNADName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: cniv1.NetworkAttachmentDefinitionSpec{ + Config: testNADConfig, + }, + }, + usedVMs: []*kubevirtv1.VirtualMachineInstance{ + { + ObjectMeta: metav1.ObjectMeta{ + Name: testVmName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + }, + }, + }, + }, + { + name: "NAD has no used VMs and can be deleted", + returnErr: false, + errKey: "", + currentNAD: &cniv1.NetworkAttachmentDefinition{ + ObjectMeta: metav1.ObjectMeta{ + Name: testNADName, + Namespace: testNamespace, + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: cniv1.NetworkAttachmentDefinitionSpec{ + Config: testNADConfig, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + assert.NotNil(t, tc.currentNAD) + if tc.currentNAD == nil { + return + } + + harvesterclientset := harvesterfake.NewSimpleClientset() + vmiCache := harvesterfakeclients.VirtualMachineInstanceCache(harvesterclientset.KubevirtV1().VirtualMachineInstances) + validator := NewNadValidator(vmiCache) + + // due to fake vmiCache limitation, just test warnVmi() instead of Delete() + err := validator.warnVmi(tc.currentNAD, tc.usedVMs) + if tc.returnErr { + assert.NotNil(t, err) + assert.True(t, strings.Contains(err.Error(), tc.errKey)) + } + }) + } +} diff --git a/pkg/webhook/vlanconfig/validator.go b/pkg/webhook/vlanconfig/validator.go index 288952f7..2c86f9e4 100644 --- a/pkg/webhook/vlanconfig/validator.go +++ b/pkg/webhook/vlanconfig/validator.go @@ -34,6 +34,7 @@ type Validator struct { nadCache ctlcniv1.NetworkAttachmentDefinitionCache vcCache ctlnetworkv1.VlanConfigCache vsCache ctlnetworkv1.VlanStatusCache + cnCache ctlnetworkv1.ClusterNetworkCache vmiCache ctlkubevirtv1.VirtualMachineInstanceCache } @@ -41,11 +42,13 @@ func NewVlanConfigValidator( nadCache ctlcniv1.NetworkAttachmentDefinitionCache, vcCache ctlnetworkv1.VlanConfigCache, vsCache ctlnetworkv1.VlanStatusCache, + cnCache ctlnetworkv1.ClusterNetworkCache, vmiCache ctlkubevirtv1.VirtualMachineInstanceCache) *Validator { return &Validator{ nadCache: nadCache, vcCache: vcCache, vsCache: vsCache, + cnCache: cnCache, vmiCache: vmiCache, } } @@ -162,6 +165,9 @@ func (v *Validator) Resource() admission.Resource { } func (v *Validator) checkOverlaps(vc *networkv1.VlanConfig, nodes mapset.Set[string]) error { + if nodes == nil { + return nil + } overlapNods := mapset.NewSet[string]() for node := range nodes.Iter() { vsName := utils.Name("", vc.Spec.ClusterNetwork, node) @@ -182,12 +188,15 @@ func (v *Validator) checkOverlaps(vc *networkv1.VlanConfig, nodes mapset.Set[str // checkVmi is to confirm if any VMIs will be affected on affected nodes. Those VMIs must be stopped in advance. func (v *Validator) checkVmi(vc *networkv1.VlanConfig, nodes mapset.Set[string]) error { + if nodes == nil { + return nil + } + // The vlanconfig is not allowed to be deleted if it has applied to some nodes and its clusternetwork is attached by some nads. vss, err := v.vsCache.List(labels.Set(map[string]string{utils.KeyVlanConfigLabel: vc.Name}).AsSelector()) if err != nil { return fmt.Errorf(deleteErr, vc.Name, err) } - if len(vss) == 0 { return nil } @@ -198,6 +207,9 @@ func (v *Validator) checkVmi(vc *networkv1.VlanConfig, nodes mapset.Set[string]) if err != nil { return fmt.Errorf(deleteErr, vc.Name, err) } + if len(nads) == 0 { + return nil + } vmiGetter := utils.VmiGetter{VmiCache: v.vmiCache} vmis := make([]*kubevirtv1.VirtualMachineInstance, 0) diff --git a/pkg/webhook/vlanconfig/validator_test.go b/pkg/webhook/vlanconfig/validator_test.go new file mode 100644 index 00000000..f5ca08c8 --- /dev/null +++ b/pkg/webhook/vlanconfig/validator_test.go @@ -0,0 +1,454 @@ +package vlanconfig + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/assert" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + networkv1 "github.com/harvester/harvester-network-controller/pkg/apis/network.harvesterhci.io/v1beta1" + "github.com/harvester/harvester-network-controller/pkg/generated/clientset/versioned/fake" + "github.com/harvester/harvester-network-controller/pkg/utils" + "github.com/harvester/harvester-network-controller/pkg/utils/fakeclients" + harvesterfake "github.com/harvester/harvester/pkg/generated/clientset/versioned/fake" + harvesterfakeclients "github.com/harvester/harvester/pkg/util/fakeclients" +) + +const testCnName = "test-cn" + +func TestCreateVlanConfig(t *testing.T) { + tests := []struct { + name string + returnErr bool + errKey string + currentCN *networkv1.ClusterNetwork + currentVC *networkv1.VlanConfig + currentVS *networkv1.VlanStatus + newVC *networkv1.VlanConfig + }{ + { + name: "can not create VlanConfig on mgmt network", + returnErr: true, + errKey: "mgmt", + newVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "testOnMgmt", + Annotations: map[string]string{"test": "test"}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: utils.ManagementClusterNetworkName, + }, + }, + }, + { + name: "MTU is too small", + returnErr: true, + errKey: "out of range", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "newVC", + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: utils.MTUMin - 1, + }, + }, + }, + }, + }, + { + name: "MTU is too big", + returnErr: true, + errKey: "out of range", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "newVC", + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: utils.MTUMax + 1, + }, + }, + }, + }, + }, + { + name: "MTU is valid", + returnErr: false, + errKey: "", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "newVC", + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: utils.MTUDefault, + }, + }, + }, + }, + }, + { + name: "MTU is 0 and will fallback to default value", + returnErr: false, + errKey: "", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + newVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "newVC", + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 0, + }, + }, + }, + }, + }, + { + name: "VlanConfigs under one ClusterNetwork can not have different MTUs", + returnErr: true, + errKey: "MTU", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + currentVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "currentVC", + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 1500, + }, + }, + }, + }, + newVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "newVC", + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 1501, + }, + }, + }, + }, + }, + { + name: "VlanConfigs have overlaps", + returnErr: true, + errKey: "overlaps", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + currentVS: &networkv1.VlanStatus{ + ObjectMeta: metav1.ObjectMeta{ + Name: utils.Name("", testCnName, "node1"), + Annotations: map[string]string{"test": "test"}, + }, + Status: networkv1.VlStatus{ + ClusterNetwork: testCnName, + VlanConfig: "oldVC", // belongs to another vc + }, + }, + newVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "newVC", + Annotations: map[string]string{utils.KeyMatchedNodes: "[\"node1\"]"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 1500, + }, + }, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + + assert.NotNil(t, tc.newVC) + if tc.newVC == nil { + return + } + + nchclientset := fake.NewSimpleClientset() + harvesterclientset := harvesterfake.NewSimpleClientset() + nadCache := harvesterfakeclients.NetworkAttachmentDefinitionCache(harvesterclientset.K8sCniCncfIoV1().NetworkAttachmentDefinitions) + vmiCache := harvesterfakeclients.VirtualMachineInstanceCache(harvesterclientset.KubevirtV1().VirtualMachineInstances) + vcCache := fakeclients.VlanConfigCache(nchclientset.NetworkV1beta1().VlanConfigs) + vsCache := fakeclients.VlanStatusCache(nchclientset.NetworkV1beta1().VlanStatuses) + cnCache := fakeclients.ClusterNetworkCache(nchclientset.NetworkV1beta1().ClusterNetworks) + + // client to inject test data + vcClient := fakeclients.VlanConfigClient(nchclientset.NetworkV1beta1().VlanConfigs) + cnClient := fakeclients.ClusterNetworkClient(nchclientset.NetworkV1beta1().ClusterNetworks) + vsClient := fakeclients.VlanStatusClient(nchclientset.NetworkV1beta1().VlanStatuses) + + if tc.currentVC != nil { + vcClient.Create(tc.currentVC) + } + if tc.currentCN != nil { + cnClient.Create(tc.currentCN) + } + if tc.currentVS != nil { + vsClient.Create(tc.currentVS) + } + validator := NewVlanConfigValidator(nadCache, vcCache, vsCache, cnCache, vmiCache) + + err := validator.Create(nil, tc.newVC) + if tc.returnErr { + assert.NotNil(t, err) + assert.True(t, strings.Contains(err.Error(), tc.errKey)) + } + + }) + } +} + +func TestDeleteVlanConfig(t *testing.T) { + tests := []struct { + name string + returnErr bool + errKey string + currentCN *networkv1.ClusterNetwork + currentVC *networkv1.VlanConfig // delete this one + currentVS *networkv1.VlanStatus + }{ + { + name: "VlanConfig has no matched nodes", + returnErr: false, + errKey: "", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + currentVS: &networkv1.VlanStatus{ + ObjectMeta: metav1.ObjectMeta{ + Name: utils.Name("", testCnName, "node1"), + Annotations: map[string]string{"test": "test"}, + }, + Status: networkv1.VlStatus{ + ClusterNetwork: testCnName, + VlanConfig: "VC1", + }, + }, + currentVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "VC1", + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 1500, + }, + }, + }, + }, + }, + { + name: "VlanConfig has matched nodes but no VlanStatus", + returnErr: false, + errKey: "", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + currentVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "VC1", + Annotations: map[string]string{utils.KeyMatchedNodes: "[\"node1\"]"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 1500, + }, + }, + }, + }, + }, + { + name: "VlanConfig has matched nodes and matched VlanStatus but no nad", + returnErr: false, + errKey: "", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + currentVS: &networkv1.VlanStatus{ + ObjectMeta: metav1.ObjectMeta{ + Name: utils.Name("", testCnName, "node1"), + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyVlanConfigLabel: "VC1"}, + }, + Status: networkv1.VlStatus{ + ClusterNetwork: testCnName, + VlanConfig: "VC1", + }, + }, + currentVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "VC1", + Annotations: map[string]string{utils.KeyMatchedNodes: "[\"node1\"]"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 1500, + }, + }, + }, + }, + }, + { + name: "VlanConfig has matched nodes and matched VlanStatus and nad but no vmi", + returnErr: false, + errKey: "", + currentCN: &networkv1.ClusterNetwork{ + ObjectMeta: metav1.ObjectMeta{ + Name: testCnName, + Annotations: map[string]string{"test": "test"}, + }, + }, + currentVS: &networkv1.VlanStatus{ + ObjectMeta: metav1.ObjectMeta{ + Name: utils.Name("", testCnName, "node1"), + Annotations: map[string]string{"test": "test"}, + Labels: map[string]string{utils.KeyVlanConfigLabel: "VC1"}, + }, + Status: networkv1.VlStatus{ + ClusterNetwork: testCnName, + VlanConfig: "VC1", + }, + }, + currentVC: &networkv1.VlanConfig{ + ObjectMeta: metav1.ObjectMeta{ + Name: "VC1", + Annotations: map[string]string{utils.KeyMatchedNodes: "[\"node1\"]"}, + Labels: map[string]string{utils.KeyClusterNetworkLabel: testCnName}, + }, + Spec: networkv1.VlanConfigSpec{ + ClusterNetwork: testCnName, + Uplink: networkv1.Uplink{ + LinkAttrs: &networkv1.LinkAttrs{ + MTU: 1500, + }, + }, + }, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + assert.NotNil(t, tc.currentVC) + if tc.currentVC == nil { + return + } + + nchclientset := fake.NewSimpleClientset() + harvesterclientset := harvesterfake.NewSimpleClientset() + nadCache := harvesterfakeclients.NetworkAttachmentDefinitionCache(harvesterclientset.K8sCniCncfIoV1().NetworkAttachmentDefinitions) + vmiCache := harvesterfakeclients.VirtualMachineInstanceCache(harvesterclientset.KubevirtV1().VirtualMachineInstances) + vcCache := fakeclients.VlanConfigCache(nchclientset.NetworkV1beta1().VlanConfigs) + vsCache := fakeclients.VlanStatusCache(nchclientset.NetworkV1beta1().VlanStatuses) + cnCache := fakeclients.ClusterNetworkCache(nchclientset.NetworkV1beta1().ClusterNetworks) + + // client to inject test data + vcClient := fakeclients.VlanConfigClient(nchclientset.NetworkV1beta1().VlanConfigs) + cnClient := fakeclients.ClusterNetworkClient(nchclientset.NetworkV1beta1().ClusterNetworks) + vsClient := fakeclients.VlanStatusClient(nchclientset.NetworkV1beta1().VlanStatuses) + + if tc.currentVC != nil { + vcClient.Create(tc.currentVC) + } + if tc.currentCN != nil { + cnClient.Create(tc.currentCN) + } + if tc.currentVS != nil { + vsClient.Create(tc.currentVS) + } + validator := NewVlanConfigValidator(nadCache, vcCache, vsCache, cnCache, vmiCache) + + err := validator.Delete(nil, tc.currentVC) + if tc.returnErr { + assert.NotNil(t, err) + assert.True(t, strings.Contains(err.Error(), tc.errKey)) + } + + }) + } +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/clientset.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/clientset.go new file mode 100644 index 00000000..74b52365 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/clientset.go @@ -0,0 +1,251 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package versioned + +import ( + "fmt" + "net/http" + + clusterv1alpha4 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4" + harvesterhciv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + k8scnicncfiov1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1" + kubevirtv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1" + loggingv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1" + longhornv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1" + managementv3 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3" + monitoringv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1" + networkingv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1" + snapshotv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1" + upgradev1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1" + 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 + ClusterV1alpha4() clusterv1alpha4.ClusterV1alpha4Interface + HarvesterhciV1beta1() harvesterhciv1beta1.HarvesterhciV1beta1Interface + K8sCniCncfIoV1() k8scnicncfiov1.K8sCniCncfIoV1Interface + KubevirtV1() kubevirtv1.KubevirtV1Interface + LoggingV1beta1() loggingv1beta1.LoggingV1beta1Interface + LonghornV1beta1() longhornv1beta1.LonghornV1beta1Interface + ManagementV3() managementv3.ManagementV3Interface + MonitoringV1() monitoringv1.MonitoringV1Interface + NetworkingV1() networkingv1.NetworkingV1Interface + SnapshotV1beta1() snapshotv1beta1.SnapshotV1beta1Interface + UpgradeV1() upgradev1.UpgradeV1Interface +} + +// Clientset contains the clients for groups. Each group has exactly one +// version included in a Clientset. +type Clientset struct { + *discovery.DiscoveryClient + clusterV1alpha4 *clusterv1alpha4.ClusterV1alpha4Client + harvesterhciV1beta1 *harvesterhciv1beta1.HarvesterhciV1beta1Client + k8sCniCncfIoV1 *k8scnicncfiov1.K8sCniCncfIoV1Client + kubevirtV1 *kubevirtv1.KubevirtV1Client + loggingV1beta1 *loggingv1beta1.LoggingV1beta1Client + longhornV1beta1 *longhornv1beta1.LonghornV1beta1Client + managementV3 *managementv3.ManagementV3Client + monitoringV1 *monitoringv1.MonitoringV1Client + networkingV1 *networkingv1.NetworkingV1Client + snapshotV1beta1 *snapshotv1beta1.SnapshotV1beta1Client + upgradeV1 *upgradev1.UpgradeV1Client +} + +// ClusterV1alpha4 retrieves the ClusterV1alpha4Client +func (c *Clientset) ClusterV1alpha4() clusterv1alpha4.ClusterV1alpha4Interface { + return c.clusterV1alpha4 +} + +// HarvesterhciV1beta1 retrieves the HarvesterhciV1beta1Client +func (c *Clientset) HarvesterhciV1beta1() harvesterhciv1beta1.HarvesterhciV1beta1Interface { + return c.harvesterhciV1beta1 +} + +// K8sCniCncfIoV1 retrieves the K8sCniCncfIoV1Client +func (c *Clientset) K8sCniCncfIoV1() k8scnicncfiov1.K8sCniCncfIoV1Interface { + return c.k8sCniCncfIoV1 +} + +// KubevirtV1 retrieves the KubevirtV1Client +func (c *Clientset) KubevirtV1() kubevirtv1.KubevirtV1Interface { + return c.kubevirtV1 +} + +// LoggingV1beta1 retrieves the LoggingV1beta1Client +func (c *Clientset) LoggingV1beta1() loggingv1beta1.LoggingV1beta1Interface { + return c.loggingV1beta1 +} + +// LonghornV1beta1 retrieves the LonghornV1beta1Client +func (c *Clientset) LonghornV1beta1() longhornv1beta1.LonghornV1beta1Interface { + return c.longhornV1beta1 +} + +// ManagementV3 retrieves the ManagementV3Client +func (c *Clientset) ManagementV3() managementv3.ManagementV3Interface { + return c.managementV3 +} + +// MonitoringV1 retrieves the MonitoringV1Client +func (c *Clientset) MonitoringV1() monitoringv1.MonitoringV1Interface { + return c.monitoringV1 +} + +// NetworkingV1 retrieves the NetworkingV1Client +func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { + return c.networkingV1 +} + +// SnapshotV1beta1 retrieves the SnapshotV1beta1Client +func (c *Clientset) SnapshotV1beta1() snapshotv1beta1.SnapshotV1beta1Interface { + return c.snapshotV1beta1 +} + +// UpgradeV1 retrieves the UpgradeV1Client +func (c *Clientset) UpgradeV1() upgradev1.UpgradeV1Interface { + return c.upgradeV1 +} + +// 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. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*Clientset, error) { + configShallowCopy := *c + + if configShallowCopy.UserAgent == "" { + configShallowCopy.UserAgent = rest.DefaultKubernetesUserAgent() + } + + // share the transport between all clients + httpClient, err := rest.HTTPClientFor(&configShallowCopy) + if err != nil { + return nil, err + } + + return NewForConfigAndClient(&configShallowCopy, httpClient) +} + +// NewForConfigAndClient creates a new Clientset for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +// If config's RateLimiter is not set and QPS and Burst are acceptable, +// NewForConfigAndClient will generate a rate-limiter in configShallowCopy. +func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*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.clusterV1alpha4, err = clusterv1alpha4.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.harvesterhciV1beta1, err = harvesterhciv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.k8sCniCncfIoV1, err = k8scnicncfiov1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.kubevirtV1, err = kubevirtv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.loggingV1beta1, err = loggingv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.longhornV1beta1, err = longhornv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.managementV3, err = managementv3.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.monitoringV1, err = monitoringv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.networkingV1, err = networkingv1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.snapshotV1beta1, err = snapshotv1beta1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + cs.upgradeV1, err = upgradev1.NewForConfigAndClient(&configShallowCopy, httpClient) + if err != nil { + return nil, err + } + + cs.DiscoveryClient, err = discovery.NewDiscoveryClientForConfigAndClient(&configShallowCopy, httpClient) + 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 { + cs, err := NewForConfig(c) + if err != nil { + panic(err) + } + return cs +} + +// New creates a new Clientset for the given RESTClient. +func New(c rest.Interface) *Clientset { + var cs Clientset + cs.clusterV1alpha4 = clusterv1alpha4.New(c) + cs.harvesterhciV1beta1 = harvesterhciv1beta1.New(c) + cs.k8sCniCncfIoV1 = k8scnicncfiov1.New(c) + cs.kubevirtV1 = kubevirtv1.New(c) + cs.loggingV1beta1 = loggingv1beta1.New(c) + cs.longhornV1beta1 = longhornv1beta1.New(c) + cs.managementV3 = managementv3.New(c) + cs.monitoringV1 = monitoringv1.New(c) + cs.networkingV1 = networkingv1.New(c) + cs.snapshotV1beta1 = snapshotv1beta1.New(c) + cs.upgradeV1 = upgradev1.New(c) + + cs.DiscoveryClient = discovery.NewDiscoveryClient(c) + return &cs +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/doc.go new file mode 100644 index 00000000..4b0dfa89 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated clientset. +package versioned diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/fake/clientset_generated.go new file mode 100644 index 00000000..b601b633 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/fake/clientset_generated.go @@ -0,0 +1,155 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + clientset "github.com/harvester/harvester/pkg/generated/clientset/versioned" + clusterv1alpha4 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4" + fakeclusterv1alpha4 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake" + harvesterhciv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + fakeharvesterhciv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake" + k8scnicncfiov1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1" + fakek8scnicncfiov1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake" + kubevirtv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1" + fakekubevirtv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake" + loggingv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1" + fakeloggingv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake" + longhornv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1" + fakelonghornv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake" + managementv3 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3" + fakemanagementv3 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake" + monitoringv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1" + fakemonitoringv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake" + networkingv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1" + fakenetworkingv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake" + snapshotv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1" + fakesnapshotv1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake" + upgradev1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1" + fakeupgradev1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake" + "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/watch" + "k8s.io/client-go/discovery" + fakediscovery "k8s.io/client-go/discovery/fake" + "k8s.io/client-go/testing" +) + +// 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 := testing.NewObjectTracker(scheme, codecs.UniversalDecoder()) + for _, obj := range objects { + if err := o.Add(obj); err != nil { + panic(err) + } + } + + cs := &Clientset{tracker: o} + cs.discovery = &fakediscovery.FakeDiscovery{Fake: &cs.Fake} + cs.AddReactor("*", "*", testing.ObjectReaction(o)) + cs.AddWatchReactor("*", func(action testing.Action) (handled bool, ret watch.Interface, err error) { + gvr := action.GetResource() + ns := action.GetNamespace() + watch, err := o.Watch(gvr, ns) + if err != nil { + return false, nil, err + } + return true, watch, nil + }) + + return cs +} + +// 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 { + testing.Fake + discovery *fakediscovery.FakeDiscovery + tracker testing.ObjectTracker +} + +func (c *Clientset) Discovery() discovery.DiscoveryInterface { + return c.discovery +} + +func (c *Clientset) Tracker() testing.ObjectTracker { + return c.tracker +} + +var ( + _ clientset.Interface = &Clientset{} + _ testing.FakeClient = &Clientset{} +) + +// ClusterV1alpha4 retrieves the ClusterV1alpha4Client +func (c *Clientset) ClusterV1alpha4() clusterv1alpha4.ClusterV1alpha4Interface { + return &fakeclusterv1alpha4.FakeClusterV1alpha4{Fake: &c.Fake} +} + +// HarvesterhciV1beta1 retrieves the HarvesterhciV1beta1Client +func (c *Clientset) HarvesterhciV1beta1() harvesterhciv1beta1.HarvesterhciV1beta1Interface { + return &fakeharvesterhciv1beta1.FakeHarvesterhciV1beta1{Fake: &c.Fake} +} + +// K8sCniCncfIoV1 retrieves the K8sCniCncfIoV1Client +func (c *Clientset) K8sCniCncfIoV1() k8scnicncfiov1.K8sCniCncfIoV1Interface { + return &fakek8scnicncfiov1.FakeK8sCniCncfIoV1{Fake: &c.Fake} +} + +// KubevirtV1 retrieves the KubevirtV1Client +func (c *Clientset) KubevirtV1() kubevirtv1.KubevirtV1Interface { + return &fakekubevirtv1.FakeKubevirtV1{Fake: &c.Fake} +} + +// LoggingV1beta1 retrieves the LoggingV1beta1Client +func (c *Clientset) LoggingV1beta1() loggingv1beta1.LoggingV1beta1Interface { + return &fakeloggingv1beta1.FakeLoggingV1beta1{Fake: &c.Fake} +} + +// LonghornV1beta1 retrieves the LonghornV1beta1Client +func (c *Clientset) LonghornV1beta1() longhornv1beta1.LonghornV1beta1Interface { + return &fakelonghornv1beta1.FakeLonghornV1beta1{Fake: &c.Fake} +} + +// ManagementV3 retrieves the ManagementV3Client +func (c *Clientset) ManagementV3() managementv3.ManagementV3Interface { + return &fakemanagementv3.FakeManagementV3{Fake: &c.Fake} +} + +// MonitoringV1 retrieves the MonitoringV1Client +func (c *Clientset) MonitoringV1() monitoringv1.MonitoringV1Interface { + return &fakemonitoringv1.FakeMonitoringV1{Fake: &c.Fake} +} + +// NetworkingV1 retrieves the NetworkingV1Client +func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { + return &fakenetworkingv1.FakeNetworkingV1{Fake: &c.Fake} +} + +// SnapshotV1beta1 retrieves the SnapshotV1beta1Client +func (c *Clientset) SnapshotV1beta1() snapshotv1beta1.SnapshotV1beta1Interface { + return &fakesnapshotv1beta1.FakeSnapshotV1beta1{Fake: &c.Fake} +} + +// UpgradeV1 retrieves the UpgradeV1Client +func (c *Clientset) UpgradeV1() upgradev1.UpgradeV1Interface { + return &fakeupgradev1.FakeUpgradeV1{Fake: &c.Fake} +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/fake/doc.go new file mode 100644 index 00000000..31a6a19e --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated fake clientset. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/fake/register.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/fake/register.go new file mode 100644 index 00000000..2224b495 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/fake/register.go @@ -0,0 +1,76 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + loggingv1beta1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + harvesterhciv1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + k8scnicncfiov1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" + snapshotv1beta1 "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1" + longhornv1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + managementv3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + upgradev1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1" + networkingv1 "k8s.io/api/networking/v1" + 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" + kubevirtv1 "kubevirt.io/api/core/v1" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" +) + +var scheme = runtime.NewScheme() +var codecs = serializer.NewCodecFactory(scheme) + +var localSchemeBuilder = runtime.SchemeBuilder{ + clusterv1alpha4.AddToScheme, + harvesterhciv1beta1.AddToScheme, + k8scnicncfiov1.AddToScheme, + kubevirtv1.AddToScheme, + loggingv1beta1.AddToScheme, + longhornv1beta1.AddToScheme, + managementv3.AddToScheme, + monitoringv1.AddToScheme, + networkingv1.AddToScheme, + snapshotv1beta1.AddToScheme, + upgradev1.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)) +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/cluster.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/cluster.go new file mode 100644 index 00000000..aa647e66 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/cluster.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1alpha4 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/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" + v1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" +) + +// ClustersGetter has a method to return a ClusterInterface. +// A group's client should implement this interface. +type ClustersGetter interface { + Clusters(namespace string) ClusterInterface +} + +// ClusterInterface has methods to work with Cluster resources. +type ClusterInterface interface { + Create(ctx context.Context, cluster *v1alpha4.Cluster, opts v1.CreateOptions) (*v1alpha4.Cluster, error) + Update(ctx context.Context, cluster *v1alpha4.Cluster, opts v1.UpdateOptions) (*v1alpha4.Cluster, error) + UpdateStatus(ctx context.Context, cluster *v1alpha4.Cluster, opts v1.UpdateOptions) (*v1alpha4.Cluster, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha4.Cluster, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha4.ClusterList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Cluster, err error) + ClusterExpansion +} + +// clusters implements ClusterInterface +type clusters struct { + client rest.Interface + ns string +} + +// newClusters returns a Clusters +func newClusters(c *ClusterV1alpha4Client, namespace string) *clusters { + return &clusters{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. +func (c *clusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Cluster, err error) { + result = &v1alpha4.Cluster{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Clusters that match those selectors. +func (c *clusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.ClusterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha4.ClusterList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusters. +func (c *clusters) Watch(ctx context.Context, 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("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// 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(ctx context.Context, cluster *v1alpha4.Cluster, opts v1.CreateOptions) (result *v1alpha4.Cluster, err error) { + result = &v1alpha4.Cluster{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cluster). + Do(ctx). + 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(ctx context.Context, cluster *v1alpha4.Cluster, opts v1.UpdateOptions) (result *v1alpha4.Cluster, err error) { + result = &v1alpha4.Cluster{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusters"). + Name(cluster.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cluster). + Do(ctx). + 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 *clusters) UpdateStatus(ctx context.Context, cluster *v1alpha4.Cluster, opts v1.UpdateOptions) (result *v1alpha4.Cluster, err error) { + result = &v1alpha4.Cluster{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusters"). + Name(cluster.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cluster). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the cluster and deletes it. Returns an error if one occurs. +func (c *clusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clusters"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clusters"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched cluster. +func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Cluster, err error) { + result = &v1alpha4.Cluster{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clusters"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/cluster.x-k8s.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/cluster.x-k8s.io_client.go new file mode 100644 index 00000000..899b6203 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/cluster.x-k8s.io_client.go @@ -0,0 +1,112 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1alpha4 + +import ( + "net/http" + + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" + v1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" +) + +type ClusterV1alpha4Interface interface { + RESTClient() rest.Interface + ClustersGetter + MachinesGetter +} + +// ClusterV1alpha4Client is used to interact with features provided by the cluster.x-k8s.io group. +type ClusterV1alpha4Client struct { + restClient rest.Interface +} + +func (c *ClusterV1alpha4Client) Clusters(namespace string) ClusterInterface { + return newClusters(c, namespace) +} + +func (c *ClusterV1alpha4Client) Machines(namespace string) MachineInterface { + return newMachines(c, namespace) +} + +// NewForConfig creates a new ClusterV1alpha4Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ClusterV1alpha4Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new ClusterV1alpha4Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ClusterV1alpha4Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &ClusterV1alpha4Client{client}, nil +} + +// NewForConfigOrDie creates a new ClusterV1alpha4Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ClusterV1alpha4Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ClusterV1alpha4Client for the given RESTClient. +func New(c rest.Interface) *ClusterV1alpha4Client { + return &ClusterV1alpha4Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1alpha4.GroupVersion + 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 *ClusterV1alpha4Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/doc.go new file mode 100644 index 00000000..16ff5561 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1alpha4 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/fake_cluster.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/fake_cluster.go new file mode 100644 index 00000000..8f8aa8cd --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/fake_cluster.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" +) + +// FakeClusters implements ClusterInterface +type FakeClusters struct { + Fake *FakeClusterV1alpha4 + ns string +} + +var clustersResource = schema.GroupVersionResource{Group: "cluster.x-k8s.io", Version: "v1alpha4", Resource: "clusters"} + +var clustersKind = schema.GroupVersionKind{Group: "cluster.x-k8s.io", Version: "v1alpha4", Kind: "Cluster"} + +// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. +func (c *FakeClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clustersResource, c.ns, name), &v1alpha4.Cluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Cluster), err +} + +// List takes label and field selectors, and returns the list of Clusters that match those selectors. +func (c *FakeClusters) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.ClusterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clustersResource, clustersKind, c.ns, opts), &v1alpha4.ClusterList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha4.ClusterList{ListMeta: obj.(*v1alpha4.ClusterList).ListMeta} + for _, item := range obj.(*v1alpha4.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(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clustersResource, c.ns, opts)) + +} + +// 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 *FakeClusters) Create(ctx context.Context, cluster *v1alpha4.Cluster, opts v1.CreateOptions) (result *v1alpha4.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clustersResource, c.ns, cluster), &v1alpha4.Cluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Cluster), err +} + +// 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 *FakeClusters) Update(ctx context.Context, cluster *v1alpha4.Cluster, opts v1.UpdateOptions) (result *v1alpha4.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clustersResource, c.ns, cluster), &v1alpha4.Cluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Cluster), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusters) UpdateStatus(ctx context.Context, cluster *v1alpha4.Cluster, opts v1.UpdateOptions) (*v1alpha4.Cluster, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(clustersResource, "status", c.ns, cluster), &v1alpha4.Cluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Cluster), err +} + +// Delete takes name of the cluster and deletes it. Returns an error if one occurs. +func (c *FakeClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clustersResource, c.ns, name, opts), &v1alpha4.Cluster{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clustersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha4.ClusterList{}) + return err +} + +// Patch applies the patch and returns the patched cluster. +func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clustersResource, c.ns, name, pt, data, subresources...), &v1alpha4.Cluster{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Cluster), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/fake_cluster.x-k8s.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/fake_cluster.x-k8s.io_client.go new file mode 100644 index 00000000..2d4ca1eb --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/fake_cluster.x-k8s.io_client.go @@ -0,0 +1,44 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1alpha4 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeClusterV1alpha4 struct { + *testing.Fake +} + +func (c *FakeClusterV1alpha4) Clusters(namespace string) v1alpha4.ClusterInterface { + return &FakeClusters{c, namespace} +} + +func (c *FakeClusterV1alpha4) Machines(namespace string) v1alpha4.MachineInterface { + return &FakeMachines{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeClusterV1alpha4) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/fake_machine.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/fake_machine.go new file mode 100644 index 00000000..2ec7063a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/fake/fake_machine.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + v1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" +) + +// FakeMachines implements MachineInterface +type FakeMachines struct { + Fake *FakeClusterV1alpha4 + ns string +} + +var machinesResource = schema.GroupVersionResource{Group: "cluster.x-k8s.io", Version: "v1alpha4", Resource: "machines"} + +var machinesKind = schema.GroupVersionKind{Group: "cluster.x-k8s.io", Version: "v1alpha4", Kind: "Machine"} + +// Get takes name of the machine, and returns the corresponding machine object, and an error if there is any. +func (c *FakeMachines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(machinesResource, c.ns, name), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// List takes label and field selectors, and returns the list of Machines that match those selectors. +func (c *FakeMachines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.MachineList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(machinesResource, machinesKind, c.ns, opts), &v1alpha4.MachineList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha4.MachineList{ListMeta: obj.(*v1alpha4.MachineList).ListMeta} + for _, item := range obj.(*v1alpha4.MachineList).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 machines. +func (c *FakeMachines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(machinesResource, c.ns, opts)) + +} + +// 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 *FakeMachines) Create(ctx context.Context, machine *v1alpha4.Machine, opts v1.CreateOptions) (result *v1alpha4.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(machinesResource, c.ns, machine), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// 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 *FakeMachines) Update(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (result *v1alpha4.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(machinesResource, c.ns, machine), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeMachines) UpdateStatus(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (*v1alpha4.Machine, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(machinesResource, "status", c.ns, machine), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} + +// Delete takes name of the machine and deletes it. Returns an error if one occurs. +func (c *FakeMachines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(machinesResource, c.ns, name, opts), &v1alpha4.Machine{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMachines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(machinesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1alpha4.MachineList{}) + return err +} + +// Patch applies the patch and returns the patched machine. +func (c *FakeMachines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Machine, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(machinesResource, c.ns, name, pt, data, subresources...), &v1alpha4.Machine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha4.Machine), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/generated_expansion.go new file mode 100644 index 00000000..361dccf8 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/generated_expansion.go @@ -0,0 +1,23 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1alpha4 + +type ClusterExpansion interface{} + +type MachineExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/machine.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/machine.go new file mode 100644 index 00000000..34adf1c1 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/cluster.x-k8s.io/v1alpha4/machine.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1alpha4 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/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" + v1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" +) + +// 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(ctx context.Context, machine *v1alpha4.Machine, opts v1.CreateOptions) (*v1alpha4.Machine, error) + Update(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (*v1alpha4.Machine, error) + UpdateStatus(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (*v1alpha4.Machine, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha4.Machine, error) + List(ctx context.Context, opts v1.ListOptions) (*v1alpha4.MachineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Machine, err error) + MachineExpansion +} + +// machines implements MachineInterface +type machines struct { + client rest.Interface + ns string +} + +// newMachines returns a Machines +func newMachines(c *ClusterV1alpha4Client, 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(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Machines that match those selectors. +func (c *machines) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha4.MachineList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha4.MachineList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested machines. +func (c *machines) Watch(ctx context.Context, 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(ctx) +} + +// 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(ctx context.Context, machine *v1alpha4.Machine, opts v1.CreateOptions) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Post(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + 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(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + 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(ctx context.Context, machine *v1alpha4.Machine, opts v1.UpdateOptions) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("machines"). + Name(machine.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(machine). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the machine and deletes it. Returns an error if one occurs. +func (c *machines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *machines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("machines"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched machine. +func (c *machines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha4.Machine, err error) { + result = &v1alpha4.Machine{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("machines"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/addon.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/addon.go new file mode 100644 index 00000000..b73b47de --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/addon.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// AddonsGetter has a method to return a AddonInterface. +// A group's client should implement this interface. +type AddonsGetter interface { + Addons(namespace string) AddonInterface +} + +// AddonInterface has methods to work with Addon resources. +type AddonInterface interface { + Create(ctx context.Context, addon *v1beta1.Addon, opts v1.CreateOptions) (*v1beta1.Addon, error) + Update(ctx context.Context, addon *v1beta1.Addon, opts v1.UpdateOptions) (*v1beta1.Addon, error) + UpdateStatus(ctx context.Context, addon *v1beta1.Addon, opts v1.UpdateOptions) (*v1beta1.Addon, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Addon, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.AddonList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Addon, err error) + AddonExpansion +} + +// addons implements AddonInterface +type addons struct { + client rest.Interface + ns string +} + +// newAddons returns a Addons +func newAddons(c *HarvesterhciV1beta1Client, namespace string) *addons { + return &addons{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the addon, and returns the corresponding addon object, and an error if there is any. +func (c *addons) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Addon, err error) { + result = &v1beta1.Addon{} + err = c.client.Get(). + Namespace(c.ns). + Resource("addons"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Addons that match those selectors. +func (c *addons) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AddonList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.AddonList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("addons"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested addons. +func (c *addons) Watch(ctx context.Context, 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("addons"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a addon and creates it. Returns the server's representation of the addon, and an error, if there is any. +func (c *addons) Create(ctx context.Context, addon *v1beta1.Addon, opts v1.CreateOptions) (result *v1beta1.Addon, err error) { + result = &v1beta1.Addon{} + err = c.client.Post(). + Namespace(c.ns). + Resource("addons"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(addon). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a addon and updates it. Returns the server's representation of the addon, and an error, if there is any. +func (c *addons) Update(ctx context.Context, addon *v1beta1.Addon, opts v1.UpdateOptions) (result *v1beta1.Addon, err error) { + result = &v1beta1.Addon{} + err = c.client.Put(). + Namespace(c.ns). + Resource("addons"). + Name(addon.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(addon). + Do(ctx). + 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 *addons) UpdateStatus(ctx context.Context, addon *v1beta1.Addon, opts v1.UpdateOptions) (result *v1beta1.Addon, err error) { + result = &v1beta1.Addon{} + err = c.client.Put(). + Namespace(c.ns). + Resource("addons"). + Name(addon.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(addon). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the addon and deletes it. Returns an error if one occurs. +func (c *addons) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("addons"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *addons) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("addons"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched addon. +func (c *addons) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Addon, err error) { + result = &v1beta1.Addon{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("addons"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/doc.go new file mode 100644 index 00000000..d9184aec --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_addon.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_addon.go new file mode 100644 index 00000000..aa425ccb --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_addon.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAddons implements AddonInterface +type FakeAddons struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var addonsResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "addons"} + +var addonsKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "Addon"} + +// Get takes name of the addon, and returns the corresponding addon object, and an error if there is any. +func (c *FakeAddons) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Addon, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(addonsResource, c.ns, name), &v1beta1.Addon{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Addon), err +} + +// List takes label and field selectors, and returns the list of Addons that match those selectors. +func (c *FakeAddons) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.AddonList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(addonsResource, addonsKind, c.ns, opts), &v1beta1.AddonList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.AddonList{ListMeta: obj.(*v1beta1.AddonList).ListMeta} + for _, item := range obj.(*v1beta1.AddonList).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 addons. +func (c *FakeAddons) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(addonsResource, c.ns, opts)) + +} + +// Create takes the representation of a addon and creates it. Returns the server's representation of the addon, and an error, if there is any. +func (c *FakeAddons) Create(ctx context.Context, addon *v1beta1.Addon, opts v1.CreateOptions) (result *v1beta1.Addon, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(addonsResource, c.ns, addon), &v1beta1.Addon{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Addon), err +} + +// Update takes the representation of a addon and updates it. Returns the server's representation of the addon, and an error, if there is any. +func (c *FakeAddons) Update(ctx context.Context, addon *v1beta1.Addon, opts v1.UpdateOptions) (result *v1beta1.Addon, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(addonsResource, c.ns, addon), &v1beta1.Addon{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Addon), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeAddons) UpdateStatus(ctx context.Context, addon *v1beta1.Addon, opts v1.UpdateOptions) (*v1beta1.Addon, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(addonsResource, "status", c.ns, addon), &v1beta1.Addon{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Addon), err +} + +// Delete takes name of the addon and deletes it. Returns an error if one occurs. +func (c *FakeAddons) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(addonsResource, c.ns, name, opts), &v1beta1.Addon{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAddons) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(addonsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.AddonList{}) + return err +} + +// Patch applies the patch and returns the patched addon. +func (c *FakeAddons) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Addon, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(addonsResource, c.ns, name, pt, data, subresources...), &v1beta1.Addon{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Addon), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_harvesterhci.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_harvesterhci.io_client.go new file mode 100644 index 00000000..e5510dea --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_harvesterhci.io_client.go @@ -0,0 +1,88 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeHarvesterhciV1beta1 struct { + *testing.Fake +} + +func (c *FakeHarvesterhciV1beta1) Addons(namespace string) v1beta1.AddonInterface { + return &FakeAddons{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) KeyPairs(namespace string) v1beta1.KeyPairInterface { + return &FakeKeyPairs{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) Preferences(namespace string) v1beta1.PreferenceInterface { + return &FakePreferences{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) Settings() v1beta1.SettingInterface { + return &FakeSettings{c} +} + +func (c *FakeHarvesterhciV1beta1) SupportBundles(namespace string) v1beta1.SupportBundleInterface { + return &FakeSupportBundles{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) Upgrades(namespace string) v1beta1.UpgradeInterface { + return &FakeUpgrades{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) UpgradeLogs(namespace string) v1beta1.UpgradeLogInterface { + return &FakeUpgradeLogs{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) Versions(namespace string) v1beta1.VersionInterface { + return &FakeVersions{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) VirtualMachineBackups(namespace string) v1beta1.VirtualMachineBackupInterface { + return &FakeVirtualMachineBackups{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) VirtualMachineImages(namespace string) v1beta1.VirtualMachineImageInterface { + return &FakeVirtualMachineImages{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) VirtualMachineRestores(namespace string) v1beta1.VirtualMachineRestoreInterface { + return &FakeVirtualMachineRestores{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) VirtualMachineTemplates(namespace string) v1beta1.VirtualMachineTemplateInterface { + return &FakeVirtualMachineTemplates{c, namespace} +} + +func (c *FakeHarvesterhciV1beta1) VirtualMachineTemplateVersions(namespace string) v1beta1.VirtualMachineTemplateVersionInterface { + return &FakeVirtualMachineTemplateVersions{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeHarvesterhciV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_keypair.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_keypair.go new file mode 100644 index 00000000..500523d3 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_keypair.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeKeyPairs implements KeyPairInterface +type FakeKeyPairs struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var keypairsResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "keypairs"} + +var keypairsKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "KeyPair"} + +// Get takes name of the keyPair, and returns the corresponding keyPair object, and an error if there is any. +func (c *FakeKeyPairs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.KeyPair, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(keypairsResource, c.ns, name), &v1beta1.KeyPair{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.KeyPair), err +} + +// List takes label and field selectors, and returns the list of KeyPairs that match those selectors. +func (c *FakeKeyPairs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.KeyPairList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(keypairsResource, keypairsKind, c.ns, opts), &v1beta1.KeyPairList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.KeyPairList{ListMeta: obj.(*v1beta1.KeyPairList).ListMeta} + for _, item := range obj.(*v1beta1.KeyPairList).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 keyPairs. +func (c *FakeKeyPairs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(keypairsResource, c.ns, opts)) + +} + +// Create takes the representation of a keyPair and creates it. Returns the server's representation of the keyPair, and an error, if there is any. +func (c *FakeKeyPairs) Create(ctx context.Context, keyPair *v1beta1.KeyPair, opts v1.CreateOptions) (result *v1beta1.KeyPair, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(keypairsResource, c.ns, keyPair), &v1beta1.KeyPair{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.KeyPair), err +} + +// Update takes the representation of a keyPair and updates it. Returns the server's representation of the keyPair, and an error, if there is any. +func (c *FakeKeyPairs) Update(ctx context.Context, keyPair *v1beta1.KeyPair, opts v1.UpdateOptions) (result *v1beta1.KeyPair, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(keypairsResource, c.ns, keyPair), &v1beta1.KeyPair{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.KeyPair), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeKeyPairs) UpdateStatus(ctx context.Context, keyPair *v1beta1.KeyPair, opts v1.UpdateOptions) (*v1beta1.KeyPair, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(keypairsResource, "status", c.ns, keyPair), &v1beta1.KeyPair{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.KeyPair), err +} + +// Delete takes name of the keyPair and deletes it. Returns an error if one occurs. +func (c *FakeKeyPairs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(keypairsResource, c.ns, name, opts), &v1beta1.KeyPair{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeKeyPairs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(keypairsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.KeyPairList{}) + return err +} + +// Patch applies the patch and returns the patched keyPair. +func (c *FakeKeyPairs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.KeyPair, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(keypairsResource, c.ns, name, pt, data, subresources...), &v1beta1.KeyPair{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.KeyPair), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_preference.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_preference.go new file mode 100644 index 00000000..b50c9ac6 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_preference.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePreferences implements PreferenceInterface +type FakePreferences struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var preferencesResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "preferences"} + +var preferencesKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "Preference"} + +// Get takes name of the preference, and returns the corresponding preference object, and an error if there is any. +func (c *FakePreferences) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Preference, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(preferencesResource, c.ns, name), &v1beta1.Preference{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Preference), err +} + +// List takes label and field selectors, and returns the list of Preferences that match those selectors. +func (c *FakePreferences) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PreferenceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(preferencesResource, preferencesKind, c.ns, opts), &v1beta1.PreferenceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.PreferenceList{ListMeta: obj.(*v1beta1.PreferenceList).ListMeta} + for _, item := range obj.(*v1beta1.PreferenceList).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 preferences. +func (c *FakePreferences) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(preferencesResource, c.ns, opts)) + +} + +// Create takes the representation of a preference and creates it. Returns the server's representation of the preference, and an error, if there is any. +func (c *FakePreferences) Create(ctx context.Context, preference *v1beta1.Preference, opts v1.CreateOptions) (result *v1beta1.Preference, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(preferencesResource, c.ns, preference), &v1beta1.Preference{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Preference), err +} + +// Update takes the representation of a preference and updates it. Returns the server's representation of the preference, and an error, if there is any. +func (c *FakePreferences) Update(ctx context.Context, preference *v1beta1.Preference, opts v1.UpdateOptions) (result *v1beta1.Preference, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(preferencesResource, c.ns, preference), &v1beta1.Preference{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Preference), err +} + +// Delete takes name of the preference and deletes it. Returns an error if one occurs. +func (c *FakePreferences) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(preferencesResource, c.ns, name, opts), &v1beta1.Preference{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePreferences) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(preferencesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.PreferenceList{}) + return err +} + +// Patch applies the patch and returns the patched preference. +func (c *FakePreferences) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Preference, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(preferencesResource, c.ns, name, pt, data, subresources...), &v1beta1.Preference{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Preference), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_setting.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_setting.go new file mode 100644 index 00000000..8b38443f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_setting.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSettings implements SettingInterface +type FakeSettings struct { + Fake *FakeHarvesterhciV1beta1 +} + +var settingsResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "settings"} + +var settingsKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "Setting"} + +// Get takes name of the setting, and returns the corresponding setting object, and an error if there is any. +func (c *FakeSettings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(settingsResource, name), &v1beta1.Setting{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Setting), err +} + +// List takes label and field selectors, and returns the list of Settings that match those selectors. +func (c *FakeSettings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SettingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(settingsResource, settingsKind, opts), &v1beta1.SettingList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.SettingList{ListMeta: obj.(*v1beta1.SettingList).ListMeta} + for _, item := range obj.(*v1beta1.SettingList).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 settings. +func (c *FakeSettings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(settingsResource, opts)) +} + +// Create takes the representation of a setting and creates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *FakeSettings) Create(ctx context.Context, setting *v1beta1.Setting, opts v1.CreateOptions) (result *v1beta1.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(settingsResource, setting), &v1beta1.Setting{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Setting), err +} + +// Update takes the representation of a setting and updates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *FakeSettings) Update(ctx context.Context, setting *v1beta1.Setting, opts v1.UpdateOptions) (result *v1beta1.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(settingsResource, setting), &v1beta1.Setting{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Setting), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeSettings) UpdateStatus(ctx context.Context, setting *v1beta1.Setting, opts v1.UpdateOptions) (*v1beta1.Setting, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(settingsResource, "status", setting), &v1beta1.Setting{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Setting), err +} + +// Delete takes name of the setting and deletes it. Returns an error if one occurs. +func (c *FakeSettings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(settingsResource, name, opts), &v1beta1.Setting{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSettings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(settingsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.SettingList{}) + return err +} + +// Patch applies the patch and returns the patched setting. +func (c *FakeSettings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(settingsResource, name, pt, data, subresources...), &v1beta1.Setting{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Setting), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_supportbundle.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_supportbundle.go new file mode 100644 index 00000000..f4417375 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_supportbundle.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSupportBundles implements SupportBundleInterface +type FakeSupportBundles struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var supportbundlesResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "supportbundles"} + +var supportbundlesKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "SupportBundle"} + +// Get takes name of the supportBundle, and returns the corresponding supportBundle object, and an error if there is any. +func (c *FakeSupportBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.SupportBundle, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(supportbundlesResource, c.ns, name), &v1beta1.SupportBundle{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SupportBundle), err +} + +// List takes label and field selectors, and returns the list of SupportBundles that match those selectors. +func (c *FakeSupportBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SupportBundleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(supportbundlesResource, supportbundlesKind, c.ns, opts), &v1beta1.SupportBundleList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.SupportBundleList{ListMeta: obj.(*v1beta1.SupportBundleList).ListMeta} + for _, item := range obj.(*v1beta1.SupportBundleList).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 supportBundles. +func (c *FakeSupportBundles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(supportbundlesResource, c.ns, opts)) + +} + +// Create takes the representation of a supportBundle and creates it. Returns the server's representation of the supportBundle, and an error, if there is any. +func (c *FakeSupportBundles) Create(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.CreateOptions) (result *v1beta1.SupportBundle, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(supportbundlesResource, c.ns, supportBundle), &v1beta1.SupportBundle{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SupportBundle), err +} + +// Update takes the representation of a supportBundle and updates it. Returns the server's representation of the supportBundle, and an error, if there is any. +func (c *FakeSupportBundles) Update(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (result *v1beta1.SupportBundle, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(supportbundlesResource, c.ns, supportBundle), &v1beta1.SupportBundle{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SupportBundle), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeSupportBundles) UpdateStatus(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (*v1beta1.SupportBundle, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(supportbundlesResource, "status", c.ns, supportBundle), &v1beta1.SupportBundle{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SupportBundle), err +} + +// Delete takes name of the supportBundle and deletes it. Returns an error if one occurs. +func (c *FakeSupportBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(supportbundlesResource, c.ns, name, opts), &v1beta1.SupportBundle{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSupportBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(supportbundlesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.SupportBundleList{}) + return err +} + +// Patch applies the patch and returns the patched supportBundle. +func (c *FakeSupportBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SupportBundle, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(supportbundlesResource, c.ns, name, pt, data, subresources...), &v1beta1.SupportBundle{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.SupportBundle), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_upgrade.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_upgrade.go new file mode 100644 index 00000000..e1ee691d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_upgrade.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeUpgrades implements UpgradeInterface +type FakeUpgrades struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var upgradesResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "upgrades"} + +var upgradesKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "Upgrade"} + +// Get takes name of the upgrade, and returns the corresponding upgrade object, and an error if there is any. +func (c *FakeUpgrades) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Upgrade, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(upgradesResource, c.ns, name), &v1beta1.Upgrade{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Upgrade), err +} + +// List takes label and field selectors, and returns the list of Upgrades that match those selectors. +func (c *FakeUpgrades) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.UpgradeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(upgradesResource, upgradesKind, c.ns, opts), &v1beta1.UpgradeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.UpgradeList{ListMeta: obj.(*v1beta1.UpgradeList).ListMeta} + for _, item := range obj.(*v1beta1.UpgradeList).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 upgrades. +func (c *FakeUpgrades) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(upgradesResource, c.ns, opts)) + +} + +// Create takes the representation of a upgrade and creates it. Returns the server's representation of the upgrade, and an error, if there is any. +func (c *FakeUpgrades) Create(ctx context.Context, upgrade *v1beta1.Upgrade, opts v1.CreateOptions) (result *v1beta1.Upgrade, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(upgradesResource, c.ns, upgrade), &v1beta1.Upgrade{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Upgrade), err +} + +// Update takes the representation of a upgrade and updates it. Returns the server's representation of the upgrade, and an error, if there is any. +func (c *FakeUpgrades) Update(ctx context.Context, upgrade *v1beta1.Upgrade, opts v1.UpdateOptions) (result *v1beta1.Upgrade, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(upgradesResource, c.ns, upgrade), &v1beta1.Upgrade{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Upgrade), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeUpgrades) UpdateStatus(ctx context.Context, upgrade *v1beta1.Upgrade, opts v1.UpdateOptions) (*v1beta1.Upgrade, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(upgradesResource, "status", c.ns, upgrade), &v1beta1.Upgrade{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Upgrade), err +} + +// Delete takes name of the upgrade and deletes it. Returns an error if one occurs. +func (c *FakeUpgrades) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(upgradesResource, c.ns, name, opts), &v1beta1.Upgrade{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUpgrades) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(upgradesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.UpgradeList{}) + return err +} + +// Patch applies the patch and returns the patched upgrade. +func (c *FakeUpgrades) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Upgrade, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(upgradesResource, c.ns, name, pt, data, subresources...), &v1beta1.Upgrade{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Upgrade), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_upgradelog.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_upgradelog.go new file mode 100644 index 00000000..26fda404 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_upgradelog.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeUpgradeLogs implements UpgradeLogInterface +type FakeUpgradeLogs struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var upgradelogsResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "upgradelogs"} + +var upgradelogsKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "UpgradeLog"} + +// Get takes name of the upgradeLog, and returns the corresponding upgradeLog object, and an error if there is any. +func (c *FakeUpgradeLogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.UpgradeLog, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(upgradelogsResource, c.ns, name), &v1beta1.UpgradeLog{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UpgradeLog), err +} + +// List takes label and field selectors, and returns the list of UpgradeLogs that match those selectors. +func (c *FakeUpgradeLogs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.UpgradeLogList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(upgradelogsResource, upgradelogsKind, c.ns, opts), &v1beta1.UpgradeLogList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.UpgradeLogList{ListMeta: obj.(*v1beta1.UpgradeLogList).ListMeta} + for _, item := range obj.(*v1beta1.UpgradeLogList).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 upgradeLogs. +func (c *FakeUpgradeLogs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(upgradelogsResource, c.ns, opts)) + +} + +// Create takes the representation of a upgradeLog and creates it. Returns the server's representation of the upgradeLog, and an error, if there is any. +func (c *FakeUpgradeLogs) Create(ctx context.Context, upgradeLog *v1beta1.UpgradeLog, opts v1.CreateOptions) (result *v1beta1.UpgradeLog, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(upgradelogsResource, c.ns, upgradeLog), &v1beta1.UpgradeLog{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UpgradeLog), err +} + +// Update takes the representation of a upgradeLog and updates it. Returns the server's representation of the upgradeLog, and an error, if there is any. +func (c *FakeUpgradeLogs) Update(ctx context.Context, upgradeLog *v1beta1.UpgradeLog, opts v1.UpdateOptions) (result *v1beta1.UpgradeLog, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(upgradelogsResource, c.ns, upgradeLog), &v1beta1.UpgradeLog{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UpgradeLog), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeUpgradeLogs) UpdateStatus(ctx context.Context, upgradeLog *v1beta1.UpgradeLog, opts v1.UpdateOptions) (*v1beta1.UpgradeLog, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(upgradelogsResource, "status", c.ns, upgradeLog), &v1beta1.UpgradeLog{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UpgradeLog), err +} + +// Delete takes name of the upgradeLog and deletes it. Returns an error if one occurs. +func (c *FakeUpgradeLogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(upgradelogsResource, c.ns, name, opts), &v1beta1.UpgradeLog{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUpgradeLogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(upgradelogsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.UpgradeLogList{}) + return err +} + +// Patch applies the patch and returns the patched upgradeLog. +func (c *FakeUpgradeLogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.UpgradeLog, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(upgradelogsResource, c.ns, name, pt, data, subresources...), &v1beta1.UpgradeLog{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.UpgradeLog), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_version.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_version.go new file mode 100644 index 00000000..77c6762f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_version.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVersions implements VersionInterface +type FakeVersions struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var versionsResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "versions"} + +var versionsKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "Version"} + +// Get takes name of the version, and returns the corresponding version object, and an error if there is any. +func (c *FakeVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Version, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(versionsResource, c.ns, name), &v1beta1.Version{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Version), err +} + +// List takes label and field selectors, and returns the list of Versions that match those selectors. +func (c *FakeVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(versionsResource, versionsKind, c.ns, opts), &v1beta1.VersionList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VersionList{ListMeta: obj.(*v1beta1.VersionList).ListMeta} + for _, item := range obj.(*v1beta1.VersionList).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 versions. +func (c *FakeVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(versionsResource, c.ns, opts)) + +} + +// Create takes the representation of a version and creates it. Returns the server's representation of the version, and an error, if there is any. +func (c *FakeVersions) Create(ctx context.Context, version *v1beta1.Version, opts v1.CreateOptions) (result *v1beta1.Version, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(versionsResource, c.ns, version), &v1beta1.Version{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Version), err +} + +// Update takes the representation of a version and updates it. Returns the server's representation of the version, and an error, if there is any. +func (c *FakeVersions) Update(ctx context.Context, version *v1beta1.Version, opts v1.UpdateOptions) (result *v1beta1.Version, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(versionsResource, c.ns, version), &v1beta1.Version{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Version), err +} + +// Delete takes name of the version and deletes it. Returns an error if one occurs. +func (c *FakeVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(versionsResource, c.ns, name, opts), &v1beta1.Version{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(versionsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VersionList{}) + return err +} + +// Patch applies the patch and returns the patched version. +func (c *FakeVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Version, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(versionsResource, c.ns, name, pt, data, subresources...), &v1beta1.Version{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Version), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinebackup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinebackup.go new file mode 100644 index 00000000..52c2ce6c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinebackup.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVirtualMachineBackups implements VirtualMachineBackupInterface +type FakeVirtualMachineBackups struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var virtualmachinebackupsResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "virtualmachinebackups"} + +var virtualmachinebackupsKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "VirtualMachineBackup"} + +// Get takes name of the virtualMachineBackup, and returns the corresponding virtualMachineBackup object, and an error if there is any. +func (c *FakeVirtualMachineBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineBackup, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachinebackupsResource, c.ns, name), &v1beta1.VirtualMachineBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineBackup), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineBackups that match those selectors. +func (c *FakeVirtualMachineBackups) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineBackupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachinebackupsResource, virtualmachinebackupsKind, c.ns, opts), &v1beta1.VirtualMachineBackupList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VirtualMachineBackupList{ListMeta: obj.(*v1beta1.VirtualMachineBackupList).ListMeta} + for _, item := range obj.(*v1beta1.VirtualMachineBackupList).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 virtualMachineBackups. +func (c *FakeVirtualMachineBackups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachinebackupsResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineBackup and creates it. Returns the server's representation of the virtualMachineBackup, and an error, if there is any. +func (c *FakeVirtualMachineBackups) Create(ctx context.Context, virtualMachineBackup *v1beta1.VirtualMachineBackup, opts v1.CreateOptions) (result *v1beta1.VirtualMachineBackup, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachinebackupsResource, c.ns, virtualMachineBackup), &v1beta1.VirtualMachineBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineBackup), err +} + +// Update takes the representation of a virtualMachineBackup and updates it. Returns the server's representation of the virtualMachineBackup, and an error, if there is any. +func (c *FakeVirtualMachineBackups) Update(ctx context.Context, virtualMachineBackup *v1beta1.VirtualMachineBackup, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineBackup, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachinebackupsResource, c.ns, virtualMachineBackup), &v1beta1.VirtualMachineBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineBackup), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualMachineBackups) UpdateStatus(ctx context.Context, virtualMachineBackup *v1beta1.VirtualMachineBackup, opts v1.UpdateOptions) (*v1beta1.VirtualMachineBackup, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachinebackupsResource, "status", c.ns, virtualMachineBackup), &v1beta1.VirtualMachineBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineBackup), err +} + +// Delete takes name of the virtualMachineBackup and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineBackups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachinebackupsResource, c.ns, name, opts), &v1beta1.VirtualMachineBackup{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachinebackupsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VirtualMachineBackupList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineBackup. +func (c *FakeVirtualMachineBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineBackup, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachinebackupsResource, c.ns, name, pt, data, subresources...), &v1beta1.VirtualMachineBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineBackup), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachineimage.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachineimage.go new file mode 100644 index 00000000..38c4111c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachineimage.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVirtualMachineImages implements VirtualMachineImageInterface +type FakeVirtualMachineImages struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var virtualmachineimagesResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "virtualmachineimages"} + +var virtualmachineimagesKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "VirtualMachineImage"} + +// Get takes name of the virtualMachineImage, and returns the corresponding virtualMachineImage object, and an error if there is any. +func (c *FakeVirtualMachineImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachineimagesResource, c.ns, name), &v1beta1.VirtualMachineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImage), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineImages that match those selectors. +func (c *FakeVirtualMachineImages) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineImageList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachineimagesResource, virtualmachineimagesKind, c.ns, opts), &v1beta1.VirtualMachineImageList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VirtualMachineImageList{ListMeta: obj.(*v1beta1.VirtualMachineImageList).ListMeta} + for _, item := range obj.(*v1beta1.VirtualMachineImageList).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 virtualMachineImages. +func (c *FakeVirtualMachineImages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachineimagesResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineImage and creates it. Returns the server's representation of the virtualMachineImage, and an error, if there is any. +func (c *FakeVirtualMachineImages) Create(ctx context.Context, virtualMachineImage *v1beta1.VirtualMachineImage, opts v1.CreateOptions) (result *v1beta1.VirtualMachineImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachineimagesResource, c.ns, virtualMachineImage), &v1beta1.VirtualMachineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImage), err +} + +// Update takes the representation of a virtualMachineImage and updates it. Returns the server's representation of the virtualMachineImage, and an error, if there is any. +func (c *FakeVirtualMachineImages) Update(ctx context.Context, virtualMachineImage *v1beta1.VirtualMachineImage, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachineimagesResource, c.ns, virtualMachineImage), &v1beta1.VirtualMachineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImage), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualMachineImages) UpdateStatus(ctx context.Context, virtualMachineImage *v1beta1.VirtualMachineImage, opts v1.UpdateOptions) (*v1beta1.VirtualMachineImage, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachineimagesResource, "status", c.ns, virtualMachineImage), &v1beta1.VirtualMachineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImage), err +} + +// Delete takes name of the virtualMachineImage and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachineimagesResource, c.ns, name, opts), &v1beta1.VirtualMachineImage{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachineimagesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VirtualMachineImageList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineImage. +func (c *FakeVirtualMachineImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachineimagesResource, c.ns, name, pt, data, subresources...), &v1beta1.VirtualMachineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineImage), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinerestore.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinerestore.go new file mode 100644 index 00000000..92877e18 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinerestore.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVirtualMachineRestores implements VirtualMachineRestoreInterface +type FakeVirtualMachineRestores struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var virtualmachinerestoresResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "virtualmachinerestores"} + +var virtualmachinerestoresKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "VirtualMachineRestore"} + +// Get takes name of the virtualMachineRestore, and returns the corresponding virtualMachineRestore object, and an error if there is any. +func (c *FakeVirtualMachineRestores) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineRestore, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachinerestoresResource, c.ns, name), &v1beta1.VirtualMachineRestore{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineRestore), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineRestores that match those selectors. +func (c *FakeVirtualMachineRestores) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineRestoreList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachinerestoresResource, virtualmachinerestoresKind, c.ns, opts), &v1beta1.VirtualMachineRestoreList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VirtualMachineRestoreList{ListMeta: obj.(*v1beta1.VirtualMachineRestoreList).ListMeta} + for _, item := range obj.(*v1beta1.VirtualMachineRestoreList).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 virtualMachineRestores. +func (c *FakeVirtualMachineRestores) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachinerestoresResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineRestore and creates it. Returns the server's representation of the virtualMachineRestore, and an error, if there is any. +func (c *FakeVirtualMachineRestores) Create(ctx context.Context, virtualMachineRestore *v1beta1.VirtualMachineRestore, opts v1.CreateOptions) (result *v1beta1.VirtualMachineRestore, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachinerestoresResource, c.ns, virtualMachineRestore), &v1beta1.VirtualMachineRestore{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineRestore), err +} + +// Update takes the representation of a virtualMachineRestore and updates it. Returns the server's representation of the virtualMachineRestore, and an error, if there is any. +func (c *FakeVirtualMachineRestores) Update(ctx context.Context, virtualMachineRestore *v1beta1.VirtualMachineRestore, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineRestore, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachinerestoresResource, c.ns, virtualMachineRestore), &v1beta1.VirtualMachineRestore{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineRestore), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualMachineRestores) UpdateStatus(ctx context.Context, virtualMachineRestore *v1beta1.VirtualMachineRestore, opts v1.UpdateOptions) (*v1beta1.VirtualMachineRestore, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachinerestoresResource, "status", c.ns, virtualMachineRestore), &v1beta1.VirtualMachineRestore{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineRestore), err +} + +// Delete takes name of the virtualMachineRestore and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineRestores) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachinerestoresResource, c.ns, name, opts), &v1beta1.VirtualMachineRestore{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineRestores) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachinerestoresResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VirtualMachineRestoreList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineRestore. +func (c *FakeVirtualMachineRestores) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineRestore, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachinerestoresResource, c.ns, name, pt, data, subresources...), &v1beta1.VirtualMachineRestore{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineRestore), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinetemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinetemplate.go new file mode 100644 index 00000000..9792bb3d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinetemplate.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVirtualMachineTemplates implements VirtualMachineTemplateInterface +type FakeVirtualMachineTemplates struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var virtualmachinetemplatesResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "virtualmachinetemplates"} + +var virtualmachinetemplatesKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "VirtualMachineTemplate"} + +// Get takes name of the virtualMachineTemplate, and returns the corresponding virtualMachineTemplate object, and an error if there is any. +func (c *FakeVirtualMachineTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachinetemplatesResource, c.ns, name), &v1beta1.VirtualMachineTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplate), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineTemplates that match those selectors. +func (c *FakeVirtualMachineTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachinetemplatesResource, virtualmachinetemplatesKind, c.ns, opts), &v1beta1.VirtualMachineTemplateList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VirtualMachineTemplateList{ListMeta: obj.(*v1beta1.VirtualMachineTemplateList).ListMeta} + for _, item := range obj.(*v1beta1.VirtualMachineTemplateList).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 virtualMachineTemplates. +func (c *FakeVirtualMachineTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachinetemplatesResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineTemplate and creates it. Returns the server's representation of the virtualMachineTemplate, and an error, if there is any. +func (c *FakeVirtualMachineTemplates) Create(ctx context.Context, virtualMachineTemplate *v1beta1.VirtualMachineTemplate, opts v1.CreateOptions) (result *v1beta1.VirtualMachineTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachinetemplatesResource, c.ns, virtualMachineTemplate), &v1beta1.VirtualMachineTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplate), err +} + +// Update takes the representation of a virtualMachineTemplate and updates it. Returns the server's representation of the virtualMachineTemplate, and an error, if there is any. +func (c *FakeVirtualMachineTemplates) Update(ctx context.Context, virtualMachineTemplate *v1beta1.VirtualMachineTemplate, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachinetemplatesResource, c.ns, virtualMachineTemplate), &v1beta1.VirtualMachineTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplate), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualMachineTemplates) UpdateStatus(ctx context.Context, virtualMachineTemplate *v1beta1.VirtualMachineTemplate, opts v1.UpdateOptions) (*v1beta1.VirtualMachineTemplate, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachinetemplatesResource, "status", c.ns, virtualMachineTemplate), &v1beta1.VirtualMachineTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplate), err +} + +// Delete takes name of the virtualMachineTemplate and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachinetemplatesResource, c.ns, name, opts), &v1beta1.VirtualMachineTemplate{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachinetemplatesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VirtualMachineTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineTemplate. +func (c *FakeVirtualMachineTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachinetemplatesResource, c.ns, name, pt, data, subresources...), &v1beta1.VirtualMachineTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplate), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinetemplateversion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinetemplateversion.go new file mode 100644 index 00000000..a736be3b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/fake/fake_virtualmachinetemplateversion.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVirtualMachineTemplateVersions implements VirtualMachineTemplateVersionInterface +type FakeVirtualMachineTemplateVersions struct { + Fake *FakeHarvesterhciV1beta1 + ns string +} + +var virtualmachinetemplateversionsResource = schema.GroupVersionResource{Group: "harvesterhci.io", Version: "v1beta1", Resource: "virtualmachinetemplateversions"} + +var virtualmachinetemplateversionsKind = schema.GroupVersionKind{Group: "harvesterhci.io", Version: "v1beta1", Kind: "VirtualMachineTemplateVersion"} + +// Get takes name of the virtualMachineTemplateVersion, and returns the corresponding virtualMachineTemplateVersion object, and an error if there is any. +func (c *FakeVirtualMachineTemplateVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineTemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachinetemplateversionsResource, c.ns, name), &v1beta1.VirtualMachineTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplateVersion), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineTemplateVersions that match those selectors. +func (c *FakeVirtualMachineTemplateVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineTemplateVersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachinetemplateversionsResource, virtualmachinetemplateversionsKind, c.ns, opts), &v1beta1.VirtualMachineTemplateVersionList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VirtualMachineTemplateVersionList{ListMeta: obj.(*v1beta1.VirtualMachineTemplateVersionList).ListMeta} + for _, item := range obj.(*v1beta1.VirtualMachineTemplateVersionList).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 virtualMachineTemplateVersions. +func (c *FakeVirtualMachineTemplateVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachinetemplateversionsResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineTemplateVersion and creates it. Returns the server's representation of the virtualMachineTemplateVersion, and an error, if there is any. +func (c *FakeVirtualMachineTemplateVersions) Create(ctx context.Context, virtualMachineTemplateVersion *v1beta1.VirtualMachineTemplateVersion, opts v1.CreateOptions) (result *v1beta1.VirtualMachineTemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachinetemplateversionsResource, c.ns, virtualMachineTemplateVersion), &v1beta1.VirtualMachineTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplateVersion), err +} + +// Update takes the representation of a virtualMachineTemplateVersion and updates it. Returns the server's representation of the virtualMachineTemplateVersion, and an error, if there is any. +func (c *FakeVirtualMachineTemplateVersions) Update(ctx context.Context, virtualMachineTemplateVersion *v1beta1.VirtualMachineTemplateVersion, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineTemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachinetemplateversionsResource, c.ns, virtualMachineTemplateVersion), &v1beta1.VirtualMachineTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplateVersion), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualMachineTemplateVersions) UpdateStatus(ctx context.Context, virtualMachineTemplateVersion *v1beta1.VirtualMachineTemplateVersion, opts v1.UpdateOptions) (*v1beta1.VirtualMachineTemplateVersion, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachinetemplateversionsResource, "status", c.ns, virtualMachineTemplateVersion), &v1beta1.VirtualMachineTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplateVersion), err +} + +// Delete takes name of the virtualMachineTemplateVersion and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineTemplateVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachinetemplateversionsResource, c.ns, name, opts), &v1beta1.VirtualMachineTemplateVersion{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineTemplateVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachinetemplateversionsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VirtualMachineTemplateVersionList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineTemplateVersion. +func (c *FakeVirtualMachineTemplateVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineTemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachinetemplateversionsResource, c.ns, name, pt, data, subresources...), &v1beta1.VirtualMachineTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VirtualMachineTemplateVersion), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/generated_expansion.go new file mode 100644 index 00000000..9eb627ef --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/generated_expansion.go @@ -0,0 +1,45 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +type AddonExpansion interface{} + +type KeyPairExpansion interface{} + +type PreferenceExpansion interface{} + +type SettingExpansion interface{} + +type SupportBundleExpansion interface{} + +type UpgradeExpansion interface{} + +type UpgradeLogExpansion interface{} + +type VersionExpansion interface{} + +type VirtualMachineBackupExpansion interface{} + +type VirtualMachineImageExpansion interface{} + +type VirtualMachineRestoreExpansion interface{} + +type VirtualMachineTemplateExpansion interface{} + +type VirtualMachineTemplateVersionExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/harvesterhci.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/harvesterhci.io_client.go new file mode 100644 index 00000000..73a74489 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/harvesterhci.io_client.go @@ -0,0 +1,167 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "net/http" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type HarvesterhciV1beta1Interface interface { + RESTClient() rest.Interface + AddonsGetter + KeyPairsGetter + PreferencesGetter + SettingsGetter + SupportBundlesGetter + UpgradesGetter + UpgradeLogsGetter + VersionsGetter + VirtualMachineBackupsGetter + VirtualMachineImagesGetter + VirtualMachineRestoresGetter + VirtualMachineTemplatesGetter + VirtualMachineTemplateVersionsGetter +} + +// HarvesterhciV1beta1Client is used to interact with features provided by the harvesterhci.io group. +type HarvesterhciV1beta1Client struct { + restClient rest.Interface +} + +func (c *HarvesterhciV1beta1Client) Addons(namespace string) AddonInterface { + return newAddons(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) KeyPairs(namespace string) KeyPairInterface { + return newKeyPairs(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) Preferences(namespace string) PreferenceInterface { + return newPreferences(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) Settings() SettingInterface { + return newSettings(c) +} + +func (c *HarvesterhciV1beta1Client) SupportBundles(namespace string) SupportBundleInterface { + return newSupportBundles(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) Upgrades(namespace string) UpgradeInterface { + return newUpgrades(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) UpgradeLogs(namespace string) UpgradeLogInterface { + return newUpgradeLogs(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) Versions(namespace string) VersionInterface { + return newVersions(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) VirtualMachineBackups(namespace string) VirtualMachineBackupInterface { + return newVirtualMachineBackups(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) VirtualMachineImages(namespace string) VirtualMachineImageInterface { + return newVirtualMachineImages(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) VirtualMachineRestores(namespace string) VirtualMachineRestoreInterface { + return newVirtualMachineRestores(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) VirtualMachineTemplates(namespace string) VirtualMachineTemplateInterface { + return newVirtualMachineTemplates(c, namespace) +} + +func (c *HarvesterhciV1beta1Client) VirtualMachineTemplateVersions(namespace string) VirtualMachineTemplateVersionInterface { + return newVirtualMachineTemplateVersions(c, namespace) +} + +// NewForConfig creates a new HarvesterhciV1beta1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*HarvesterhciV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new HarvesterhciV1beta1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*HarvesterhciV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &HarvesterhciV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new HarvesterhciV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *HarvesterhciV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new HarvesterhciV1beta1Client for the given RESTClient. +func New(c rest.Interface) *HarvesterhciV1beta1Client { + return &HarvesterhciV1beta1Client{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 *HarvesterhciV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/keypair.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/keypair.go new file mode 100644 index 00000000..231dd8d8 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/keypair.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// KeyPairsGetter has a method to return a KeyPairInterface. +// A group's client should implement this interface. +type KeyPairsGetter interface { + KeyPairs(namespace string) KeyPairInterface +} + +// KeyPairInterface has methods to work with KeyPair resources. +type KeyPairInterface interface { + Create(ctx context.Context, keyPair *v1beta1.KeyPair, opts v1.CreateOptions) (*v1beta1.KeyPair, error) + Update(ctx context.Context, keyPair *v1beta1.KeyPair, opts v1.UpdateOptions) (*v1beta1.KeyPair, error) + UpdateStatus(ctx context.Context, keyPair *v1beta1.KeyPair, opts v1.UpdateOptions) (*v1beta1.KeyPair, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.KeyPair, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.KeyPairList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.KeyPair, err error) + KeyPairExpansion +} + +// keyPairs implements KeyPairInterface +type keyPairs struct { + client rest.Interface + ns string +} + +// newKeyPairs returns a KeyPairs +func newKeyPairs(c *HarvesterhciV1beta1Client, namespace string) *keyPairs { + return &keyPairs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the keyPair, and returns the corresponding keyPair object, and an error if there is any. +func (c *keyPairs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.KeyPair, err error) { + result = &v1beta1.KeyPair{} + err = c.client.Get(). + Namespace(c.ns). + Resource("keypairs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of KeyPairs that match those selectors. +func (c *keyPairs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.KeyPairList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.KeyPairList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("keypairs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested keyPairs. +func (c *keyPairs) Watch(ctx context.Context, 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("keypairs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a keyPair and creates it. Returns the server's representation of the keyPair, and an error, if there is any. +func (c *keyPairs) Create(ctx context.Context, keyPair *v1beta1.KeyPair, opts v1.CreateOptions) (result *v1beta1.KeyPair, err error) { + result = &v1beta1.KeyPair{} + err = c.client.Post(). + Namespace(c.ns). + Resource("keypairs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(keyPair). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a keyPair and updates it. Returns the server's representation of the keyPair, and an error, if there is any. +func (c *keyPairs) Update(ctx context.Context, keyPair *v1beta1.KeyPair, opts v1.UpdateOptions) (result *v1beta1.KeyPair, err error) { + result = &v1beta1.KeyPair{} + err = c.client.Put(). + Namespace(c.ns). + Resource("keypairs"). + Name(keyPair.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(keyPair). + Do(ctx). + 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 *keyPairs) UpdateStatus(ctx context.Context, keyPair *v1beta1.KeyPair, opts v1.UpdateOptions) (result *v1beta1.KeyPair, err error) { + result = &v1beta1.KeyPair{} + err = c.client.Put(). + Namespace(c.ns). + Resource("keypairs"). + Name(keyPair.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(keyPair). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the keyPair and deletes it. Returns an error if one occurs. +func (c *keyPairs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("keypairs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *keyPairs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("keypairs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched keyPair. +func (c *keyPairs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.KeyPair, err error) { + result = &v1beta1.KeyPair{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("keypairs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/preference.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/preference.go new file mode 100644 index 00000000..c87ceb03 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/preference.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// PreferencesGetter has a method to return a PreferenceInterface. +// A group's client should implement this interface. +type PreferencesGetter interface { + Preferences(namespace string) PreferenceInterface +} + +// PreferenceInterface has methods to work with Preference resources. +type PreferenceInterface interface { + Create(ctx context.Context, preference *v1beta1.Preference, opts v1.CreateOptions) (*v1beta1.Preference, error) + Update(ctx context.Context, preference *v1beta1.Preference, opts v1.UpdateOptions) (*v1beta1.Preference, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Preference, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.PreferenceList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Preference, err error) + PreferenceExpansion +} + +// preferences implements PreferenceInterface +type preferences struct { + client rest.Interface + ns string +} + +// newPreferences returns a Preferences +func newPreferences(c *HarvesterhciV1beta1Client, namespace string) *preferences { + return &preferences{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the preference, and returns the corresponding preference object, and an error if there is any. +func (c *preferences) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Preference, err error) { + result = &v1beta1.Preference{} + err = c.client.Get(). + Namespace(c.ns). + Resource("preferences"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Preferences that match those selectors. +func (c *preferences) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.PreferenceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.PreferenceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("preferences"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested preferences. +func (c *preferences) Watch(ctx context.Context, 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("preferences"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a preference and creates it. Returns the server's representation of the preference, and an error, if there is any. +func (c *preferences) Create(ctx context.Context, preference *v1beta1.Preference, opts v1.CreateOptions) (result *v1beta1.Preference, err error) { + result = &v1beta1.Preference{} + err = c.client.Post(). + Namespace(c.ns). + Resource("preferences"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(preference). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a preference and updates it. Returns the server's representation of the preference, and an error, if there is any. +func (c *preferences) Update(ctx context.Context, preference *v1beta1.Preference, opts v1.UpdateOptions) (result *v1beta1.Preference, err error) { + result = &v1beta1.Preference{} + err = c.client.Put(). + Namespace(c.ns). + Resource("preferences"). + Name(preference.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(preference). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the preference and deletes it. Returns an error if one occurs. +func (c *preferences) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("preferences"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *preferences) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("preferences"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched preference. +func (c *preferences) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Preference, err error) { + result = &v1beta1.Preference{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("preferences"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/setting.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/setting.go new file mode 100644 index 00000000..cf049967 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/setting.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// SettingsGetter has a method to return a SettingInterface. +// A group's client should implement this interface. +type SettingsGetter interface { + Settings() SettingInterface +} + +// SettingInterface has methods to work with Setting resources. +type SettingInterface interface { + Create(ctx context.Context, setting *v1beta1.Setting, opts v1.CreateOptions) (*v1beta1.Setting, error) + Update(ctx context.Context, setting *v1beta1.Setting, opts v1.UpdateOptions) (*v1beta1.Setting, error) + UpdateStatus(ctx context.Context, setting *v1beta1.Setting, opts v1.UpdateOptions) (*v1beta1.Setting, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Setting, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.SettingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Setting, err error) + SettingExpansion +} + +// settings implements SettingInterface +type settings struct { + client rest.Interface +} + +// newSettings returns a Settings +func newSettings(c *HarvesterhciV1beta1Client) *settings { + return &settings{ + client: c.RESTClient(), + } +} + +// Get takes name of the setting, and returns the corresponding setting object, and an error if there is any. +func (c *settings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Setting, err error) { + result = &v1beta1.Setting{} + err = c.client.Get(). + Resource("settings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Settings that match those selectors. +func (c *settings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SettingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.SettingList{} + err = c.client.Get(). + Resource("settings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested settings. +func (c *settings) Watch(ctx context.Context, 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(). + Resource("settings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a setting and creates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *settings) Create(ctx context.Context, setting *v1beta1.Setting, opts v1.CreateOptions) (result *v1beta1.Setting, err error) { + result = &v1beta1.Setting{} + err = c.client.Post(). + Resource("settings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(setting). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a setting and updates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *settings) Update(ctx context.Context, setting *v1beta1.Setting, opts v1.UpdateOptions) (result *v1beta1.Setting, err error) { + result = &v1beta1.Setting{} + err = c.client.Put(). + Resource("settings"). + Name(setting.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(setting). + Do(ctx). + 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 *settings) UpdateStatus(ctx context.Context, setting *v1beta1.Setting, opts v1.UpdateOptions) (result *v1beta1.Setting, err error) { + result = &v1beta1.Setting{} + err = c.client.Put(). + Resource("settings"). + Name(setting.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(setting). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the setting and deletes it. Returns an error if one occurs. +func (c *settings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("settings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *settings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("settings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched setting. +func (c *settings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Setting, err error) { + result = &v1beta1.Setting{} + err = c.client.Patch(pt). + Resource("settings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/supportbundle.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/supportbundle.go new file mode 100644 index 00000000..518326fd --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/supportbundle.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// SupportBundlesGetter has a method to return a SupportBundleInterface. +// A group's client should implement this interface. +type SupportBundlesGetter interface { + SupportBundles(namespace string) SupportBundleInterface +} + +// SupportBundleInterface has methods to work with SupportBundle resources. +type SupportBundleInterface interface { + Create(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.CreateOptions) (*v1beta1.SupportBundle, error) + Update(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (*v1beta1.SupportBundle, error) + UpdateStatus(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (*v1beta1.SupportBundle, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.SupportBundle, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.SupportBundleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SupportBundle, err error) + SupportBundleExpansion +} + +// supportBundles implements SupportBundleInterface +type supportBundles struct { + client rest.Interface + ns string +} + +// newSupportBundles returns a SupportBundles +func newSupportBundles(c *HarvesterhciV1beta1Client, namespace string) *supportBundles { + return &supportBundles{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the supportBundle, and returns the corresponding supportBundle object, and an error if there is any. +func (c *supportBundles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.SupportBundle, err error) { + result = &v1beta1.SupportBundle{} + err = c.client.Get(). + Namespace(c.ns). + Resource("supportbundles"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SupportBundles that match those selectors. +func (c *supportBundles) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SupportBundleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.SupportBundleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("supportbundles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested supportBundles. +func (c *supportBundles) Watch(ctx context.Context, 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("supportbundles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a supportBundle and creates it. Returns the server's representation of the supportBundle, and an error, if there is any. +func (c *supportBundles) Create(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.CreateOptions) (result *v1beta1.SupportBundle, err error) { + result = &v1beta1.SupportBundle{} + err = c.client.Post(). + Namespace(c.ns). + Resource("supportbundles"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(supportBundle). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a supportBundle and updates it. Returns the server's representation of the supportBundle, and an error, if there is any. +func (c *supportBundles) Update(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (result *v1beta1.SupportBundle, err error) { + result = &v1beta1.SupportBundle{} + err = c.client.Put(). + Namespace(c.ns). + Resource("supportbundles"). + Name(supportBundle.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(supportBundle). + Do(ctx). + 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 *supportBundles) UpdateStatus(ctx context.Context, supportBundle *v1beta1.SupportBundle, opts v1.UpdateOptions) (result *v1beta1.SupportBundle, err error) { + result = &v1beta1.SupportBundle{} + err = c.client.Put(). + Namespace(c.ns). + Resource("supportbundles"). + Name(supportBundle.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(supportBundle). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the supportBundle and deletes it. Returns an error if one occurs. +func (c *supportBundles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("supportbundles"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *supportBundles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("supportbundles"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched supportBundle. +func (c *supportBundles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.SupportBundle, err error) { + result = &v1beta1.SupportBundle{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("supportbundles"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/upgrade.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/upgrade.go new file mode 100644 index 00000000..34ac80ed --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/upgrade.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// UpgradesGetter has a method to return a UpgradeInterface. +// A group's client should implement this interface. +type UpgradesGetter interface { + Upgrades(namespace string) UpgradeInterface +} + +// UpgradeInterface has methods to work with Upgrade resources. +type UpgradeInterface interface { + Create(ctx context.Context, upgrade *v1beta1.Upgrade, opts v1.CreateOptions) (*v1beta1.Upgrade, error) + Update(ctx context.Context, upgrade *v1beta1.Upgrade, opts v1.UpdateOptions) (*v1beta1.Upgrade, error) + UpdateStatus(ctx context.Context, upgrade *v1beta1.Upgrade, opts v1.UpdateOptions) (*v1beta1.Upgrade, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Upgrade, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.UpgradeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Upgrade, err error) + UpgradeExpansion +} + +// upgrades implements UpgradeInterface +type upgrades struct { + client rest.Interface + ns string +} + +// newUpgrades returns a Upgrades +func newUpgrades(c *HarvesterhciV1beta1Client, namespace string) *upgrades { + return &upgrades{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the upgrade, and returns the corresponding upgrade object, and an error if there is any. +func (c *upgrades) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Upgrade, err error) { + result = &v1beta1.Upgrade{} + err = c.client.Get(). + Namespace(c.ns). + Resource("upgrades"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Upgrades that match those selectors. +func (c *upgrades) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.UpgradeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.UpgradeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("upgrades"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested upgrades. +func (c *upgrades) Watch(ctx context.Context, 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("upgrades"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a upgrade and creates it. Returns the server's representation of the upgrade, and an error, if there is any. +func (c *upgrades) Create(ctx context.Context, upgrade *v1beta1.Upgrade, opts v1.CreateOptions) (result *v1beta1.Upgrade, err error) { + result = &v1beta1.Upgrade{} + err = c.client.Post(). + Namespace(c.ns). + Resource("upgrades"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(upgrade). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a upgrade and updates it. Returns the server's representation of the upgrade, and an error, if there is any. +func (c *upgrades) Update(ctx context.Context, upgrade *v1beta1.Upgrade, opts v1.UpdateOptions) (result *v1beta1.Upgrade, err error) { + result = &v1beta1.Upgrade{} + err = c.client.Put(). + Namespace(c.ns). + Resource("upgrades"). + Name(upgrade.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(upgrade). + Do(ctx). + 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 *upgrades) UpdateStatus(ctx context.Context, upgrade *v1beta1.Upgrade, opts v1.UpdateOptions) (result *v1beta1.Upgrade, err error) { + result = &v1beta1.Upgrade{} + err = c.client.Put(). + Namespace(c.ns). + Resource("upgrades"). + Name(upgrade.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(upgrade). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the upgrade and deletes it. Returns an error if one occurs. +func (c *upgrades) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("upgrades"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *upgrades) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("upgrades"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched upgrade. +func (c *upgrades) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Upgrade, err error) { + result = &v1beta1.Upgrade{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("upgrades"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/upgradelog.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/upgradelog.go new file mode 100644 index 00000000..fc0da7d7 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/upgradelog.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// UpgradeLogsGetter has a method to return a UpgradeLogInterface. +// A group's client should implement this interface. +type UpgradeLogsGetter interface { + UpgradeLogs(namespace string) UpgradeLogInterface +} + +// UpgradeLogInterface has methods to work with UpgradeLog resources. +type UpgradeLogInterface interface { + Create(ctx context.Context, upgradeLog *v1beta1.UpgradeLog, opts v1.CreateOptions) (*v1beta1.UpgradeLog, error) + Update(ctx context.Context, upgradeLog *v1beta1.UpgradeLog, opts v1.UpdateOptions) (*v1beta1.UpgradeLog, error) + UpdateStatus(ctx context.Context, upgradeLog *v1beta1.UpgradeLog, opts v1.UpdateOptions) (*v1beta1.UpgradeLog, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.UpgradeLog, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.UpgradeLogList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.UpgradeLog, err error) + UpgradeLogExpansion +} + +// upgradeLogs implements UpgradeLogInterface +type upgradeLogs struct { + client rest.Interface + ns string +} + +// newUpgradeLogs returns a UpgradeLogs +func newUpgradeLogs(c *HarvesterhciV1beta1Client, namespace string) *upgradeLogs { + return &upgradeLogs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the upgradeLog, and returns the corresponding upgradeLog object, and an error if there is any. +func (c *upgradeLogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.UpgradeLog, err error) { + result = &v1beta1.UpgradeLog{} + err = c.client.Get(). + Namespace(c.ns). + Resource("upgradelogs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of UpgradeLogs that match those selectors. +func (c *upgradeLogs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.UpgradeLogList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.UpgradeLogList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("upgradelogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested upgradeLogs. +func (c *upgradeLogs) Watch(ctx context.Context, 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("upgradelogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a upgradeLog and creates it. Returns the server's representation of the upgradeLog, and an error, if there is any. +func (c *upgradeLogs) Create(ctx context.Context, upgradeLog *v1beta1.UpgradeLog, opts v1.CreateOptions) (result *v1beta1.UpgradeLog, err error) { + result = &v1beta1.UpgradeLog{} + err = c.client.Post(). + Namespace(c.ns). + Resource("upgradelogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(upgradeLog). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a upgradeLog and updates it. Returns the server's representation of the upgradeLog, and an error, if there is any. +func (c *upgradeLogs) Update(ctx context.Context, upgradeLog *v1beta1.UpgradeLog, opts v1.UpdateOptions) (result *v1beta1.UpgradeLog, err error) { + result = &v1beta1.UpgradeLog{} + err = c.client.Put(). + Namespace(c.ns). + Resource("upgradelogs"). + Name(upgradeLog.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(upgradeLog). + Do(ctx). + 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 *upgradeLogs) UpdateStatus(ctx context.Context, upgradeLog *v1beta1.UpgradeLog, opts v1.UpdateOptions) (result *v1beta1.UpgradeLog, err error) { + result = &v1beta1.UpgradeLog{} + err = c.client.Put(). + Namespace(c.ns). + Resource("upgradelogs"). + Name(upgradeLog.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(upgradeLog). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the upgradeLog and deletes it. Returns an error if one occurs. +func (c *upgradeLogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("upgradelogs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *upgradeLogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("upgradelogs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched upgradeLog. +func (c *upgradeLogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.UpgradeLog, err error) { + result = &v1beta1.UpgradeLog{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("upgradelogs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/version.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/version.go new file mode 100644 index 00000000..48163878 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/version.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// VersionsGetter has a method to return a VersionInterface. +// A group's client should implement this interface. +type VersionsGetter interface { + Versions(namespace string) VersionInterface +} + +// VersionInterface has methods to work with Version resources. +type VersionInterface interface { + Create(ctx context.Context, version *v1beta1.Version, opts v1.CreateOptions) (*v1beta1.Version, error) + Update(ctx context.Context, version *v1beta1.Version, opts v1.UpdateOptions) (*v1beta1.Version, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Version, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VersionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Version, err error) + VersionExpansion +} + +// versions implements VersionInterface +type versions struct { + client rest.Interface + ns string +} + +// newVersions returns a Versions +func newVersions(c *HarvesterhciV1beta1Client, namespace string) *versions { + return &versions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the version, and returns the corresponding version object, and an error if there is any. +func (c *versions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Version, err error) { + result = &v1beta1.Version{} + err = c.client.Get(). + Namespace(c.ns). + Resource("versions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Versions that match those selectors. +func (c *versions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VersionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("versions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested versions. +func (c *versions) Watch(ctx context.Context, 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("versions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a version and creates it. Returns the server's representation of the version, and an error, if there is any. +func (c *versions) Create(ctx context.Context, version *v1beta1.Version, opts v1.CreateOptions) (result *v1beta1.Version, err error) { + result = &v1beta1.Version{} + err = c.client.Post(). + Namespace(c.ns). + Resource("versions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(version). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a version and updates it. Returns the server's representation of the version, and an error, if there is any. +func (c *versions) Update(ctx context.Context, version *v1beta1.Version, opts v1.UpdateOptions) (result *v1beta1.Version, err error) { + result = &v1beta1.Version{} + err = c.client.Put(). + Namespace(c.ns). + Resource("versions"). + Name(version.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(version). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the version and deletes it. Returns an error if one occurs. +func (c *versions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("versions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *versions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("versions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched version. +func (c *versions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Version, err error) { + result = &v1beta1.Version{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("versions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinebackup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinebackup.go new file mode 100644 index 00000000..1ee3beda --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinebackup.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// VirtualMachineBackupsGetter has a method to return a VirtualMachineBackupInterface. +// A group's client should implement this interface. +type VirtualMachineBackupsGetter interface { + VirtualMachineBackups(namespace string) VirtualMachineBackupInterface +} + +// VirtualMachineBackupInterface has methods to work with VirtualMachineBackup resources. +type VirtualMachineBackupInterface interface { + Create(ctx context.Context, virtualMachineBackup *v1beta1.VirtualMachineBackup, opts v1.CreateOptions) (*v1beta1.VirtualMachineBackup, error) + Update(ctx context.Context, virtualMachineBackup *v1beta1.VirtualMachineBackup, opts v1.UpdateOptions) (*v1beta1.VirtualMachineBackup, error) + UpdateStatus(ctx context.Context, virtualMachineBackup *v1beta1.VirtualMachineBackup, opts v1.UpdateOptions) (*v1beta1.VirtualMachineBackup, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VirtualMachineBackup, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VirtualMachineBackupList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineBackup, err error) + VirtualMachineBackupExpansion +} + +// virtualMachineBackups implements VirtualMachineBackupInterface +type virtualMachineBackups struct { + client rest.Interface + ns string +} + +// newVirtualMachineBackups returns a VirtualMachineBackups +func newVirtualMachineBackups(c *HarvesterhciV1beta1Client, namespace string) *virtualMachineBackups { + return &virtualMachineBackups{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineBackup, and returns the corresponding virtualMachineBackup object, and an error if there is any. +func (c *virtualMachineBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineBackup, err error) { + result = &v1beta1.VirtualMachineBackup{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachinebackups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineBackups that match those selectors. +func (c *virtualMachineBackups) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineBackupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VirtualMachineBackupList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachinebackups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineBackups. +func (c *virtualMachineBackups) Watch(ctx context.Context, 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("virtualmachinebackups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineBackup and creates it. Returns the server's representation of the virtualMachineBackup, and an error, if there is any. +func (c *virtualMachineBackups) Create(ctx context.Context, virtualMachineBackup *v1beta1.VirtualMachineBackup, opts v1.CreateOptions) (result *v1beta1.VirtualMachineBackup, err error) { + result = &v1beta1.VirtualMachineBackup{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachinebackups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineBackup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineBackup and updates it. Returns the server's representation of the virtualMachineBackup, and an error, if there is any. +func (c *virtualMachineBackups) Update(ctx context.Context, virtualMachineBackup *v1beta1.VirtualMachineBackup, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineBackup, err error) { + result = &v1beta1.VirtualMachineBackup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachinebackups"). + Name(virtualMachineBackup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineBackup). + Do(ctx). + 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 *virtualMachineBackups) UpdateStatus(ctx context.Context, virtualMachineBackup *v1beta1.VirtualMachineBackup, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineBackup, err error) { + result = &v1beta1.VirtualMachineBackup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachinebackups"). + Name(virtualMachineBackup.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineBackup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineBackup and deletes it. Returns an error if one occurs. +func (c *virtualMachineBackups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachinebackups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachinebackups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineBackup. +func (c *virtualMachineBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineBackup, err error) { + result = &v1beta1.VirtualMachineBackup{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachinebackups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachineimage.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachineimage.go new file mode 100644 index 00000000..3c5d29f3 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachineimage.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// VirtualMachineImagesGetter has a method to return a VirtualMachineImageInterface. +// A group's client should implement this interface. +type VirtualMachineImagesGetter interface { + VirtualMachineImages(namespace string) VirtualMachineImageInterface +} + +// VirtualMachineImageInterface has methods to work with VirtualMachineImage resources. +type VirtualMachineImageInterface interface { + Create(ctx context.Context, virtualMachineImage *v1beta1.VirtualMachineImage, opts v1.CreateOptions) (*v1beta1.VirtualMachineImage, error) + Update(ctx context.Context, virtualMachineImage *v1beta1.VirtualMachineImage, opts v1.UpdateOptions) (*v1beta1.VirtualMachineImage, error) + UpdateStatus(ctx context.Context, virtualMachineImage *v1beta1.VirtualMachineImage, opts v1.UpdateOptions) (*v1beta1.VirtualMachineImage, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VirtualMachineImage, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VirtualMachineImageList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineImage, err error) + VirtualMachineImageExpansion +} + +// virtualMachineImages implements VirtualMachineImageInterface +type virtualMachineImages struct { + client rest.Interface + ns string +} + +// newVirtualMachineImages returns a VirtualMachineImages +func newVirtualMachineImages(c *HarvesterhciV1beta1Client, namespace string) *virtualMachineImages { + return &virtualMachineImages{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineImage, and returns the corresponding virtualMachineImage object, and an error if there is any. +func (c *virtualMachineImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineImage, err error) { + result = &v1beta1.VirtualMachineImage{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineimages"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineImages that match those selectors. +func (c *virtualMachineImages) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineImageList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VirtualMachineImageList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineImages. +func (c *virtualMachineImages) Watch(ctx context.Context, 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("virtualmachineimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineImage and creates it. Returns the server's representation of the virtualMachineImage, and an error, if there is any. +func (c *virtualMachineImages) Create(ctx context.Context, virtualMachineImage *v1beta1.VirtualMachineImage, opts v1.CreateOptions) (result *v1beta1.VirtualMachineImage, err error) { + result = &v1beta1.VirtualMachineImage{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachineimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineImage). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineImage and updates it. Returns the server's representation of the virtualMachineImage, and an error, if there is any. +func (c *virtualMachineImages) Update(ctx context.Context, virtualMachineImage *v1beta1.VirtualMachineImage, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineImage, err error) { + result = &v1beta1.VirtualMachineImage{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineimages"). + Name(virtualMachineImage.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineImage). + Do(ctx). + 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 *virtualMachineImages) UpdateStatus(ctx context.Context, virtualMachineImage *v1beta1.VirtualMachineImage, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineImage, err error) { + result = &v1beta1.VirtualMachineImage{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineimages"). + Name(virtualMachineImage.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineImage). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineImage and deletes it. Returns an error if one occurs. +func (c *virtualMachineImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineimages"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineimages"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineImage. +func (c *virtualMachineImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineImage, err error) { + result = &v1beta1.VirtualMachineImage{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachineimages"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinerestore.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinerestore.go new file mode 100644 index 00000000..8fa7be28 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinerestore.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// VirtualMachineRestoresGetter has a method to return a VirtualMachineRestoreInterface. +// A group's client should implement this interface. +type VirtualMachineRestoresGetter interface { + VirtualMachineRestores(namespace string) VirtualMachineRestoreInterface +} + +// VirtualMachineRestoreInterface has methods to work with VirtualMachineRestore resources. +type VirtualMachineRestoreInterface interface { + Create(ctx context.Context, virtualMachineRestore *v1beta1.VirtualMachineRestore, opts v1.CreateOptions) (*v1beta1.VirtualMachineRestore, error) + Update(ctx context.Context, virtualMachineRestore *v1beta1.VirtualMachineRestore, opts v1.UpdateOptions) (*v1beta1.VirtualMachineRestore, error) + UpdateStatus(ctx context.Context, virtualMachineRestore *v1beta1.VirtualMachineRestore, opts v1.UpdateOptions) (*v1beta1.VirtualMachineRestore, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VirtualMachineRestore, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VirtualMachineRestoreList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineRestore, err error) + VirtualMachineRestoreExpansion +} + +// virtualMachineRestores implements VirtualMachineRestoreInterface +type virtualMachineRestores struct { + client rest.Interface + ns string +} + +// newVirtualMachineRestores returns a VirtualMachineRestores +func newVirtualMachineRestores(c *HarvesterhciV1beta1Client, namespace string) *virtualMachineRestores { + return &virtualMachineRestores{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineRestore, and returns the corresponding virtualMachineRestore object, and an error if there is any. +func (c *virtualMachineRestores) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineRestore, err error) { + result = &v1beta1.VirtualMachineRestore{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachinerestores"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineRestores that match those selectors. +func (c *virtualMachineRestores) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineRestoreList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VirtualMachineRestoreList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachinerestores"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineRestores. +func (c *virtualMachineRestores) Watch(ctx context.Context, 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("virtualmachinerestores"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineRestore and creates it. Returns the server's representation of the virtualMachineRestore, and an error, if there is any. +func (c *virtualMachineRestores) Create(ctx context.Context, virtualMachineRestore *v1beta1.VirtualMachineRestore, opts v1.CreateOptions) (result *v1beta1.VirtualMachineRestore, err error) { + result = &v1beta1.VirtualMachineRestore{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachinerestores"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineRestore). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineRestore and updates it. Returns the server's representation of the virtualMachineRestore, and an error, if there is any. +func (c *virtualMachineRestores) Update(ctx context.Context, virtualMachineRestore *v1beta1.VirtualMachineRestore, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineRestore, err error) { + result = &v1beta1.VirtualMachineRestore{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachinerestores"). + Name(virtualMachineRestore.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineRestore). + Do(ctx). + 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 *virtualMachineRestores) UpdateStatus(ctx context.Context, virtualMachineRestore *v1beta1.VirtualMachineRestore, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineRestore, err error) { + result = &v1beta1.VirtualMachineRestore{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachinerestores"). + Name(virtualMachineRestore.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineRestore). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineRestore and deletes it. Returns an error if one occurs. +func (c *virtualMachineRestores) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachinerestores"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineRestores) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachinerestores"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineRestore. +func (c *virtualMachineRestores) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineRestore, err error) { + result = &v1beta1.VirtualMachineRestore{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachinerestores"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinetemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinetemplate.go new file mode 100644 index 00000000..f31541d6 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinetemplate.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// VirtualMachineTemplatesGetter has a method to return a VirtualMachineTemplateInterface. +// A group's client should implement this interface. +type VirtualMachineTemplatesGetter interface { + VirtualMachineTemplates(namespace string) VirtualMachineTemplateInterface +} + +// VirtualMachineTemplateInterface has methods to work with VirtualMachineTemplate resources. +type VirtualMachineTemplateInterface interface { + Create(ctx context.Context, virtualMachineTemplate *v1beta1.VirtualMachineTemplate, opts v1.CreateOptions) (*v1beta1.VirtualMachineTemplate, error) + Update(ctx context.Context, virtualMachineTemplate *v1beta1.VirtualMachineTemplate, opts v1.UpdateOptions) (*v1beta1.VirtualMachineTemplate, error) + UpdateStatus(ctx context.Context, virtualMachineTemplate *v1beta1.VirtualMachineTemplate, opts v1.UpdateOptions) (*v1beta1.VirtualMachineTemplate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VirtualMachineTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VirtualMachineTemplateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineTemplate, err error) + VirtualMachineTemplateExpansion +} + +// virtualMachineTemplates implements VirtualMachineTemplateInterface +type virtualMachineTemplates struct { + client rest.Interface + ns string +} + +// newVirtualMachineTemplates returns a VirtualMachineTemplates +func newVirtualMachineTemplates(c *HarvesterhciV1beta1Client, namespace string) *virtualMachineTemplates { + return &virtualMachineTemplates{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineTemplate, and returns the corresponding virtualMachineTemplate object, and an error if there is any. +func (c *virtualMachineTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineTemplate, err error) { + result = &v1beta1.VirtualMachineTemplate{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachinetemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineTemplates that match those selectors. +func (c *virtualMachineTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VirtualMachineTemplateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachinetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineTemplates. +func (c *virtualMachineTemplates) Watch(ctx context.Context, 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("virtualmachinetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineTemplate and creates it. Returns the server's representation of the virtualMachineTemplate, and an error, if there is any. +func (c *virtualMachineTemplates) Create(ctx context.Context, virtualMachineTemplate *v1beta1.VirtualMachineTemplate, opts v1.CreateOptions) (result *v1beta1.VirtualMachineTemplate, err error) { + result = &v1beta1.VirtualMachineTemplate{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachinetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineTemplate and updates it. Returns the server's representation of the virtualMachineTemplate, and an error, if there is any. +func (c *virtualMachineTemplates) Update(ctx context.Context, virtualMachineTemplate *v1beta1.VirtualMachineTemplate, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineTemplate, err error) { + result = &v1beta1.VirtualMachineTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachinetemplates"). + Name(virtualMachineTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineTemplate). + Do(ctx). + 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 *virtualMachineTemplates) UpdateStatus(ctx context.Context, virtualMachineTemplate *v1beta1.VirtualMachineTemplate, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineTemplate, err error) { + result = &v1beta1.VirtualMachineTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachinetemplates"). + Name(virtualMachineTemplate.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineTemplate and deletes it. Returns an error if one occurs. +func (c *virtualMachineTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachinetemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachinetemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineTemplate. +func (c *virtualMachineTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineTemplate, err error) { + result = &v1beta1.VirtualMachineTemplate{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachinetemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinetemplateversion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinetemplateversion.go new file mode 100644 index 00000000..2059a1bf --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1/virtualmachinetemplateversion.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// VirtualMachineTemplateVersionsGetter has a method to return a VirtualMachineTemplateVersionInterface. +// A group's client should implement this interface. +type VirtualMachineTemplateVersionsGetter interface { + VirtualMachineTemplateVersions(namespace string) VirtualMachineTemplateVersionInterface +} + +// VirtualMachineTemplateVersionInterface has methods to work with VirtualMachineTemplateVersion resources. +type VirtualMachineTemplateVersionInterface interface { + Create(ctx context.Context, virtualMachineTemplateVersion *v1beta1.VirtualMachineTemplateVersion, opts v1.CreateOptions) (*v1beta1.VirtualMachineTemplateVersion, error) + Update(ctx context.Context, virtualMachineTemplateVersion *v1beta1.VirtualMachineTemplateVersion, opts v1.UpdateOptions) (*v1beta1.VirtualMachineTemplateVersion, error) + UpdateStatus(ctx context.Context, virtualMachineTemplateVersion *v1beta1.VirtualMachineTemplateVersion, opts v1.UpdateOptions) (*v1beta1.VirtualMachineTemplateVersion, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VirtualMachineTemplateVersion, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VirtualMachineTemplateVersionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineTemplateVersion, err error) + VirtualMachineTemplateVersionExpansion +} + +// virtualMachineTemplateVersions implements VirtualMachineTemplateVersionInterface +type virtualMachineTemplateVersions struct { + client rest.Interface + ns string +} + +// newVirtualMachineTemplateVersions returns a VirtualMachineTemplateVersions +func newVirtualMachineTemplateVersions(c *HarvesterhciV1beta1Client, namespace string) *virtualMachineTemplateVersions { + return &virtualMachineTemplateVersions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineTemplateVersion, and returns the corresponding virtualMachineTemplateVersion object, and an error if there is any. +func (c *virtualMachineTemplateVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VirtualMachineTemplateVersion, err error) { + result = &v1beta1.VirtualMachineTemplateVersion{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachinetemplateversions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineTemplateVersions that match those selectors. +func (c *virtualMachineTemplateVersions) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VirtualMachineTemplateVersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VirtualMachineTemplateVersionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachinetemplateversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineTemplateVersions. +func (c *virtualMachineTemplateVersions) Watch(ctx context.Context, 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("virtualmachinetemplateversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineTemplateVersion and creates it. Returns the server's representation of the virtualMachineTemplateVersion, and an error, if there is any. +func (c *virtualMachineTemplateVersions) Create(ctx context.Context, virtualMachineTemplateVersion *v1beta1.VirtualMachineTemplateVersion, opts v1.CreateOptions) (result *v1beta1.VirtualMachineTemplateVersion, err error) { + result = &v1beta1.VirtualMachineTemplateVersion{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachinetemplateversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineTemplateVersion). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineTemplateVersion and updates it. Returns the server's representation of the virtualMachineTemplateVersion, and an error, if there is any. +func (c *virtualMachineTemplateVersions) Update(ctx context.Context, virtualMachineTemplateVersion *v1beta1.VirtualMachineTemplateVersion, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineTemplateVersion, err error) { + result = &v1beta1.VirtualMachineTemplateVersion{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachinetemplateversions"). + Name(virtualMachineTemplateVersion.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineTemplateVersion). + Do(ctx). + 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 *virtualMachineTemplateVersions) UpdateStatus(ctx context.Context, virtualMachineTemplateVersion *v1beta1.VirtualMachineTemplateVersion, opts v1.UpdateOptions) (result *v1beta1.VirtualMachineTemplateVersion, err error) { + result = &v1beta1.VirtualMachineTemplateVersion{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachinetemplateversions"). + Name(virtualMachineTemplateVersion.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineTemplateVersion). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineTemplateVersion and deletes it. Returns an error if one occurs. +func (c *virtualMachineTemplateVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachinetemplateversions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineTemplateVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachinetemplateversions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineTemplateVersion. +func (c *virtualMachineTemplateVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VirtualMachineTemplateVersion, err error) { + result = &v1beta1.VirtualMachineTemplateVersion{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachinetemplateversions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/doc.go new file mode 100644 index 00000000..5e9c88f0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake/fake_k8s.cni.cncf.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake/fake_k8s.cni.cncf.io_client.go new file mode 100644 index 00000000..fc84f5fe --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake/fake_k8s.cni.cncf.io_client.go @@ -0,0 +1,40 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeK8sCniCncfIoV1 struct { + *testing.Fake +} + +func (c *FakeK8sCniCncfIoV1) NetworkAttachmentDefinitions(namespace string) v1.NetworkAttachmentDefinitionInterface { + return &FakeNetworkAttachmentDefinitions{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeK8sCniCncfIoV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake/fake_networkattachmentdefinition.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake/fake_networkattachmentdefinition.go new file mode 100644 index 00000000..d292781f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/fake/fake_networkattachmentdefinition.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + k8scnicncfiov1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNetworkAttachmentDefinitions implements NetworkAttachmentDefinitionInterface +type FakeNetworkAttachmentDefinitions struct { + Fake *FakeK8sCniCncfIoV1 + ns string +} + +var networkattachmentdefinitionsResource = schema.GroupVersionResource{Group: "k8s.cni.cncf.io", Version: "v1", Resource: "network-attachment-definitions"} + +var networkattachmentdefinitionsKind = schema.GroupVersionKind{Group: "k8s.cni.cncf.io", Version: "v1", Kind: "NetworkAttachmentDefinition"} + +// Get takes name of the networkAttachmentDefinition, and returns the corresponding networkAttachmentDefinition object, and an error if there is any. +func (c *FakeNetworkAttachmentDefinitions) Get(ctx context.Context, name string, options v1.GetOptions) (result *k8scnicncfiov1.NetworkAttachmentDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(networkattachmentdefinitionsResource, c.ns, name), &k8scnicncfiov1.NetworkAttachmentDefinition{}) + + if obj == nil { + return nil, err + } + return obj.(*k8scnicncfiov1.NetworkAttachmentDefinition), err +} + +// List takes label and field selectors, and returns the list of NetworkAttachmentDefinitions that match those selectors. +func (c *FakeNetworkAttachmentDefinitions) List(ctx context.Context, opts v1.ListOptions) (result *k8scnicncfiov1.NetworkAttachmentDefinitionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(networkattachmentdefinitionsResource, networkattachmentdefinitionsKind, c.ns, opts), &k8scnicncfiov1.NetworkAttachmentDefinitionList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &k8scnicncfiov1.NetworkAttachmentDefinitionList{ListMeta: obj.(*k8scnicncfiov1.NetworkAttachmentDefinitionList).ListMeta} + for _, item := range obj.(*k8scnicncfiov1.NetworkAttachmentDefinitionList).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 networkAttachmentDefinitions. +func (c *FakeNetworkAttachmentDefinitions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(networkattachmentdefinitionsResource, c.ns, opts)) + +} + +// Create takes the representation of a networkAttachmentDefinition and creates it. Returns the server's representation of the networkAttachmentDefinition, and an error, if there is any. +func (c *FakeNetworkAttachmentDefinitions) Create(ctx context.Context, networkAttachmentDefinition *k8scnicncfiov1.NetworkAttachmentDefinition, opts v1.CreateOptions) (result *k8scnicncfiov1.NetworkAttachmentDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(networkattachmentdefinitionsResource, c.ns, networkAttachmentDefinition), &k8scnicncfiov1.NetworkAttachmentDefinition{}) + + if obj == nil { + return nil, err + } + return obj.(*k8scnicncfiov1.NetworkAttachmentDefinition), err +} + +// Update takes the representation of a networkAttachmentDefinition and updates it. Returns the server's representation of the networkAttachmentDefinition, and an error, if there is any. +func (c *FakeNetworkAttachmentDefinitions) Update(ctx context.Context, networkAttachmentDefinition *k8scnicncfiov1.NetworkAttachmentDefinition, opts v1.UpdateOptions) (result *k8scnicncfiov1.NetworkAttachmentDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(networkattachmentdefinitionsResource, c.ns, networkAttachmentDefinition), &k8scnicncfiov1.NetworkAttachmentDefinition{}) + + if obj == nil { + return nil, err + } + return obj.(*k8scnicncfiov1.NetworkAttachmentDefinition), err +} + +// Delete takes name of the networkAttachmentDefinition and deletes it. Returns an error if one occurs. +func (c *FakeNetworkAttachmentDefinitions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(networkattachmentdefinitionsResource, c.ns, name, opts), &k8scnicncfiov1.NetworkAttachmentDefinition{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworkAttachmentDefinitions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(networkattachmentdefinitionsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &k8scnicncfiov1.NetworkAttachmentDefinitionList{}) + return err +} + +// Patch applies the patch and returns the patched networkAttachmentDefinition. +func (c *FakeNetworkAttachmentDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *k8scnicncfiov1.NetworkAttachmentDefinition, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(networkattachmentdefinitionsResource, c.ns, name, pt, data, subresources...), &k8scnicncfiov1.NetworkAttachmentDefinition{}) + + if obj == nil { + return nil, err + } + return obj.(*k8scnicncfiov1.NetworkAttachmentDefinition), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/generated_expansion.go new file mode 100644 index 00000000..0c93f1dc --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +type NetworkAttachmentDefinitionExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/k8s.cni.cncf.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/k8s.cni.cncf.io_client.go new file mode 100644 index 00000000..7cdd3119 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/k8s.cni.cncf.io_client.go @@ -0,0 +1,107 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" + rest "k8s.io/client-go/rest" +) + +type K8sCniCncfIoV1Interface interface { + RESTClient() rest.Interface + NetworkAttachmentDefinitionsGetter +} + +// K8sCniCncfIoV1Client is used to interact with features provided by the k8s.cni.cncf.io group. +type K8sCniCncfIoV1Client struct { + restClient rest.Interface +} + +func (c *K8sCniCncfIoV1Client) NetworkAttachmentDefinitions(namespace string) NetworkAttachmentDefinitionInterface { + return newNetworkAttachmentDefinitions(c, namespace) +} + +// NewForConfig creates a new K8sCniCncfIoV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*K8sCniCncfIoV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new K8sCniCncfIoV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*K8sCniCncfIoV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &K8sCniCncfIoV1Client{client}, nil +} + +// NewForConfigOrDie creates a new K8sCniCncfIoV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *K8sCniCncfIoV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new K8sCniCncfIoV1Client for the given RESTClient. +func New(c rest.Interface) *K8sCniCncfIoV1Client { + return &K8sCniCncfIoV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.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 *K8sCniCncfIoV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/networkattachmentdefinition.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/networkattachmentdefinition.go new file mode 100644 index 00000000..2cf69079 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1/networkattachmentdefinition.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" + metav1 "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" +) + +// NetworkAttachmentDefinitionsGetter has a method to return a NetworkAttachmentDefinitionInterface. +// A group's client should implement this interface. +type NetworkAttachmentDefinitionsGetter interface { + NetworkAttachmentDefinitions(namespace string) NetworkAttachmentDefinitionInterface +} + +// NetworkAttachmentDefinitionInterface has methods to work with NetworkAttachmentDefinition resources. +type NetworkAttachmentDefinitionInterface interface { + Create(ctx context.Context, networkAttachmentDefinition *v1.NetworkAttachmentDefinition, opts metav1.CreateOptions) (*v1.NetworkAttachmentDefinition, error) + Update(ctx context.Context, networkAttachmentDefinition *v1.NetworkAttachmentDefinition, opts metav1.UpdateOptions) (*v1.NetworkAttachmentDefinition, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NetworkAttachmentDefinition, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkAttachmentDefinitionList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkAttachmentDefinition, err error) + NetworkAttachmentDefinitionExpansion +} + +// networkAttachmentDefinitions implements NetworkAttachmentDefinitionInterface +type networkAttachmentDefinitions struct { + client rest.Interface + ns string +} + +// newNetworkAttachmentDefinitions returns a NetworkAttachmentDefinitions +func newNetworkAttachmentDefinitions(c *K8sCniCncfIoV1Client, namespace string) *networkAttachmentDefinitions { + return &networkAttachmentDefinitions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the networkAttachmentDefinition, and returns the corresponding networkAttachmentDefinition object, and an error if there is any. +func (c *networkAttachmentDefinitions) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkAttachmentDefinition, err error) { + result = &v1.NetworkAttachmentDefinition{} + err = c.client.Get(). + Namespace(c.ns). + Resource("network-attachment-definitions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NetworkAttachmentDefinitions that match those selectors. +func (c *networkAttachmentDefinitions) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkAttachmentDefinitionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NetworkAttachmentDefinitionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("network-attachment-definitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested networkAttachmentDefinitions. +func (c *networkAttachmentDefinitions) Watch(ctx context.Context, opts metav1.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("network-attachment-definitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a networkAttachmentDefinition and creates it. Returns the server's representation of the networkAttachmentDefinition, and an error, if there is any. +func (c *networkAttachmentDefinitions) Create(ctx context.Context, networkAttachmentDefinition *v1.NetworkAttachmentDefinition, opts metav1.CreateOptions) (result *v1.NetworkAttachmentDefinition, err error) { + result = &v1.NetworkAttachmentDefinition{} + err = c.client.Post(). + Namespace(c.ns). + Resource("network-attachment-definitions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkAttachmentDefinition). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a networkAttachmentDefinition and updates it. Returns the server's representation of the networkAttachmentDefinition, and an error, if there is any. +func (c *networkAttachmentDefinitions) Update(ctx context.Context, networkAttachmentDefinition *v1.NetworkAttachmentDefinition, opts metav1.UpdateOptions) (result *v1.NetworkAttachmentDefinition, err error) { + result = &v1.NetworkAttachmentDefinition{} + err = c.client.Put(). + Namespace(c.ns). + Resource("network-attachment-definitions"). + Name(networkAttachmentDefinition.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkAttachmentDefinition). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the networkAttachmentDefinition and deletes it. Returns an error if one occurs. +func (c *networkAttachmentDefinitions) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("network-attachment-definitions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *networkAttachmentDefinitions) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("network-attachment-definitions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched networkAttachmentDefinition. +func (c *networkAttachmentDefinitions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkAttachmentDefinition, err error) { + result = &v1.NetworkAttachmentDefinition{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("network-attachment-definitions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/doc.go new file mode 100644 index 00000000..5e9c88f0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_kubevirt.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_kubevirt.go new file mode 100644 index 00000000..c957a0b7 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_kubevirt.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + corev1 "kubevirt.io/api/core/v1" +) + +// FakeKubeVirts implements KubeVirtInterface +type FakeKubeVirts struct { + Fake *FakeKubevirtV1 + ns string +} + +var kubevirtsResource = schema.GroupVersionResource{Group: "kubevirt.io", Version: "v1", Resource: "kubevirts"} + +var kubevirtsKind = schema.GroupVersionKind{Group: "kubevirt.io", Version: "v1", Kind: "KubeVirt"} + +// Get takes name of the kubeVirt, and returns the corresponding kubeVirt object, and an error if there is any. +func (c *FakeKubeVirts) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.KubeVirt, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(kubevirtsResource, c.ns, name), &corev1.KubeVirt{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.KubeVirt), err +} + +// List takes label and field selectors, and returns the list of KubeVirts that match those selectors. +func (c *FakeKubeVirts) List(ctx context.Context, opts v1.ListOptions) (result *corev1.KubeVirtList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(kubevirtsResource, kubevirtsKind, c.ns, opts), &corev1.KubeVirtList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &corev1.KubeVirtList{ListMeta: obj.(*corev1.KubeVirtList).ListMeta} + for _, item := range obj.(*corev1.KubeVirtList).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 kubeVirts. +func (c *FakeKubeVirts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(kubevirtsResource, c.ns, opts)) + +} + +// Create takes the representation of a kubeVirt and creates it. Returns the server's representation of the kubeVirt, and an error, if there is any. +func (c *FakeKubeVirts) Create(ctx context.Context, kubeVirt *corev1.KubeVirt, opts v1.CreateOptions) (result *corev1.KubeVirt, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(kubevirtsResource, c.ns, kubeVirt), &corev1.KubeVirt{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.KubeVirt), err +} + +// Update takes the representation of a kubeVirt and updates it. Returns the server's representation of the kubeVirt, and an error, if there is any. +func (c *FakeKubeVirts) Update(ctx context.Context, kubeVirt *corev1.KubeVirt, opts v1.UpdateOptions) (result *corev1.KubeVirt, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(kubevirtsResource, c.ns, kubeVirt), &corev1.KubeVirt{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.KubeVirt), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeKubeVirts) UpdateStatus(ctx context.Context, kubeVirt *corev1.KubeVirt, opts v1.UpdateOptions) (*corev1.KubeVirt, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(kubevirtsResource, "status", c.ns, kubeVirt), &corev1.KubeVirt{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.KubeVirt), err +} + +// Delete takes name of the kubeVirt and deletes it. Returns an error if one occurs. +func (c *FakeKubeVirts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(kubevirtsResource, c.ns, name, opts), &corev1.KubeVirt{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeKubeVirts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(kubevirtsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &corev1.KubeVirtList{}) + return err +} + +// Patch applies the patch and returns the patched kubeVirt. +func (c *FakeKubeVirts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.KubeVirt, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(kubevirtsResource, c.ns, name, pt, data, subresources...), &corev1.KubeVirt{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.KubeVirt), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_kubevirt.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_kubevirt.io_client.go new file mode 100644 index 00000000..bded2a4c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_kubevirt.io_client.go @@ -0,0 +1,60 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeKubevirtV1 struct { + *testing.Fake +} + +func (c *FakeKubevirtV1) KubeVirts(namespace string) v1.KubeVirtInterface { + return &FakeKubeVirts{c, namespace} +} + +func (c *FakeKubevirtV1) VirtualMachines(namespace string) v1.VirtualMachineInterface { + return &FakeVirtualMachines{c, namespace} +} + +func (c *FakeKubevirtV1) VirtualMachineInstances(namespace string) v1.VirtualMachineInstanceInterface { + return &FakeVirtualMachineInstances{c, namespace} +} + +func (c *FakeKubevirtV1) VirtualMachineInstanceMigrations(namespace string) v1.VirtualMachineInstanceMigrationInterface { + return &FakeVirtualMachineInstanceMigrations{c, namespace} +} + +func (c *FakeKubevirtV1) VirtualMachineInstancePresets(namespace string) v1.VirtualMachineInstancePresetInterface { + return &FakeVirtualMachineInstancePresets{c, namespace} +} + +func (c *FakeKubevirtV1) VirtualMachineInstanceReplicaSets(namespace string) v1.VirtualMachineInstanceReplicaSetInterface { + return &FakeVirtualMachineInstanceReplicaSets{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeKubevirtV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachine.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachine.go new file mode 100644 index 00000000..674db02d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachine.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + corev1 "kubevirt.io/api/core/v1" +) + +// FakeVirtualMachines implements VirtualMachineInterface +type FakeVirtualMachines struct { + Fake *FakeKubevirtV1 + ns string +} + +var virtualmachinesResource = schema.GroupVersionResource{Group: "kubevirt.io", Version: "v1", Resource: "virtualmachines"} + +var virtualmachinesKind = schema.GroupVersionKind{Group: "kubevirt.io", Version: "v1", Kind: "VirtualMachine"} + +// Get takes name of the virtualMachine, and returns the corresponding virtualMachine object, and an error if there is any. +func (c *FakeVirtualMachines) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.VirtualMachine, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachinesResource, c.ns, name), &corev1.VirtualMachine{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachine), err +} + +// List takes label and field selectors, and returns the list of VirtualMachines that match those selectors. +func (c *FakeVirtualMachines) List(ctx context.Context, opts v1.ListOptions) (result *corev1.VirtualMachineList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachinesResource, virtualmachinesKind, c.ns, opts), &corev1.VirtualMachineList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &corev1.VirtualMachineList{ListMeta: obj.(*corev1.VirtualMachineList).ListMeta} + for _, item := range obj.(*corev1.VirtualMachineList).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 virtualMachines. +func (c *FakeVirtualMachines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachinesResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachine and creates it. Returns the server's representation of the virtualMachine, and an error, if there is any. +func (c *FakeVirtualMachines) Create(ctx context.Context, virtualMachine *corev1.VirtualMachine, opts v1.CreateOptions) (result *corev1.VirtualMachine, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachinesResource, c.ns, virtualMachine), &corev1.VirtualMachine{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachine), err +} + +// Update takes the representation of a virtualMachine and updates it. Returns the server's representation of the virtualMachine, and an error, if there is any. +func (c *FakeVirtualMachines) Update(ctx context.Context, virtualMachine *corev1.VirtualMachine, opts v1.UpdateOptions) (result *corev1.VirtualMachine, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachinesResource, c.ns, virtualMachine), &corev1.VirtualMachine{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachine), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualMachines) UpdateStatus(ctx context.Context, virtualMachine *corev1.VirtualMachine, opts v1.UpdateOptions) (*corev1.VirtualMachine, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachinesResource, "status", c.ns, virtualMachine), &corev1.VirtualMachine{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachine), err +} + +// Delete takes name of the virtualMachine and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachinesResource, c.ns, name, opts), &corev1.VirtualMachine{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachinesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &corev1.VirtualMachineList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachine. +func (c *FakeVirtualMachines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.VirtualMachine, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachinesResource, c.ns, name, pt, data, subresources...), &corev1.VirtualMachine{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachine), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstance.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstance.go new file mode 100644 index 00000000..f54a3a1b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstance.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + corev1 "kubevirt.io/api/core/v1" +) + +// FakeVirtualMachineInstances implements VirtualMachineInstanceInterface +type FakeVirtualMachineInstances struct { + Fake *FakeKubevirtV1 + ns string +} + +var virtualmachineinstancesResource = schema.GroupVersionResource{Group: "kubevirt.io", Version: "v1", Resource: "virtualmachineinstances"} + +var virtualmachineinstancesKind = schema.GroupVersionKind{Group: "kubevirt.io", Version: "v1", Kind: "VirtualMachineInstance"} + +// Get takes name of the virtualMachineInstance, and returns the corresponding virtualMachineInstance object, and an error if there is any. +func (c *FakeVirtualMachineInstances) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.VirtualMachineInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachineinstancesResource, c.ns, name), &corev1.VirtualMachineInstance{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstance), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineInstances that match those selectors. +func (c *FakeVirtualMachineInstances) List(ctx context.Context, opts v1.ListOptions) (result *corev1.VirtualMachineInstanceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachineinstancesResource, virtualmachineinstancesKind, c.ns, opts), &corev1.VirtualMachineInstanceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &corev1.VirtualMachineInstanceList{ListMeta: obj.(*corev1.VirtualMachineInstanceList).ListMeta} + for _, item := range obj.(*corev1.VirtualMachineInstanceList).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 virtualMachineInstances. +func (c *FakeVirtualMachineInstances) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachineinstancesResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineInstance and creates it. Returns the server's representation of the virtualMachineInstance, and an error, if there is any. +func (c *FakeVirtualMachineInstances) Create(ctx context.Context, virtualMachineInstance *corev1.VirtualMachineInstance, opts v1.CreateOptions) (result *corev1.VirtualMachineInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachineinstancesResource, c.ns, virtualMachineInstance), &corev1.VirtualMachineInstance{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstance), err +} + +// Update takes the representation of a virtualMachineInstance and updates it. Returns the server's representation of the virtualMachineInstance, and an error, if there is any. +func (c *FakeVirtualMachineInstances) Update(ctx context.Context, virtualMachineInstance *corev1.VirtualMachineInstance, opts v1.UpdateOptions) (result *corev1.VirtualMachineInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachineinstancesResource, c.ns, virtualMachineInstance), &corev1.VirtualMachineInstance{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstance), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualMachineInstances) UpdateStatus(ctx context.Context, virtualMachineInstance *corev1.VirtualMachineInstance, opts v1.UpdateOptions) (*corev1.VirtualMachineInstance, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachineinstancesResource, "status", c.ns, virtualMachineInstance), &corev1.VirtualMachineInstance{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstance), err +} + +// Delete takes name of the virtualMachineInstance and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineInstances) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachineinstancesResource, c.ns, name, opts), &corev1.VirtualMachineInstance{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineInstances) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachineinstancesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &corev1.VirtualMachineInstanceList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineInstance. +func (c *FakeVirtualMachineInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.VirtualMachineInstance, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachineinstancesResource, c.ns, name, pt, data, subresources...), &corev1.VirtualMachineInstance{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstance), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstancemigration.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstancemigration.go new file mode 100644 index 00000000..b9c3e05c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstancemigration.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + corev1 "kubevirt.io/api/core/v1" +) + +// FakeVirtualMachineInstanceMigrations implements VirtualMachineInstanceMigrationInterface +type FakeVirtualMachineInstanceMigrations struct { + Fake *FakeKubevirtV1 + ns string +} + +var virtualmachineinstancemigrationsResource = schema.GroupVersionResource{Group: "kubevirt.io", Version: "v1", Resource: "virtualmachineinstancemigrations"} + +var virtualmachineinstancemigrationsKind = schema.GroupVersionKind{Group: "kubevirt.io", Version: "v1", Kind: "VirtualMachineInstanceMigration"} + +// Get takes name of the virtualMachineInstanceMigration, and returns the corresponding virtualMachineInstanceMigration object, and an error if there is any. +func (c *FakeVirtualMachineInstanceMigrations) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.VirtualMachineInstanceMigration, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachineinstancemigrationsResource, c.ns, name), &corev1.VirtualMachineInstanceMigration{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceMigration), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineInstanceMigrations that match those selectors. +func (c *FakeVirtualMachineInstanceMigrations) List(ctx context.Context, opts v1.ListOptions) (result *corev1.VirtualMachineInstanceMigrationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachineinstancemigrationsResource, virtualmachineinstancemigrationsKind, c.ns, opts), &corev1.VirtualMachineInstanceMigrationList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &corev1.VirtualMachineInstanceMigrationList{ListMeta: obj.(*corev1.VirtualMachineInstanceMigrationList).ListMeta} + for _, item := range obj.(*corev1.VirtualMachineInstanceMigrationList).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 virtualMachineInstanceMigrations. +func (c *FakeVirtualMachineInstanceMigrations) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachineinstancemigrationsResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineInstanceMigration and creates it. Returns the server's representation of the virtualMachineInstanceMigration, and an error, if there is any. +func (c *FakeVirtualMachineInstanceMigrations) Create(ctx context.Context, virtualMachineInstanceMigration *corev1.VirtualMachineInstanceMigration, opts v1.CreateOptions) (result *corev1.VirtualMachineInstanceMigration, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachineinstancemigrationsResource, c.ns, virtualMachineInstanceMigration), &corev1.VirtualMachineInstanceMigration{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceMigration), err +} + +// Update takes the representation of a virtualMachineInstanceMigration and updates it. Returns the server's representation of the virtualMachineInstanceMigration, and an error, if there is any. +func (c *FakeVirtualMachineInstanceMigrations) Update(ctx context.Context, virtualMachineInstanceMigration *corev1.VirtualMachineInstanceMigration, opts v1.UpdateOptions) (result *corev1.VirtualMachineInstanceMigration, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachineinstancemigrationsResource, c.ns, virtualMachineInstanceMigration), &corev1.VirtualMachineInstanceMigration{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceMigration), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualMachineInstanceMigrations) UpdateStatus(ctx context.Context, virtualMachineInstanceMigration *corev1.VirtualMachineInstanceMigration, opts v1.UpdateOptions) (*corev1.VirtualMachineInstanceMigration, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachineinstancemigrationsResource, "status", c.ns, virtualMachineInstanceMigration), &corev1.VirtualMachineInstanceMigration{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceMigration), err +} + +// Delete takes name of the virtualMachineInstanceMigration and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineInstanceMigrations) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachineinstancemigrationsResource, c.ns, name, opts), &corev1.VirtualMachineInstanceMigration{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineInstanceMigrations) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachineinstancemigrationsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &corev1.VirtualMachineInstanceMigrationList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineInstanceMigration. +func (c *FakeVirtualMachineInstanceMigrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.VirtualMachineInstanceMigration, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachineinstancemigrationsResource, c.ns, name, pt, data, subresources...), &corev1.VirtualMachineInstanceMigration{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceMigration), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstancepreset.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstancepreset.go new file mode 100644 index 00000000..b4cd3e9c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstancepreset.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + corev1 "kubevirt.io/api/core/v1" +) + +// FakeVirtualMachineInstancePresets implements VirtualMachineInstancePresetInterface +type FakeVirtualMachineInstancePresets struct { + Fake *FakeKubevirtV1 + ns string +} + +var virtualmachineinstancepresetsResource = schema.GroupVersionResource{Group: "kubevirt.io", Version: "v1", Resource: "virtualmachineinstancepresets"} + +var virtualmachineinstancepresetsKind = schema.GroupVersionKind{Group: "kubevirt.io", Version: "v1", Kind: "VirtualMachineInstancePreset"} + +// Get takes name of the virtualMachineInstancePreset, and returns the corresponding virtualMachineInstancePreset object, and an error if there is any. +func (c *FakeVirtualMachineInstancePresets) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.VirtualMachineInstancePreset, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachineinstancepresetsResource, c.ns, name), &corev1.VirtualMachineInstancePreset{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstancePreset), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineInstancePresets that match those selectors. +func (c *FakeVirtualMachineInstancePresets) List(ctx context.Context, opts v1.ListOptions) (result *corev1.VirtualMachineInstancePresetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachineinstancepresetsResource, virtualmachineinstancepresetsKind, c.ns, opts), &corev1.VirtualMachineInstancePresetList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &corev1.VirtualMachineInstancePresetList{ListMeta: obj.(*corev1.VirtualMachineInstancePresetList).ListMeta} + for _, item := range obj.(*corev1.VirtualMachineInstancePresetList).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 virtualMachineInstancePresets. +func (c *FakeVirtualMachineInstancePresets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachineinstancepresetsResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineInstancePreset and creates it. Returns the server's representation of the virtualMachineInstancePreset, and an error, if there is any. +func (c *FakeVirtualMachineInstancePresets) Create(ctx context.Context, virtualMachineInstancePreset *corev1.VirtualMachineInstancePreset, opts v1.CreateOptions) (result *corev1.VirtualMachineInstancePreset, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachineinstancepresetsResource, c.ns, virtualMachineInstancePreset), &corev1.VirtualMachineInstancePreset{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstancePreset), err +} + +// Update takes the representation of a virtualMachineInstancePreset and updates it. Returns the server's representation of the virtualMachineInstancePreset, and an error, if there is any. +func (c *FakeVirtualMachineInstancePresets) Update(ctx context.Context, virtualMachineInstancePreset *corev1.VirtualMachineInstancePreset, opts v1.UpdateOptions) (result *corev1.VirtualMachineInstancePreset, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachineinstancepresetsResource, c.ns, virtualMachineInstancePreset), &corev1.VirtualMachineInstancePreset{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstancePreset), err +} + +// Delete takes name of the virtualMachineInstancePreset and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineInstancePresets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachineinstancepresetsResource, c.ns, name, opts), &corev1.VirtualMachineInstancePreset{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineInstancePresets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachineinstancepresetsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &corev1.VirtualMachineInstancePresetList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineInstancePreset. +func (c *FakeVirtualMachineInstancePresets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.VirtualMachineInstancePreset, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachineinstancepresetsResource, c.ns, name, pt, data, subresources...), &corev1.VirtualMachineInstancePreset{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstancePreset), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstancereplicaset.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstancereplicaset.go new file mode 100644 index 00000000..84ca9032 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/fake/fake_virtualmachineinstancereplicaset.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" + corev1 "kubevirt.io/api/core/v1" +) + +// FakeVirtualMachineInstanceReplicaSets implements VirtualMachineInstanceReplicaSetInterface +type FakeVirtualMachineInstanceReplicaSets struct { + Fake *FakeKubevirtV1 + ns string +} + +var virtualmachineinstancereplicasetsResource = schema.GroupVersionResource{Group: "kubevirt.io", Version: "v1", Resource: "virtualmachineinstancereplicasets"} + +var virtualmachineinstancereplicasetsKind = schema.GroupVersionKind{Group: "kubevirt.io", Version: "v1", Kind: "VirtualMachineInstanceReplicaSet"} + +// Get takes name of the virtualMachineInstanceReplicaSet, and returns the corresponding virtualMachineInstanceReplicaSet object, and an error if there is any. +func (c *FakeVirtualMachineInstanceReplicaSets) Get(ctx context.Context, name string, options v1.GetOptions) (result *corev1.VirtualMachineInstanceReplicaSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(virtualmachineinstancereplicasetsResource, c.ns, name), &corev1.VirtualMachineInstanceReplicaSet{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceReplicaSet), err +} + +// List takes label and field selectors, and returns the list of VirtualMachineInstanceReplicaSets that match those selectors. +func (c *FakeVirtualMachineInstanceReplicaSets) List(ctx context.Context, opts v1.ListOptions) (result *corev1.VirtualMachineInstanceReplicaSetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(virtualmachineinstancereplicasetsResource, virtualmachineinstancereplicasetsKind, c.ns, opts), &corev1.VirtualMachineInstanceReplicaSetList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &corev1.VirtualMachineInstanceReplicaSetList{ListMeta: obj.(*corev1.VirtualMachineInstanceReplicaSetList).ListMeta} + for _, item := range obj.(*corev1.VirtualMachineInstanceReplicaSetList).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 virtualMachineInstanceReplicaSets. +func (c *FakeVirtualMachineInstanceReplicaSets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(virtualmachineinstancereplicasetsResource, c.ns, opts)) + +} + +// Create takes the representation of a virtualMachineInstanceReplicaSet and creates it. Returns the server's representation of the virtualMachineInstanceReplicaSet, and an error, if there is any. +func (c *FakeVirtualMachineInstanceReplicaSets) Create(ctx context.Context, virtualMachineInstanceReplicaSet *corev1.VirtualMachineInstanceReplicaSet, opts v1.CreateOptions) (result *corev1.VirtualMachineInstanceReplicaSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(virtualmachineinstancereplicasetsResource, c.ns, virtualMachineInstanceReplicaSet), &corev1.VirtualMachineInstanceReplicaSet{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceReplicaSet), err +} + +// Update takes the representation of a virtualMachineInstanceReplicaSet and updates it. Returns the server's representation of the virtualMachineInstanceReplicaSet, and an error, if there is any. +func (c *FakeVirtualMachineInstanceReplicaSets) Update(ctx context.Context, virtualMachineInstanceReplicaSet *corev1.VirtualMachineInstanceReplicaSet, opts v1.UpdateOptions) (result *corev1.VirtualMachineInstanceReplicaSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(virtualmachineinstancereplicasetsResource, c.ns, virtualMachineInstanceReplicaSet), &corev1.VirtualMachineInstanceReplicaSet{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceReplicaSet), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVirtualMachineInstanceReplicaSets) UpdateStatus(ctx context.Context, virtualMachineInstanceReplicaSet *corev1.VirtualMachineInstanceReplicaSet, opts v1.UpdateOptions) (*corev1.VirtualMachineInstanceReplicaSet, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(virtualmachineinstancereplicasetsResource, "status", c.ns, virtualMachineInstanceReplicaSet), &corev1.VirtualMachineInstanceReplicaSet{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceReplicaSet), err +} + +// Delete takes name of the virtualMachineInstanceReplicaSet and deletes it. Returns an error if one occurs. +func (c *FakeVirtualMachineInstanceReplicaSets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(virtualmachineinstancereplicasetsResource, c.ns, name, opts), &corev1.VirtualMachineInstanceReplicaSet{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVirtualMachineInstanceReplicaSets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(virtualmachineinstancereplicasetsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &corev1.VirtualMachineInstanceReplicaSetList{}) + return err +} + +// Patch applies the patch and returns the patched virtualMachineInstanceReplicaSet. +func (c *FakeVirtualMachineInstanceReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *corev1.VirtualMachineInstanceReplicaSet, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(virtualmachineinstancereplicasetsResource, c.ns, name, pt, data, subresources...), &corev1.VirtualMachineInstanceReplicaSet{}) + + if obj == nil { + return nil, err + } + return obj.(*corev1.VirtualMachineInstanceReplicaSet), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/generated_expansion.go new file mode 100644 index 00000000..f0eb7121 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/generated_expansion.go @@ -0,0 +1,31 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +type KubeVirtExpansion interface{} + +type VirtualMachineExpansion interface{} + +type VirtualMachineInstanceExpansion interface{} + +type VirtualMachineInstanceMigrationExpansion interface{} + +type VirtualMachineInstancePresetExpansion interface{} + +type VirtualMachineInstanceReplicaSetExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/kubevirt.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/kubevirt.go new file mode 100644 index 00000000..9caa2936 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/kubevirt.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + metav1 "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" + v1 "kubevirt.io/api/core/v1" +) + +// KubeVirtsGetter has a method to return a KubeVirtInterface. +// A group's client should implement this interface. +type KubeVirtsGetter interface { + KubeVirts(namespace string) KubeVirtInterface +} + +// KubeVirtInterface has methods to work with KubeVirt resources. +type KubeVirtInterface interface { + Create(ctx context.Context, kubeVirt *v1.KubeVirt, opts metav1.CreateOptions) (*v1.KubeVirt, error) + Update(ctx context.Context, kubeVirt *v1.KubeVirt, opts metav1.UpdateOptions) (*v1.KubeVirt, error) + UpdateStatus(ctx context.Context, kubeVirt *v1.KubeVirt, opts metav1.UpdateOptions) (*v1.KubeVirt, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.KubeVirt, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.KubeVirtList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.KubeVirt, err error) + KubeVirtExpansion +} + +// kubeVirts implements KubeVirtInterface +type kubeVirts struct { + client rest.Interface + ns string +} + +// newKubeVirts returns a KubeVirts +func newKubeVirts(c *KubevirtV1Client, namespace string) *kubeVirts { + return &kubeVirts{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the kubeVirt, and returns the corresponding kubeVirt object, and an error if there is any. +func (c *kubeVirts) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.KubeVirt, err error) { + result = &v1.KubeVirt{} + err = c.client.Get(). + Namespace(c.ns). + Resource("kubevirts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of KubeVirts that match those selectors. +func (c *kubeVirts) List(ctx context.Context, opts metav1.ListOptions) (result *v1.KubeVirtList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.KubeVirtList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("kubevirts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested kubeVirts. +func (c *kubeVirts) Watch(ctx context.Context, opts metav1.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("kubevirts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a kubeVirt and creates it. Returns the server's representation of the kubeVirt, and an error, if there is any. +func (c *kubeVirts) Create(ctx context.Context, kubeVirt *v1.KubeVirt, opts metav1.CreateOptions) (result *v1.KubeVirt, err error) { + result = &v1.KubeVirt{} + err = c.client.Post(). + Namespace(c.ns). + Resource("kubevirts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(kubeVirt). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a kubeVirt and updates it. Returns the server's representation of the kubeVirt, and an error, if there is any. +func (c *kubeVirts) Update(ctx context.Context, kubeVirt *v1.KubeVirt, opts metav1.UpdateOptions) (result *v1.KubeVirt, err error) { + result = &v1.KubeVirt{} + err = c.client.Put(). + Namespace(c.ns). + Resource("kubevirts"). + Name(kubeVirt.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(kubeVirt). + Do(ctx). + 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 *kubeVirts) UpdateStatus(ctx context.Context, kubeVirt *v1.KubeVirt, opts metav1.UpdateOptions) (result *v1.KubeVirt, err error) { + result = &v1.KubeVirt{} + err = c.client.Put(). + Namespace(c.ns). + Resource("kubevirts"). + Name(kubeVirt.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(kubeVirt). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the kubeVirt and deletes it. Returns an error if one occurs. +func (c *kubeVirts) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("kubevirts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *kubeVirts) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("kubevirts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched kubeVirt. +func (c *kubeVirts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.KubeVirt, err error) { + result = &v1.KubeVirt{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("kubevirts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/kubevirt.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/kubevirt.io_client.go new file mode 100644 index 00000000..aabeba7b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/kubevirt.io_client.go @@ -0,0 +1,132 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" + v1 "kubevirt.io/api/core/v1" +) + +type KubevirtV1Interface interface { + RESTClient() rest.Interface + KubeVirtsGetter + VirtualMachinesGetter + VirtualMachineInstancesGetter + VirtualMachineInstanceMigrationsGetter + VirtualMachineInstancePresetsGetter + VirtualMachineInstanceReplicaSetsGetter +} + +// KubevirtV1Client is used to interact with features provided by the kubevirt.io group. +type KubevirtV1Client struct { + restClient rest.Interface +} + +func (c *KubevirtV1Client) KubeVirts(namespace string) KubeVirtInterface { + return newKubeVirts(c, namespace) +} + +func (c *KubevirtV1Client) VirtualMachines(namespace string) VirtualMachineInterface { + return newVirtualMachines(c, namespace) +} + +func (c *KubevirtV1Client) VirtualMachineInstances(namespace string) VirtualMachineInstanceInterface { + return newVirtualMachineInstances(c, namespace) +} + +func (c *KubevirtV1Client) VirtualMachineInstanceMigrations(namespace string) VirtualMachineInstanceMigrationInterface { + return newVirtualMachineInstanceMigrations(c, namespace) +} + +func (c *KubevirtV1Client) VirtualMachineInstancePresets(namespace string) VirtualMachineInstancePresetInterface { + return newVirtualMachineInstancePresets(c, namespace) +} + +func (c *KubevirtV1Client) VirtualMachineInstanceReplicaSets(namespace string) VirtualMachineInstanceReplicaSetInterface { + return newVirtualMachineInstanceReplicaSets(c, namespace) +} + +// NewForConfig creates a new KubevirtV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*KubevirtV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new KubevirtV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*KubevirtV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &KubevirtV1Client{client}, nil +} + +// NewForConfigOrDie creates a new KubevirtV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *KubevirtV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new KubevirtV1Client for the given RESTClient. +func New(c rest.Interface) *KubevirtV1Client { + return &KubevirtV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.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 *KubevirtV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachine.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachine.go new file mode 100644 index 00000000..2350a4c8 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachine.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + metav1 "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" + v1 "kubevirt.io/api/core/v1" +) + +// VirtualMachinesGetter has a method to return a VirtualMachineInterface. +// A group's client should implement this interface. +type VirtualMachinesGetter interface { + VirtualMachines(namespace string) VirtualMachineInterface +} + +// VirtualMachineInterface has methods to work with VirtualMachine resources. +type VirtualMachineInterface interface { + Create(ctx context.Context, virtualMachine *v1.VirtualMachine, opts metav1.CreateOptions) (*v1.VirtualMachine, error) + Update(ctx context.Context, virtualMachine *v1.VirtualMachine, opts metav1.UpdateOptions) (*v1.VirtualMachine, error) + UpdateStatus(ctx context.Context, virtualMachine *v1.VirtualMachine, opts metav1.UpdateOptions) (*v1.VirtualMachine, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VirtualMachine, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VirtualMachineList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachine, err error) + VirtualMachineExpansion +} + +// virtualMachines implements VirtualMachineInterface +type virtualMachines struct { + client rest.Interface + ns string +} + +// newVirtualMachines returns a VirtualMachines +func newVirtualMachines(c *KubevirtV1Client, namespace string) *virtualMachines { + return &virtualMachines{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachine, and returns the corresponding virtualMachine object, and an error if there is any. +func (c *virtualMachines) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualMachine, err error) { + result = &v1.VirtualMachine{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachines"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachines that match those selectors. +func (c *virtualMachines) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualMachineList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VirtualMachineList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachines. +func (c *virtualMachines) Watch(ctx context.Context, opts metav1.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("virtualmachines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachine and creates it. Returns the server's representation of the virtualMachine, and an error, if there is any. +func (c *virtualMachines) Create(ctx context.Context, virtualMachine *v1.VirtualMachine, opts metav1.CreateOptions) (result *v1.VirtualMachine, err error) { + result = &v1.VirtualMachine{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachines"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachine). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachine and updates it. Returns the server's representation of the virtualMachine, and an error, if there is any. +func (c *virtualMachines) Update(ctx context.Context, virtualMachine *v1.VirtualMachine, opts metav1.UpdateOptions) (result *v1.VirtualMachine, err error) { + result = &v1.VirtualMachine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachines"). + Name(virtualMachine.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachine). + Do(ctx). + 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 *virtualMachines) UpdateStatus(ctx context.Context, virtualMachine *v1.VirtualMachine, opts metav1.UpdateOptions) (result *v1.VirtualMachine, err error) { + result = &v1.VirtualMachine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachines"). + Name(virtualMachine.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachine). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachine and deletes it. Returns an error if one occurs. +func (c *virtualMachines) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachines"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachines) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachines"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachine. +func (c *virtualMachines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachine, err error) { + result = &v1.VirtualMachine{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachines"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstance.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstance.go new file mode 100644 index 00000000..52c8014b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstance.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + metav1 "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" + v1 "kubevirt.io/api/core/v1" +) + +// VirtualMachineInstancesGetter has a method to return a VirtualMachineInstanceInterface. +// A group's client should implement this interface. +type VirtualMachineInstancesGetter interface { + VirtualMachineInstances(namespace string) VirtualMachineInstanceInterface +} + +// VirtualMachineInstanceInterface has methods to work with VirtualMachineInstance resources. +type VirtualMachineInstanceInterface interface { + Create(ctx context.Context, virtualMachineInstance *v1.VirtualMachineInstance, opts metav1.CreateOptions) (*v1.VirtualMachineInstance, error) + Update(ctx context.Context, virtualMachineInstance *v1.VirtualMachineInstance, opts metav1.UpdateOptions) (*v1.VirtualMachineInstance, error) + UpdateStatus(ctx context.Context, virtualMachineInstance *v1.VirtualMachineInstance, opts metav1.UpdateOptions) (*v1.VirtualMachineInstance, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VirtualMachineInstance, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VirtualMachineInstanceList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachineInstance, err error) + VirtualMachineInstanceExpansion +} + +// virtualMachineInstances implements VirtualMachineInstanceInterface +type virtualMachineInstances struct { + client rest.Interface + ns string +} + +// newVirtualMachineInstances returns a VirtualMachineInstances +func newVirtualMachineInstances(c *KubevirtV1Client, namespace string) *virtualMachineInstances { + return &virtualMachineInstances{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineInstance, and returns the corresponding virtualMachineInstance object, and an error if there is any. +func (c *virtualMachineInstances) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualMachineInstance, err error) { + result = &v1.VirtualMachineInstance{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineinstances"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineInstances that match those selectors. +func (c *virtualMachineInstances) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualMachineInstanceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VirtualMachineInstanceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineinstances"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineInstances. +func (c *virtualMachineInstances) Watch(ctx context.Context, opts metav1.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("virtualmachineinstances"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineInstance and creates it. Returns the server's representation of the virtualMachineInstance, and an error, if there is any. +func (c *virtualMachineInstances) Create(ctx context.Context, virtualMachineInstance *v1.VirtualMachineInstance, opts metav1.CreateOptions) (result *v1.VirtualMachineInstance, err error) { + result = &v1.VirtualMachineInstance{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachineinstances"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstance). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineInstance and updates it. Returns the server's representation of the virtualMachineInstance, and an error, if there is any. +func (c *virtualMachineInstances) Update(ctx context.Context, virtualMachineInstance *v1.VirtualMachineInstance, opts metav1.UpdateOptions) (result *v1.VirtualMachineInstance, err error) { + result = &v1.VirtualMachineInstance{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineinstances"). + Name(virtualMachineInstance.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstance). + Do(ctx). + 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 *virtualMachineInstances) UpdateStatus(ctx context.Context, virtualMachineInstance *v1.VirtualMachineInstance, opts metav1.UpdateOptions) (result *v1.VirtualMachineInstance, err error) { + result = &v1.VirtualMachineInstance{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineinstances"). + Name(virtualMachineInstance.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstance). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineInstance and deletes it. Returns an error if one occurs. +func (c *virtualMachineInstances) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineinstances"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineInstances) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineinstances"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineInstance. +func (c *virtualMachineInstances) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachineInstance, err error) { + result = &v1.VirtualMachineInstance{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachineinstances"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstancemigration.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstancemigration.go new file mode 100644 index 00000000..360f87cd --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstancemigration.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + metav1 "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" + v1 "kubevirt.io/api/core/v1" +) + +// VirtualMachineInstanceMigrationsGetter has a method to return a VirtualMachineInstanceMigrationInterface. +// A group's client should implement this interface. +type VirtualMachineInstanceMigrationsGetter interface { + VirtualMachineInstanceMigrations(namespace string) VirtualMachineInstanceMigrationInterface +} + +// VirtualMachineInstanceMigrationInterface has methods to work with VirtualMachineInstanceMigration resources. +type VirtualMachineInstanceMigrationInterface interface { + Create(ctx context.Context, virtualMachineInstanceMigration *v1.VirtualMachineInstanceMigration, opts metav1.CreateOptions) (*v1.VirtualMachineInstanceMigration, error) + Update(ctx context.Context, virtualMachineInstanceMigration *v1.VirtualMachineInstanceMigration, opts metav1.UpdateOptions) (*v1.VirtualMachineInstanceMigration, error) + UpdateStatus(ctx context.Context, virtualMachineInstanceMigration *v1.VirtualMachineInstanceMigration, opts metav1.UpdateOptions) (*v1.VirtualMachineInstanceMigration, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VirtualMachineInstanceMigration, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VirtualMachineInstanceMigrationList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachineInstanceMigration, err error) + VirtualMachineInstanceMigrationExpansion +} + +// virtualMachineInstanceMigrations implements VirtualMachineInstanceMigrationInterface +type virtualMachineInstanceMigrations struct { + client rest.Interface + ns string +} + +// newVirtualMachineInstanceMigrations returns a VirtualMachineInstanceMigrations +func newVirtualMachineInstanceMigrations(c *KubevirtV1Client, namespace string) *virtualMachineInstanceMigrations { + return &virtualMachineInstanceMigrations{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineInstanceMigration, and returns the corresponding virtualMachineInstanceMigration object, and an error if there is any. +func (c *virtualMachineInstanceMigrations) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualMachineInstanceMigration, err error) { + result = &v1.VirtualMachineInstanceMigration{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineinstancemigrations"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineInstanceMigrations that match those selectors. +func (c *virtualMachineInstanceMigrations) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualMachineInstanceMigrationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VirtualMachineInstanceMigrationList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineinstancemigrations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineInstanceMigrations. +func (c *virtualMachineInstanceMigrations) Watch(ctx context.Context, opts metav1.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("virtualmachineinstancemigrations"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineInstanceMigration and creates it. Returns the server's representation of the virtualMachineInstanceMigration, and an error, if there is any. +func (c *virtualMachineInstanceMigrations) Create(ctx context.Context, virtualMachineInstanceMigration *v1.VirtualMachineInstanceMigration, opts metav1.CreateOptions) (result *v1.VirtualMachineInstanceMigration, err error) { + result = &v1.VirtualMachineInstanceMigration{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachineinstancemigrations"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstanceMigration). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineInstanceMigration and updates it. Returns the server's representation of the virtualMachineInstanceMigration, and an error, if there is any. +func (c *virtualMachineInstanceMigrations) Update(ctx context.Context, virtualMachineInstanceMigration *v1.VirtualMachineInstanceMigration, opts metav1.UpdateOptions) (result *v1.VirtualMachineInstanceMigration, err error) { + result = &v1.VirtualMachineInstanceMigration{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineinstancemigrations"). + Name(virtualMachineInstanceMigration.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstanceMigration). + Do(ctx). + 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 *virtualMachineInstanceMigrations) UpdateStatus(ctx context.Context, virtualMachineInstanceMigration *v1.VirtualMachineInstanceMigration, opts metav1.UpdateOptions) (result *v1.VirtualMachineInstanceMigration, err error) { + result = &v1.VirtualMachineInstanceMigration{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineinstancemigrations"). + Name(virtualMachineInstanceMigration.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstanceMigration). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineInstanceMigration and deletes it. Returns an error if one occurs. +func (c *virtualMachineInstanceMigrations) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineinstancemigrations"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineInstanceMigrations) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineinstancemigrations"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineInstanceMigration. +func (c *virtualMachineInstanceMigrations) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachineInstanceMigration, err error) { + result = &v1.VirtualMachineInstanceMigration{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachineinstancemigrations"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstancepreset.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstancepreset.go new file mode 100644 index 00000000..814de2a5 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstancepreset.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + metav1 "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" + v1 "kubevirt.io/api/core/v1" +) + +// VirtualMachineInstancePresetsGetter has a method to return a VirtualMachineInstancePresetInterface. +// A group's client should implement this interface. +type VirtualMachineInstancePresetsGetter interface { + VirtualMachineInstancePresets(namespace string) VirtualMachineInstancePresetInterface +} + +// VirtualMachineInstancePresetInterface has methods to work with VirtualMachineInstancePreset resources. +type VirtualMachineInstancePresetInterface interface { + Create(ctx context.Context, virtualMachineInstancePreset *v1.VirtualMachineInstancePreset, opts metav1.CreateOptions) (*v1.VirtualMachineInstancePreset, error) + Update(ctx context.Context, virtualMachineInstancePreset *v1.VirtualMachineInstancePreset, opts metav1.UpdateOptions) (*v1.VirtualMachineInstancePreset, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VirtualMachineInstancePreset, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VirtualMachineInstancePresetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachineInstancePreset, err error) + VirtualMachineInstancePresetExpansion +} + +// virtualMachineInstancePresets implements VirtualMachineInstancePresetInterface +type virtualMachineInstancePresets struct { + client rest.Interface + ns string +} + +// newVirtualMachineInstancePresets returns a VirtualMachineInstancePresets +func newVirtualMachineInstancePresets(c *KubevirtV1Client, namespace string) *virtualMachineInstancePresets { + return &virtualMachineInstancePresets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineInstancePreset, and returns the corresponding virtualMachineInstancePreset object, and an error if there is any. +func (c *virtualMachineInstancePresets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualMachineInstancePreset, err error) { + result = &v1.VirtualMachineInstancePreset{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineinstancepresets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineInstancePresets that match those selectors. +func (c *virtualMachineInstancePresets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualMachineInstancePresetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VirtualMachineInstancePresetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineinstancepresets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineInstancePresets. +func (c *virtualMachineInstancePresets) Watch(ctx context.Context, opts metav1.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("virtualmachineinstancepresets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineInstancePreset and creates it. Returns the server's representation of the virtualMachineInstancePreset, and an error, if there is any. +func (c *virtualMachineInstancePresets) Create(ctx context.Context, virtualMachineInstancePreset *v1.VirtualMachineInstancePreset, opts metav1.CreateOptions) (result *v1.VirtualMachineInstancePreset, err error) { + result = &v1.VirtualMachineInstancePreset{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachineinstancepresets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstancePreset). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineInstancePreset and updates it. Returns the server's representation of the virtualMachineInstancePreset, and an error, if there is any. +func (c *virtualMachineInstancePresets) Update(ctx context.Context, virtualMachineInstancePreset *v1.VirtualMachineInstancePreset, opts metav1.UpdateOptions) (result *v1.VirtualMachineInstancePreset, err error) { + result = &v1.VirtualMachineInstancePreset{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineinstancepresets"). + Name(virtualMachineInstancePreset.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstancePreset). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineInstancePreset and deletes it. Returns an error if one occurs. +func (c *virtualMachineInstancePresets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineinstancepresets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineInstancePresets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineinstancepresets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineInstancePreset. +func (c *virtualMachineInstancePresets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachineInstancePreset, err error) { + result = &v1.VirtualMachineInstancePreset{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachineinstancepresets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstancereplicaset.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstancereplicaset.go new file mode 100644 index 00000000..18e294bc --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1/virtualmachineinstancereplicaset.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + metav1 "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" + v1 "kubevirt.io/api/core/v1" +) + +// VirtualMachineInstanceReplicaSetsGetter has a method to return a VirtualMachineInstanceReplicaSetInterface. +// A group's client should implement this interface. +type VirtualMachineInstanceReplicaSetsGetter interface { + VirtualMachineInstanceReplicaSets(namespace string) VirtualMachineInstanceReplicaSetInterface +} + +// VirtualMachineInstanceReplicaSetInterface has methods to work with VirtualMachineInstanceReplicaSet resources. +type VirtualMachineInstanceReplicaSetInterface interface { + Create(ctx context.Context, virtualMachineInstanceReplicaSet *v1.VirtualMachineInstanceReplicaSet, opts metav1.CreateOptions) (*v1.VirtualMachineInstanceReplicaSet, error) + Update(ctx context.Context, virtualMachineInstanceReplicaSet *v1.VirtualMachineInstanceReplicaSet, opts metav1.UpdateOptions) (*v1.VirtualMachineInstanceReplicaSet, error) + UpdateStatus(ctx context.Context, virtualMachineInstanceReplicaSet *v1.VirtualMachineInstanceReplicaSet, opts metav1.UpdateOptions) (*v1.VirtualMachineInstanceReplicaSet, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.VirtualMachineInstanceReplicaSet, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.VirtualMachineInstanceReplicaSetList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachineInstanceReplicaSet, err error) + VirtualMachineInstanceReplicaSetExpansion +} + +// virtualMachineInstanceReplicaSets implements VirtualMachineInstanceReplicaSetInterface +type virtualMachineInstanceReplicaSets struct { + client rest.Interface + ns string +} + +// newVirtualMachineInstanceReplicaSets returns a VirtualMachineInstanceReplicaSets +func newVirtualMachineInstanceReplicaSets(c *KubevirtV1Client, namespace string) *virtualMachineInstanceReplicaSets { + return &virtualMachineInstanceReplicaSets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the virtualMachineInstanceReplicaSet, and returns the corresponding virtualMachineInstanceReplicaSet object, and an error if there is any. +func (c *virtualMachineInstanceReplicaSets) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.VirtualMachineInstanceReplicaSet, err error) { + result = &v1.VirtualMachineInstanceReplicaSet{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineinstancereplicasets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VirtualMachineInstanceReplicaSets that match those selectors. +func (c *virtualMachineInstanceReplicaSets) List(ctx context.Context, opts metav1.ListOptions) (result *v1.VirtualMachineInstanceReplicaSetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.VirtualMachineInstanceReplicaSetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("virtualmachineinstancereplicasets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested virtualMachineInstanceReplicaSets. +func (c *virtualMachineInstanceReplicaSets) Watch(ctx context.Context, opts metav1.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("virtualmachineinstancereplicasets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a virtualMachineInstanceReplicaSet and creates it. Returns the server's representation of the virtualMachineInstanceReplicaSet, and an error, if there is any. +func (c *virtualMachineInstanceReplicaSets) Create(ctx context.Context, virtualMachineInstanceReplicaSet *v1.VirtualMachineInstanceReplicaSet, opts metav1.CreateOptions) (result *v1.VirtualMachineInstanceReplicaSet, err error) { + result = &v1.VirtualMachineInstanceReplicaSet{} + err = c.client.Post(). + Namespace(c.ns). + Resource("virtualmachineinstancereplicasets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstanceReplicaSet). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a virtualMachineInstanceReplicaSet and updates it. Returns the server's representation of the virtualMachineInstanceReplicaSet, and an error, if there is any. +func (c *virtualMachineInstanceReplicaSets) Update(ctx context.Context, virtualMachineInstanceReplicaSet *v1.VirtualMachineInstanceReplicaSet, opts metav1.UpdateOptions) (result *v1.VirtualMachineInstanceReplicaSet, err error) { + result = &v1.VirtualMachineInstanceReplicaSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineinstancereplicasets"). + Name(virtualMachineInstanceReplicaSet.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstanceReplicaSet). + Do(ctx). + 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 *virtualMachineInstanceReplicaSets) UpdateStatus(ctx context.Context, virtualMachineInstanceReplicaSet *v1.VirtualMachineInstanceReplicaSet, opts metav1.UpdateOptions) (result *v1.VirtualMachineInstanceReplicaSet, err error) { + result = &v1.VirtualMachineInstanceReplicaSet{} + err = c.client.Put(). + Namespace(c.ns). + Resource("virtualmachineinstancereplicasets"). + Name(virtualMachineInstanceReplicaSet.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(virtualMachineInstanceReplicaSet). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the virtualMachineInstanceReplicaSet and deletes it. Returns an error if one occurs. +func (c *virtualMachineInstanceReplicaSets) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineinstancereplicasets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *virtualMachineInstanceReplicaSets) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("virtualmachineinstancereplicasets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched virtualMachineInstanceReplicaSet. +func (c *virtualMachineInstanceReplicaSets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.VirtualMachineInstanceReplicaSet, err error) { + result = &v1.VirtualMachineInstanceReplicaSet{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("virtualmachineinstancereplicasets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/clusterflow.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/clusterflow.go new file mode 100644 index 00000000..90e9a083 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/clusterflow.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// ClusterFlowsGetter has a method to return a ClusterFlowInterface. +// A group's client should implement this interface. +type ClusterFlowsGetter interface { + ClusterFlows() ClusterFlowInterface +} + +// ClusterFlowInterface has methods to work with ClusterFlow resources. +type ClusterFlowInterface interface { + Create(ctx context.Context, clusterFlow *v1beta1.ClusterFlow, opts v1.CreateOptions) (*v1beta1.ClusterFlow, error) + Update(ctx context.Context, clusterFlow *v1beta1.ClusterFlow, opts v1.UpdateOptions) (*v1beta1.ClusterFlow, error) + UpdateStatus(ctx context.Context, clusterFlow *v1beta1.ClusterFlow, opts v1.UpdateOptions) (*v1beta1.ClusterFlow, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterFlow, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterFlowList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterFlow, err error) + ClusterFlowExpansion +} + +// clusterFlows implements ClusterFlowInterface +type clusterFlows struct { + client rest.Interface +} + +// newClusterFlows returns a ClusterFlows +func newClusterFlows(c *LoggingV1beta1Client) *clusterFlows { + return &clusterFlows{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterFlow, and returns the corresponding clusterFlow object, and an error if there is any. +func (c *clusterFlows) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterFlow, err error) { + result = &v1beta1.ClusterFlow{} + err = c.client.Get(). + Resource("clusterflows"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterFlows that match those selectors. +func (c *clusterFlows) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterFlowList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ClusterFlowList{} + err = c.client.Get(). + Resource("clusterflows"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterFlows. +func (c *clusterFlows) Watch(ctx context.Context, 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(). + Resource("clusterflows"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterFlow and creates it. Returns the server's representation of the clusterFlow, and an error, if there is any. +func (c *clusterFlows) Create(ctx context.Context, clusterFlow *v1beta1.ClusterFlow, opts v1.CreateOptions) (result *v1beta1.ClusterFlow, err error) { + result = &v1beta1.ClusterFlow{} + err = c.client.Post(). + Resource("clusterflows"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterFlow). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterFlow and updates it. Returns the server's representation of the clusterFlow, and an error, if there is any. +func (c *clusterFlows) Update(ctx context.Context, clusterFlow *v1beta1.ClusterFlow, opts v1.UpdateOptions) (result *v1beta1.ClusterFlow, err error) { + result = &v1beta1.ClusterFlow{} + err = c.client.Put(). + Resource("clusterflows"). + Name(clusterFlow.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterFlow). + Do(ctx). + 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 *clusterFlows) UpdateStatus(ctx context.Context, clusterFlow *v1beta1.ClusterFlow, opts v1.UpdateOptions) (result *v1beta1.ClusterFlow, err error) { + result = &v1beta1.ClusterFlow{} + err = c.client.Put(). + Resource("clusterflows"). + Name(clusterFlow.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterFlow). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterFlow and deletes it. Returns an error if one occurs. +func (c *clusterFlows) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusterflows"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterFlows) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clusterflows"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterFlow. +func (c *clusterFlows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterFlow, err error) { + result = &v1beta1.ClusterFlow{} + err = c.client.Patch(pt). + Resource("clusterflows"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/clusteroutput.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/clusteroutput.go new file mode 100644 index 00000000..bff4e6ad --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/clusteroutput.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// ClusterOutputsGetter has a method to return a ClusterOutputInterface. +// A group's client should implement this interface. +type ClusterOutputsGetter interface { + ClusterOutputs() ClusterOutputInterface +} + +// ClusterOutputInterface has methods to work with ClusterOutput resources. +type ClusterOutputInterface interface { + Create(ctx context.Context, clusterOutput *v1beta1.ClusterOutput, opts v1.CreateOptions) (*v1beta1.ClusterOutput, error) + Update(ctx context.Context, clusterOutput *v1beta1.ClusterOutput, opts v1.UpdateOptions) (*v1beta1.ClusterOutput, error) + UpdateStatus(ctx context.Context, clusterOutput *v1beta1.ClusterOutput, opts v1.UpdateOptions) (*v1beta1.ClusterOutput, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ClusterOutput, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ClusterOutputList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterOutput, err error) + ClusterOutputExpansion +} + +// clusterOutputs implements ClusterOutputInterface +type clusterOutputs struct { + client rest.Interface +} + +// newClusterOutputs returns a ClusterOutputs +func newClusterOutputs(c *LoggingV1beta1Client) *clusterOutputs { + return &clusterOutputs{ + client: c.RESTClient(), + } +} + +// Get takes name of the clusterOutput, and returns the corresponding clusterOutput object, and an error if there is any. +func (c *clusterOutputs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterOutput, err error) { + result = &v1beta1.ClusterOutput{} + err = c.client.Get(). + Resource("clusteroutputs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterOutputs that match those selectors. +func (c *clusterOutputs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterOutputList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ClusterOutputList{} + err = c.client.Get(). + Resource("clusteroutputs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterOutputs. +func (c *clusterOutputs) Watch(ctx context.Context, 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(). + Resource("clusteroutputs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterOutput and creates it. Returns the server's representation of the clusterOutput, and an error, if there is any. +func (c *clusterOutputs) Create(ctx context.Context, clusterOutput *v1beta1.ClusterOutput, opts v1.CreateOptions) (result *v1beta1.ClusterOutput, err error) { + result = &v1beta1.ClusterOutput{} + err = c.client.Post(). + Resource("clusteroutputs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterOutput). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterOutput and updates it. Returns the server's representation of the clusterOutput, and an error, if there is any. +func (c *clusterOutputs) Update(ctx context.Context, clusterOutput *v1beta1.ClusterOutput, opts v1.UpdateOptions) (result *v1beta1.ClusterOutput, err error) { + result = &v1beta1.ClusterOutput{} + err = c.client.Put(). + Resource("clusteroutputs"). + Name(clusterOutput.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterOutput). + Do(ctx). + 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 *clusterOutputs) UpdateStatus(ctx context.Context, clusterOutput *v1beta1.ClusterOutput, opts v1.UpdateOptions) (result *v1beta1.ClusterOutput, err error) { + result = &v1beta1.ClusterOutput{} + err = c.client.Put(). + Resource("clusteroutputs"). + Name(clusterOutput.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterOutput). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterOutput and deletes it. Returns an error if one occurs. +func (c *clusterOutputs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusteroutputs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterOutputs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clusteroutputs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterOutput. +func (c *clusterOutputs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterOutput, err error) { + result = &v1beta1.ClusterOutput{} + err = c.client.Patch(pt). + Resource("clusteroutputs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/doc.go new file mode 100644 index 00000000..d9184aec --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_clusterflow.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_clusterflow.go new file mode 100644 index 00000000..71860648 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_clusterflow.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterFlows implements ClusterFlowInterface +type FakeClusterFlows struct { + Fake *FakeLoggingV1beta1 +} + +var clusterflowsResource = schema.GroupVersionResource{Group: "logging.banzaicloud.io", Version: "v1beta1", Resource: "clusterflows"} + +var clusterflowsKind = schema.GroupVersionKind{Group: "logging.banzaicloud.io", Version: "v1beta1", Kind: "ClusterFlow"} + +// Get takes name of the clusterFlow, and returns the corresponding clusterFlow object, and an error if there is any. +func (c *FakeClusterFlows) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterFlow, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clusterflowsResource, name), &v1beta1.ClusterFlow{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterFlow), err +} + +// List takes label and field selectors, and returns the list of ClusterFlows that match those selectors. +func (c *FakeClusterFlows) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterFlowList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clusterflowsResource, clusterflowsKind, opts), &v1beta1.ClusterFlowList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ClusterFlowList{ListMeta: obj.(*v1beta1.ClusterFlowList).ListMeta} + for _, item := range obj.(*v1beta1.ClusterFlowList).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 clusterFlows. +func (c *FakeClusterFlows) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clusterflowsResource, opts)) +} + +// Create takes the representation of a clusterFlow and creates it. Returns the server's representation of the clusterFlow, and an error, if there is any. +func (c *FakeClusterFlows) Create(ctx context.Context, clusterFlow *v1beta1.ClusterFlow, opts v1.CreateOptions) (result *v1beta1.ClusterFlow, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clusterflowsResource, clusterFlow), &v1beta1.ClusterFlow{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterFlow), err +} + +// Update takes the representation of a clusterFlow and updates it. Returns the server's representation of the clusterFlow, and an error, if there is any. +func (c *FakeClusterFlows) Update(ctx context.Context, clusterFlow *v1beta1.ClusterFlow, opts v1.UpdateOptions) (result *v1beta1.ClusterFlow, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clusterflowsResource, clusterFlow), &v1beta1.ClusterFlow{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterFlow), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterFlows) UpdateStatus(ctx context.Context, clusterFlow *v1beta1.ClusterFlow, opts v1.UpdateOptions) (*v1beta1.ClusterFlow, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clusterflowsResource, "status", clusterFlow), &v1beta1.ClusterFlow{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterFlow), err +} + +// Delete takes name of the clusterFlow and deletes it. Returns an error if one occurs. +func (c *FakeClusterFlows) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(clusterflowsResource, name, opts), &v1beta1.ClusterFlow{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterFlows) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusterflowsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ClusterFlowList{}) + return err +} + +// Patch applies the patch and returns the patched clusterFlow. +func (c *FakeClusterFlows) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterFlow, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clusterflowsResource, name, pt, data, subresources...), &v1beta1.ClusterFlow{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterFlow), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_clusteroutput.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_clusteroutput.go new file mode 100644 index 00000000..68625653 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_clusteroutput.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterOutputs implements ClusterOutputInterface +type FakeClusterOutputs struct { + Fake *FakeLoggingV1beta1 +} + +var clusteroutputsResource = schema.GroupVersionResource{Group: "logging.banzaicloud.io", Version: "v1beta1", Resource: "clusteroutputs"} + +var clusteroutputsKind = schema.GroupVersionKind{Group: "logging.banzaicloud.io", Version: "v1beta1", Kind: "ClusterOutput"} + +// Get takes name of the clusterOutput, and returns the corresponding clusterOutput object, and an error if there is any. +func (c *FakeClusterOutputs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ClusterOutput, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clusteroutputsResource, name), &v1beta1.ClusterOutput{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterOutput), err +} + +// List takes label and field selectors, and returns the list of ClusterOutputs that match those selectors. +func (c *FakeClusterOutputs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ClusterOutputList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clusteroutputsResource, clusteroutputsKind, opts), &v1beta1.ClusterOutputList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ClusterOutputList{ListMeta: obj.(*v1beta1.ClusterOutputList).ListMeta} + for _, item := range obj.(*v1beta1.ClusterOutputList).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 clusterOutputs. +func (c *FakeClusterOutputs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clusteroutputsResource, opts)) +} + +// Create takes the representation of a clusterOutput and creates it. Returns the server's representation of the clusterOutput, and an error, if there is any. +func (c *FakeClusterOutputs) Create(ctx context.Context, clusterOutput *v1beta1.ClusterOutput, opts v1.CreateOptions) (result *v1beta1.ClusterOutput, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clusteroutputsResource, clusterOutput), &v1beta1.ClusterOutput{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterOutput), err +} + +// Update takes the representation of a clusterOutput and updates it. Returns the server's representation of the clusterOutput, and an error, if there is any. +func (c *FakeClusterOutputs) Update(ctx context.Context, clusterOutput *v1beta1.ClusterOutput, opts v1.UpdateOptions) (result *v1beta1.ClusterOutput, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clusteroutputsResource, clusterOutput), &v1beta1.ClusterOutput{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterOutput), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterOutputs) UpdateStatus(ctx context.Context, clusterOutput *v1beta1.ClusterOutput, opts v1.UpdateOptions) (*v1beta1.ClusterOutput, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clusteroutputsResource, "status", clusterOutput), &v1beta1.ClusterOutput{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterOutput), err +} + +// Delete takes name of the clusterOutput and deletes it. Returns an error if one occurs. +func (c *FakeClusterOutputs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(clusteroutputsResource, name, opts), &v1beta1.ClusterOutput{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterOutputs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clusteroutputsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ClusterOutputList{}) + return err +} + +// Patch applies the patch and returns the patched clusterOutput. +func (c *FakeClusterOutputs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ClusterOutput, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clusteroutputsResource, name, pt, data, subresources...), &v1beta1.ClusterOutput{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ClusterOutput), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_logging.banzaicloud.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_logging.banzaicloud.io_client.go new file mode 100644 index 00000000..aee827e5 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_logging.banzaicloud.io_client.go @@ -0,0 +1,48 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeLoggingV1beta1 struct { + *testing.Fake +} + +func (c *FakeLoggingV1beta1) ClusterFlows() v1beta1.ClusterFlowInterface { + return &FakeClusterFlows{c} +} + +func (c *FakeLoggingV1beta1) ClusterOutputs() v1beta1.ClusterOutputInterface { + return &FakeClusterOutputs{c} +} + +func (c *FakeLoggingV1beta1) Loggings() v1beta1.LoggingInterface { + return &FakeLoggings{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeLoggingV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_logging.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_logging.go new file mode 100644 index 00000000..b9eedb92 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/fake/fake_logging.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeLoggings implements LoggingInterface +type FakeLoggings struct { + Fake *FakeLoggingV1beta1 +} + +var loggingsResource = schema.GroupVersionResource{Group: "logging.banzaicloud.io", Version: "v1beta1", Resource: "loggings"} + +var loggingsKind = schema.GroupVersionKind{Group: "logging.banzaicloud.io", Version: "v1beta1", Kind: "Logging"} + +// Get takes name of the logging, and returns the corresponding logging object, and an error if there is any. +func (c *FakeLoggings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Logging, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(loggingsResource, name), &v1beta1.Logging{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Logging), err +} + +// List takes label and field selectors, and returns the list of Loggings that match those selectors. +func (c *FakeLoggings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LoggingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(loggingsResource, loggingsKind, opts), &v1beta1.LoggingList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.LoggingList{ListMeta: obj.(*v1beta1.LoggingList).ListMeta} + for _, item := range obj.(*v1beta1.LoggingList).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 loggings. +func (c *FakeLoggings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(loggingsResource, opts)) +} + +// Create takes the representation of a logging and creates it. Returns the server's representation of the logging, and an error, if there is any. +func (c *FakeLoggings) Create(ctx context.Context, logging *v1beta1.Logging, opts v1.CreateOptions) (result *v1beta1.Logging, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(loggingsResource, logging), &v1beta1.Logging{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Logging), err +} + +// Update takes the representation of a logging and updates it. Returns the server's representation of the logging, and an error, if there is any. +func (c *FakeLoggings) Update(ctx context.Context, logging *v1beta1.Logging, opts v1.UpdateOptions) (result *v1beta1.Logging, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(loggingsResource, logging), &v1beta1.Logging{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Logging), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeLoggings) UpdateStatus(ctx context.Context, logging *v1beta1.Logging, opts v1.UpdateOptions) (*v1beta1.Logging, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(loggingsResource, "status", logging), &v1beta1.Logging{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Logging), err +} + +// Delete takes name of the logging and deletes it. Returns an error if one occurs. +func (c *FakeLoggings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(loggingsResource, name, opts), &v1beta1.Logging{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLoggings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(loggingsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.LoggingList{}) + return err +} + +// Patch applies the patch and returns the patched logging. +func (c *FakeLoggings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Logging, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(loggingsResource, name, pt, data, subresources...), &v1beta1.Logging{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Logging), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/generated_expansion.go new file mode 100644 index 00000000..55a0affa --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/generated_expansion.go @@ -0,0 +1,25 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +type ClusterFlowExpansion interface{} + +type ClusterOutputExpansion interface{} + +type LoggingExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/logging.banzaicloud.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/logging.banzaicloud.io_client.go new file mode 100644 index 00000000..a423091a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/logging.banzaicloud.io_client.go @@ -0,0 +1,117 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "net/http" + + v1beta1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + rest "k8s.io/client-go/rest" +) + +type LoggingV1beta1Interface interface { + RESTClient() rest.Interface + ClusterFlowsGetter + ClusterOutputsGetter + LoggingsGetter +} + +// LoggingV1beta1Client is used to interact with features provided by the logging.banzaicloud.io group. +type LoggingV1beta1Client struct { + restClient rest.Interface +} + +func (c *LoggingV1beta1Client) ClusterFlows() ClusterFlowInterface { + return newClusterFlows(c) +} + +func (c *LoggingV1beta1Client) ClusterOutputs() ClusterOutputInterface { + return newClusterOutputs(c) +} + +func (c *LoggingV1beta1Client) Loggings() LoggingInterface { + return newLoggings(c) +} + +// NewForConfig creates a new LoggingV1beta1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*LoggingV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new LoggingV1beta1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*LoggingV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &LoggingV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new LoggingV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *LoggingV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new LoggingV1beta1Client for the given RESTClient. +func New(c rest.Interface) *LoggingV1beta1Client { + return &LoggingV1beta1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1beta1.GroupVersion + 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 *LoggingV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/logging.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/logging.go new file mode 100644 index 00000000..990beea4 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1/logging.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + v1beta1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + scheme "github.com/harvester/harvester/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" +) + +// LoggingsGetter has a method to return a LoggingInterface. +// A group's client should implement this interface. +type LoggingsGetter interface { + Loggings() LoggingInterface +} + +// LoggingInterface has methods to work with Logging resources. +type LoggingInterface interface { + Create(ctx context.Context, logging *v1beta1.Logging, opts v1.CreateOptions) (*v1beta1.Logging, error) + Update(ctx context.Context, logging *v1beta1.Logging, opts v1.UpdateOptions) (*v1beta1.Logging, error) + UpdateStatus(ctx context.Context, logging *v1beta1.Logging, opts v1.UpdateOptions) (*v1beta1.Logging, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Logging, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.LoggingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Logging, err error) + LoggingExpansion +} + +// loggings implements LoggingInterface +type loggings struct { + client rest.Interface +} + +// newLoggings returns a Loggings +func newLoggings(c *LoggingV1beta1Client) *loggings { + return &loggings{ + client: c.RESTClient(), + } +} + +// Get takes name of the logging, and returns the corresponding logging object, and an error if there is any. +func (c *loggings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Logging, err error) { + result = &v1beta1.Logging{} + err = c.client.Get(). + Resource("loggings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Loggings that match those selectors. +func (c *loggings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.LoggingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.LoggingList{} + err = c.client.Get(). + Resource("loggings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested loggings. +func (c *loggings) Watch(ctx context.Context, 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(). + Resource("loggings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a logging and creates it. Returns the server's representation of the logging, and an error, if there is any. +func (c *loggings) Create(ctx context.Context, logging *v1beta1.Logging, opts v1.CreateOptions) (result *v1beta1.Logging, err error) { + result = &v1beta1.Logging{} + err = c.client.Post(). + Resource("loggings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(logging). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a logging and updates it. Returns the server's representation of the logging, and an error, if there is any. +func (c *loggings) Update(ctx context.Context, logging *v1beta1.Logging, opts v1.UpdateOptions) (result *v1beta1.Logging, err error) { + result = &v1beta1.Logging{} + err = c.client.Put(). + Resource("loggings"). + Name(logging.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(logging). + Do(ctx). + 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 *loggings) UpdateStatus(ctx context.Context, logging *v1beta1.Logging, opts v1.UpdateOptions) (result *v1beta1.Logging, err error) { + result = &v1beta1.Logging{} + err = c.client.Put(). + Resource("loggings"). + Name(logging.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(logging). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the logging and deletes it. Returns an error if one occurs. +func (c *loggings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("loggings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *loggings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("loggings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched logging. +func (c *loggings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Logging, err error) { + result = &v1beta1.Logging{} + err = c.client.Patch(pt). + Resource("loggings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backingimage.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backingimage.go new file mode 100644 index 00000000..83ab534c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backingimage.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// BackingImagesGetter has a method to return a BackingImageInterface. +// A group's client should implement this interface. +type BackingImagesGetter interface { + BackingImages(namespace string) BackingImageInterface +} + +// BackingImageInterface has methods to work with BackingImage resources. +type BackingImageInterface interface { + Create(ctx context.Context, backingImage *v1beta1.BackingImage, opts v1.CreateOptions) (*v1beta1.BackingImage, error) + Update(ctx context.Context, backingImage *v1beta1.BackingImage, opts v1.UpdateOptions) (*v1beta1.BackingImage, error) + UpdateStatus(ctx context.Context, backingImage *v1beta1.BackingImage, opts v1.UpdateOptions) (*v1beta1.BackingImage, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.BackingImage, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BackingImageList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackingImage, err error) + BackingImageExpansion +} + +// backingImages implements BackingImageInterface +type backingImages struct { + client rest.Interface + ns string +} + +// newBackingImages returns a BackingImages +func newBackingImages(c *LonghornV1beta1Client, namespace string) *backingImages { + return &backingImages{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the backingImage, and returns the corresponding backingImage object, and an error if there is any. +func (c *backingImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackingImage, err error) { + result = &v1beta1.BackingImage{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backingimages"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BackingImages that match those selectors. +func (c *backingImages) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackingImageList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.BackingImageList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backingimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backingImages. +func (c *backingImages) Watch(ctx context.Context, 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("backingimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a backingImage and creates it. Returns the server's representation of the backingImage, and an error, if there is any. +func (c *backingImages) Create(ctx context.Context, backingImage *v1beta1.BackingImage, opts v1.CreateOptions) (result *v1beta1.BackingImage, err error) { + result = &v1beta1.BackingImage{} + err = c.client.Post(). + Namespace(c.ns). + Resource("backingimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backingImage). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a backingImage and updates it. Returns the server's representation of the backingImage, and an error, if there is any. +func (c *backingImages) Update(ctx context.Context, backingImage *v1beta1.BackingImage, opts v1.UpdateOptions) (result *v1beta1.BackingImage, err error) { + result = &v1beta1.BackingImage{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backingimages"). + Name(backingImage.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backingImage). + Do(ctx). + 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 *backingImages) UpdateStatus(ctx context.Context, backingImage *v1beta1.BackingImage, opts v1.UpdateOptions) (result *v1beta1.BackingImage, err error) { + result = &v1beta1.BackingImage{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backingimages"). + Name(backingImage.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backingImage). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the backingImage and deletes it. Returns an error if one occurs. +func (c *backingImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("backingimages"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *backingImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("backingimages"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched backingImage. +func (c *backingImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackingImage, err error) { + result = &v1beta1.BackingImage{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("backingimages"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backingimagedatasource.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backingimagedatasource.go new file mode 100644 index 00000000..6f678448 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backingimagedatasource.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// BackingImageDataSourcesGetter has a method to return a BackingImageDataSourceInterface. +// A group's client should implement this interface. +type BackingImageDataSourcesGetter interface { + BackingImageDataSources(namespace string) BackingImageDataSourceInterface +} + +// BackingImageDataSourceInterface has methods to work with BackingImageDataSource resources. +type BackingImageDataSourceInterface interface { + Create(ctx context.Context, backingImageDataSource *v1beta1.BackingImageDataSource, opts v1.CreateOptions) (*v1beta1.BackingImageDataSource, error) + Update(ctx context.Context, backingImageDataSource *v1beta1.BackingImageDataSource, opts v1.UpdateOptions) (*v1beta1.BackingImageDataSource, error) + UpdateStatus(ctx context.Context, backingImageDataSource *v1beta1.BackingImageDataSource, opts v1.UpdateOptions) (*v1beta1.BackingImageDataSource, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.BackingImageDataSource, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BackingImageDataSourceList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackingImageDataSource, err error) + BackingImageDataSourceExpansion +} + +// backingImageDataSources implements BackingImageDataSourceInterface +type backingImageDataSources struct { + client rest.Interface + ns string +} + +// newBackingImageDataSources returns a BackingImageDataSources +func newBackingImageDataSources(c *LonghornV1beta1Client, namespace string) *backingImageDataSources { + return &backingImageDataSources{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the backingImageDataSource, and returns the corresponding backingImageDataSource object, and an error if there is any. +func (c *backingImageDataSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackingImageDataSource, err error) { + result = &v1beta1.BackingImageDataSource{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backingimagedatasources"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BackingImageDataSources that match those selectors. +func (c *backingImageDataSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackingImageDataSourceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.BackingImageDataSourceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backingimagedatasources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backingImageDataSources. +func (c *backingImageDataSources) Watch(ctx context.Context, 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("backingimagedatasources"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a backingImageDataSource and creates it. Returns the server's representation of the backingImageDataSource, and an error, if there is any. +func (c *backingImageDataSources) Create(ctx context.Context, backingImageDataSource *v1beta1.BackingImageDataSource, opts v1.CreateOptions) (result *v1beta1.BackingImageDataSource, err error) { + result = &v1beta1.BackingImageDataSource{} + err = c.client.Post(). + Namespace(c.ns). + Resource("backingimagedatasources"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backingImageDataSource). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a backingImageDataSource and updates it. Returns the server's representation of the backingImageDataSource, and an error, if there is any. +func (c *backingImageDataSources) Update(ctx context.Context, backingImageDataSource *v1beta1.BackingImageDataSource, opts v1.UpdateOptions) (result *v1beta1.BackingImageDataSource, err error) { + result = &v1beta1.BackingImageDataSource{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backingimagedatasources"). + Name(backingImageDataSource.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backingImageDataSource). + Do(ctx). + 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 *backingImageDataSources) UpdateStatus(ctx context.Context, backingImageDataSource *v1beta1.BackingImageDataSource, opts v1.UpdateOptions) (result *v1beta1.BackingImageDataSource, err error) { + result = &v1beta1.BackingImageDataSource{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backingimagedatasources"). + Name(backingImageDataSource.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backingImageDataSource). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the backingImageDataSource and deletes it. Returns an error if one occurs. +func (c *backingImageDataSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("backingimagedatasources"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *backingImageDataSources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("backingimagedatasources"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched backingImageDataSource. +func (c *backingImageDataSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackingImageDataSource, err error) { + result = &v1beta1.BackingImageDataSource{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("backingimagedatasources"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backingimagemanager.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backingimagemanager.go new file mode 100644 index 00000000..7e617e83 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backingimagemanager.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// BackingImageManagersGetter has a method to return a BackingImageManagerInterface. +// A group's client should implement this interface. +type BackingImageManagersGetter interface { + BackingImageManagers(namespace string) BackingImageManagerInterface +} + +// BackingImageManagerInterface has methods to work with BackingImageManager resources. +type BackingImageManagerInterface interface { + Create(ctx context.Context, backingImageManager *v1beta1.BackingImageManager, opts v1.CreateOptions) (*v1beta1.BackingImageManager, error) + Update(ctx context.Context, backingImageManager *v1beta1.BackingImageManager, opts v1.UpdateOptions) (*v1beta1.BackingImageManager, error) + UpdateStatus(ctx context.Context, backingImageManager *v1beta1.BackingImageManager, opts v1.UpdateOptions) (*v1beta1.BackingImageManager, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.BackingImageManager, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BackingImageManagerList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackingImageManager, err error) + BackingImageManagerExpansion +} + +// backingImageManagers implements BackingImageManagerInterface +type backingImageManagers struct { + client rest.Interface + ns string +} + +// newBackingImageManagers returns a BackingImageManagers +func newBackingImageManagers(c *LonghornV1beta1Client, namespace string) *backingImageManagers { + return &backingImageManagers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the backingImageManager, and returns the corresponding backingImageManager object, and an error if there is any. +func (c *backingImageManagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackingImageManager, err error) { + result = &v1beta1.BackingImageManager{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backingimagemanagers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BackingImageManagers that match those selectors. +func (c *backingImageManagers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackingImageManagerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.BackingImageManagerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backingimagemanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backingImageManagers. +func (c *backingImageManagers) Watch(ctx context.Context, 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("backingimagemanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a backingImageManager and creates it. Returns the server's representation of the backingImageManager, and an error, if there is any. +func (c *backingImageManagers) Create(ctx context.Context, backingImageManager *v1beta1.BackingImageManager, opts v1.CreateOptions) (result *v1beta1.BackingImageManager, err error) { + result = &v1beta1.BackingImageManager{} + err = c.client.Post(). + Namespace(c.ns). + Resource("backingimagemanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backingImageManager). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a backingImageManager and updates it. Returns the server's representation of the backingImageManager, and an error, if there is any. +func (c *backingImageManagers) Update(ctx context.Context, backingImageManager *v1beta1.BackingImageManager, opts v1.UpdateOptions) (result *v1beta1.BackingImageManager, err error) { + result = &v1beta1.BackingImageManager{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backingimagemanagers"). + Name(backingImageManager.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backingImageManager). + Do(ctx). + 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 *backingImageManagers) UpdateStatus(ctx context.Context, backingImageManager *v1beta1.BackingImageManager, opts v1.UpdateOptions) (result *v1beta1.BackingImageManager, err error) { + result = &v1beta1.BackingImageManager{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backingimagemanagers"). + Name(backingImageManager.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backingImageManager). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the backingImageManager and deletes it. Returns an error if one occurs. +func (c *backingImageManagers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("backingimagemanagers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *backingImageManagers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("backingimagemanagers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched backingImageManager. +func (c *backingImageManagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackingImageManager, err error) { + result = &v1beta1.BackingImageManager{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("backingimagemanagers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backup.go new file mode 100644 index 00000000..a6c59dc5 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backup.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// BackupsGetter has a method to return a BackupInterface. +// A group's client should implement this interface. +type BackupsGetter interface { + Backups(namespace string) BackupInterface +} + +// BackupInterface has methods to work with Backup resources. +type BackupInterface interface { + Create(ctx context.Context, backup *v1beta1.Backup, opts v1.CreateOptions) (*v1beta1.Backup, error) + Update(ctx context.Context, backup *v1beta1.Backup, opts v1.UpdateOptions) (*v1beta1.Backup, error) + UpdateStatus(ctx context.Context, backup *v1beta1.Backup, opts v1.UpdateOptions) (*v1beta1.Backup, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Backup, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BackupList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Backup, err error) + BackupExpansion +} + +// backups implements BackupInterface +type backups struct { + client rest.Interface + ns string +} + +// newBackups returns a Backups +func newBackups(c *LonghornV1beta1Client, namespace string) *backups { + return &backups{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any. +func (c *backups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Backup, err error) { + result = &v1beta1.Backup{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Backups that match those selectors. +func (c *backups) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.BackupList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backups. +func (c *backups) Watch(ctx context.Context, 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("backups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *backups) Create(ctx context.Context, backup *v1beta1.Backup, opts v1.CreateOptions) (result *v1beta1.Backup, err error) { + result = &v1beta1.Backup{} + err = c.client.Post(). + Namespace(c.ns). + Resource("backups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *backups) Update(ctx context.Context, backup *v1beta1.Backup, opts v1.UpdateOptions) (result *v1beta1.Backup, err error) { + result = &v1beta1.Backup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backups"). + Name(backup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backup). + Do(ctx). + 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 *backups) UpdateStatus(ctx context.Context, backup *v1beta1.Backup, opts v1.UpdateOptions) (result *v1beta1.Backup, err error) { + result = &v1beta1.Backup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backups"). + Name(backup.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the backup and deletes it. Returns an error if one occurs. +func (c *backups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("backups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *backups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("backups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched backup. +func (c *backups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Backup, err error) { + result = &v1beta1.Backup{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("backups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backuptarget.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backuptarget.go new file mode 100644 index 00000000..a2606175 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backuptarget.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// BackupTargetsGetter has a method to return a BackupTargetInterface. +// A group's client should implement this interface. +type BackupTargetsGetter interface { + BackupTargets(namespace string) BackupTargetInterface +} + +// BackupTargetInterface has methods to work with BackupTarget resources. +type BackupTargetInterface interface { + Create(ctx context.Context, backupTarget *v1beta1.BackupTarget, opts v1.CreateOptions) (*v1beta1.BackupTarget, error) + Update(ctx context.Context, backupTarget *v1beta1.BackupTarget, opts v1.UpdateOptions) (*v1beta1.BackupTarget, error) + UpdateStatus(ctx context.Context, backupTarget *v1beta1.BackupTarget, opts v1.UpdateOptions) (*v1beta1.BackupTarget, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.BackupTarget, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BackupTargetList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupTarget, err error) + BackupTargetExpansion +} + +// backupTargets implements BackupTargetInterface +type backupTargets struct { + client rest.Interface + ns string +} + +// newBackupTargets returns a BackupTargets +func newBackupTargets(c *LonghornV1beta1Client, namespace string) *backupTargets { + return &backupTargets{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the backupTarget, and returns the corresponding backupTarget object, and an error if there is any. +func (c *backupTargets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackupTarget, err error) { + result = &v1beta1.BackupTarget{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backuptargets"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BackupTargets that match those selectors. +func (c *backupTargets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackupTargetList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.BackupTargetList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backuptargets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backupTargets. +func (c *backupTargets) Watch(ctx context.Context, 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("backuptargets"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a backupTarget and creates it. Returns the server's representation of the backupTarget, and an error, if there is any. +func (c *backupTargets) Create(ctx context.Context, backupTarget *v1beta1.BackupTarget, opts v1.CreateOptions) (result *v1beta1.BackupTarget, err error) { + result = &v1beta1.BackupTarget{} + err = c.client.Post(). + Namespace(c.ns). + Resource("backuptargets"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backupTarget). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a backupTarget and updates it. Returns the server's representation of the backupTarget, and an error, if there is any. +func (c *backupTargets) Update(ctx context.Context, backupTarget *v1beta1.BackupTarget, opts v1.UpdateOptions) (result *v1beta1.BackupTarget, err error) { + result = &v1beta1.BackupTarget{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backuptargets"). + Name(backupTarget.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backupTarget). + Do(ctx). + 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 *backupTargets) UpdateStatus(ctx context.Context, backupTarget *v1beta1.BackupTarget, opts v1.UpdateOptions) (result *v1beta1.BackupTarget, err error) { + result = &v1beta1.BackupTarget{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backuptargets"). + Name(backupTarget.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backupTarget). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the backupTarget and deletes it. Returns an error if one occurs. +func (c *backupTargets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("backuptargets"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *backupTargets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("backuptargets"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched backupTarget. +func (c *backupTargets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupTarget, err error) { + result = &v1beta1.BackupTarget{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("backuptargets"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backupvolume.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backupvolume.go new file mode 100644 index 00000000..96c201b4 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/backupvolume.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// BackupVolumesGetter has a method to return a BackupVolumeInterface. +// A group's client should implement this interface. +type BackupVolumesGetter interface { + BackupVolumes(namespace string) BackupVolumeInterface +} + +// BackupVolumeInterface has methods to work with BackupVolume resources. +type BackupVolumeInterface interface { + Create(ctx context.Context, backupVolume *v1beta1.BackupVolume, opts v1.CreateOptions) (*v1beta1.BackupVolume, error) + Update(ctx context.Context, backupVolume *v1beta1.BackupVolume, opts v1.UpdateOptions) (*v1beta1.BackupVolume, error) + UpdateStatus(ctx context.Context, backupVolume *v1beta1.BackupVolume, opts v1.UpdateOptions) (*v1beta1.BackupVolume, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.BackupVolume, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.BackupVolumeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupVolume, err error) + BackupVolumeExpansion +} + +// backupVolumes implements BackupVolumeInterface +type backupVolumes struct { + client rest.Interface + ns string +} + +// newBackupVolumes returns a BackupVolumes +func newBackupVolumes(c *LonghornV1beta1Client, namespace string) *backupVolumes { + return &backupVolumes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the backupVolume, and returns the corresponding backupVolume object, and an error if there is any. +func (c *backupVolumes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackupVolume, err error) { + result = &v1beta1.BackupVolume{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backupvolumes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of BackupVolumes that match those selectors. +func (c *backupVolumes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackupVolumeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.BackupVolumeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("backupvolumes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested backupVolumes. +func (c *backupVolumes) Watch(ctx context.Context, 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("backupvolumes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a backupVolume and creates it. Returns the server's representation of the backupVolume, and an error, if there is any. +func (c *backupVolumes) Create(ctx context.Context, backupVolume *v1beta1.BackupVolume, opts v1.CreateOptions) (result *v1beta1.BackupVolume, err error) { + result = &v1beta1.BackupVolume{} + err = c.client.Post(). + Namespace(c.ns). + Resource("backupvolumes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backupVolume). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a backupVolume and updates it. Returns the server's representation of the backupVolume, and an error, if there is any. +func (c *backupVolumes) Update(ctx context.Context, backupVolume *v1beta1.BackupVolume, opts v1.UpdateOptions) (result *v1beta1.BackupVolume, err error) { + result = &v1beta1.BackupVolume{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backupvolumes"). + Name(backupVolume.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backupVolume). + Do(ctx). + 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 *backupVolumes) UpdateStatus(ctx context.Context, backupVolume *v1beta1.BackupVolume, opts v1.UpdateOptions) (result *v1beta1.BackupVolume, err error) { + result = &v1beta1.BackupVolume{} + err = c.client.Put(). + Namespace(c.ns). + Resource("backupvolumes"). + Name(backupVolume.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(backupVolume). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the backupVolume and deletes it. Returns an error if one occurs. +func (c *backupVolumes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("backupvolumes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *backupVolumes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("backupvolumes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched backupVolume. +func (c *backupVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupVolume, err error) { + result = &v1beta1.BackupVolume{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("backupvolumes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/doc.go new file mode 100644 index 00000000..d9184aec --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/engine.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/engine.go new file mode 100644 index 00000000..8fd94f9a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/engine.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// EnginesGetter has a method to return a EngineInterface. +// A group's client should implement this interface. +type EnginesGetter interface { + Engines(namespace string) EngineInterface +} + +// EngineInterface has methods to work with Engine resources. +type EngineInterface interface { + Create(ctx context.Context, engine *v1beta1.Engine, opts v1.CreateOptions) (*v1beta1.Engine, error) + Update(ctx context.Context, engine *v1beta1.Engine, opts v1.UpdateOptions) (*v1beta1.Engine, error) + UpdateStatus(ctx context.Context, engine *v1beta1.Engine, opts v1.UpdateOptions) (*v1beta1.Engine, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Engine, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EngineList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Engine, err error) + EngineExpansion +} + +// engines implements EngineInterface +type engines struct { + client rest.Interface + ns string +} + +// newEngines returns a Engines +func newEngines(c *LonghornV1beta1Client, namespace string) *engines { + return &engines{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the engine, and returns the corresponding engine object, and an error if there is any. +func (c *engines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Engine, err error) { + result = &v1beta1.Engine{} + err = c.client.Get(). + Namespace(c.ns). + Resource("engines"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Engines that match those selectors. +func (c *engines) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EngineList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.EngineList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("engines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested engines. +func (c *engines) Watch(ctx context.Context, 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("engines"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a engine and creates it. Returns the server's representation of the engine, and an error, if there is any. +func (c *engines) Create(ctx context.Context, engine *v1beta1.Engine, opts v1.CreateOptions) (result *v1beta1.Engine, err error) { + result = &v1beta1.Engine{} + err = c.client.Post(). + Namespace(c.ns). + Resource("engines"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(engine). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a engine and updates it. Returns the server's representation of the engine, and an error, if there is any. +func (c *engines) Update(ctx context.Context, engine *v1beta1.Engine, opts v1.UpdateOptions) (result *v1beta1.Engine, err error) { + result = &v1beta1.Engine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("engines"). + Name(engine.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(engine). + Do(ctx). + 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 *engines) UpdateStatus(ctx context.Context, engine *v1beta1.Engine, opts v1.UpdateOptions) (result *v1beta1.Engine, err error) { + result = &v1beta1.Engine{} + err = c.client.Put(). + Namespace(c.ns). + Resource("engines"). + Name(engine.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(engine). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the engine and deletes it. Returns an error if one occurs. +func (c *engines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("engines"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *engines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("engines"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched engine. +func (c *engines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Engine, err error) { + result = &v1beta1.Engine{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("engines"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/engineimage.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/engineimage.go new file mode 100644 index 00000000..88e3dd11 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/engineimage.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// EngineImagesGetter has a method to return a EngineImageInterface. +// A group's client should implement this interface. +type EngineImagesGetter interface { + EngineImages(namespace string) EngineImageInterface +} + +// EngineImageInterface has methods to work with EngineImage resources. +type EngineImageInterface interface { + Create(ctx context.Context, engineImage *v1beta1.EngineImage, opts v1.CreateOptions) (*v1beta1.EngineImage, error) + Update(ctx context.Context, engineImage *v1beta1.EngineImage, opts v1.UpdateOptions) (*v1beta1.EngineImage, error) + UpdateStatus(ctx context.Context, engineImage *v1beta1.EngineImage, opts v1.UpdateOptions) (*v1beta1.EngineImage, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.EngineImage, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.EngineImageList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EngineImage, err error) + EngineImageExpansion +} + +// engineImages implements EngineImageInterface +type engineImages struct { + client rest.Interface + ns string +} + +// newEngineImages returns a EngineImages +func newEngineImages(c *LonghornV1beta1Client, namespace string) *engineImages { + return &engineImages{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the engineImage, and returns the corresponding engineImage object, and an error if there is any. +func (c *engineImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EngineImage, err error) { + result = &v1beta1.EngineImage{} + err = c.client.Get(). + Namespace(c.ns). + Resource("engineimages"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of EngineImages that match those selectors. +func (c *engineImages) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EngineImageList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.EngineImageList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("engineimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested engineImages. +func (c *engineImages) Watch(ctx context.Context, 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("engineimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a engineImage and creates it. Returns the server's representation of the engineImage, and an error, if there is any. +func (c *engineImages) Create(ctx context.Context, engineImage *v1beta1.EngineImage, opts v1.CreateOptions) (result *v1beta1.EngineImage, err error) { + result = &v1beta1.EngineImage{} + err = c.client.Post(). + Namespace(c.ns). + Resource("engineimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(engineImage). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a engineImage and updates it. Returns the server's representation of the engineImage, and an error, if there is any. +func (c *engineImages) Update(ctx context.Context, engineImage *v1beta1.EngineImage, opts v1.UpdateOptions) (result *v1beta1.EngineImage, err error) { + result = &v1beta1.EngineImage{} + err = c.client.Put(). + Namespace(c.ns). + Resource("engineimages"). + Name(engineImage.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(engineImage). + Do(ctx). + 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 *engineImages) UpdateStatus(ctx context.Context, engineImage *v1beta1.EngineImage, opts v1.UpdateOptions) (result *v1beta1.EngineImage, err error) { + result = &v1beta1.EngineImage{} + err = c.client.Put(). + Namespace(c.ns). + Resource("engineimages"). + Name(engineImage.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(engineImage). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the engineImage and deletes it. Returns an error if one occurs. +func (c *engineImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("engineimages"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *engineImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("engineimages"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched engineImage. +func (c *engineImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EngineImage, err error) { + result = &v1beta1.EngineImage{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("engineimages"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backingimage.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backingimage.go new file mode 100644 index 00000000..29f39243 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backingimage.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBackingImages implements BackingImageInterface +type FakeBackingImages struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var backingimagesResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "backingimages"} + +var backingimagesKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "BackingImage"} + +// Get takes name of the backingImage, and returns the corresponding backingImage object, and an error if there is any. +func (c *FakeBackingImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackingImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backingimagesResource, c.ns, name), &v1beta1.BackingImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImage), err +} + +// List takes label and field selectors, and returns the list of BackingImages that match those selectors. +func (c *FakeBackingImages) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackingImageList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backingimagesResource, backingimagesKind, c.ns, opts), &v1beta1.BackingImageList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.BackingImageList{ListMeta: obj.(*v1beta1.BackingImageList).ListMeta} + for _, item := range obj.(*v1beta1.BackingImageList).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 backingImages. +func (c *FakeBackingImages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backingimagesResource, c.ns, opts)) + +} + +// Create takes the representation of a backingImage and creates it. Returns the server's representation of the backingImage, and an error, if there is any. +func (c *FakeBackingImages) Create(ctx context.Context, backingImage *v1beta1.BackingImage, opts v1.CreateOptions) (result *v1beta1.BackingImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backingimagesResource, c.ns, backingImage), &v1beta1.BackingImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImage), err +} + +// Update takes the representation of a backingImage and updates it. Returns the server's representation of the backingImage, and an error, if there is any. +func (c *FakeBackingImages) Update(ctx context.Context, backingImage *v1beta1.BackingImage, opts v1.UpdateOptions) (result *v1beta1.BackingImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backingimagesResource, c.ns, backingImage), &v1beta1.BackingImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImage), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBackingImages) UpdateStatus(ctx context.Context, backingImage *v1beta1.BackingImage, opts v1.UpdateOptions) (*v1beta1.BackingImage, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(backingimagesResource, "status", c.ns, backingImage), &v1beta1.BackingImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImage), err +} + +// Delete takes name of the backingImage and deletes it. Returns an error if one occurs. +func (c *FakeBackingImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backingimagesResource, c.ns, name, opts), &v1beta1.BackingImage{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackingImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backingimagesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.BackingImageList{}) + return err +} + +// Patch applies the patch and returns the patched backingImage. +func (c *FakeBackingImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackingImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backingimagesResource, c.ns, name, pt, data, subresources...), &v1beta1.BackingImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImage), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backingimagedatasource.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backingimagedatasource.go new file mode 100644 index 00000000..c1c1aa41 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backingimagedatasource.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBackingImageDataSources implements BackingImageDataSourceInterface +type FakeBackingImageDataSources struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var backingimagedatasourcesResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "backingimagedatasources"} + +var backingimagedatasourcesKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "BackingImageDataSource"} + +// Get takes name of the backingImageDataSource, and returns the corresponding backingImageDataSource object, and an error if there is any. +func (c *FakeBackingImageDataSources) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackingImageDataSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backingimagedatasourcesResource, c.ns, name), &v1beta1.BackingImageDataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageDataSource), err +} + +// List takes label and field selectors, and returns the list of BackingImageDataSources that match those selectors. +func (c *FakeBackingImageDataSources) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackingImageDataSourceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backingimagedatasourcesResource, backingimagedatasourcesKind, c.ns, opts), &v1beta1.BackingImageDataSourceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.BackingImageDataSourceList{ListMeta: obj.(*v1beta1.BackingImageDataSourceList).ListMeta} + for _, item := range obj.(*v1beta1.BackingImageDataSourceList).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 backingImageDataSources. +func (c *FakeBackingImageDataSources) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backingimagedatasourcesResource, c.ns, opts)) + +} + +// Create takes the representation of a backingImageDataSource and creates it. Returns the server's representation of the backingImageDataSource, and an error, if there is any. +func (c *FakeBackingImageDataSources) Create(ctx context.Context, backingImageDataSource *v1beta1.BackingImageDataSource, opts v1.CreateOptions) (result *v1beta1.BackingImageDataSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backingimagedatasourcesResource, c.ns, backingImageDataSource), &v1beta1.BackingImageDataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageDataSource), err +} + +// Update takes the representation of a backingImageDataSource and updates it. Returns the server's representation of the backingImageDataSource, and an error, if there is any. +func (c *FakeBackingImageDataSources) Update(ctx context.Context, backingImageDataSource *v1beta1.BackingImageDataSource, opts v1.UpdateOptions) (result *v1beta1.BackingImageDataSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backingimagedatasourcesResource, c.ns, backingImageDataSource), &v1beta1.BackingImageDataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageDataSource), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBackingImageDataSources) UpdateStatus(ctx context.Context, backingImageDataSource *v1beta1.BackingImageDataSource, opts v1.UpdateOptions) (*v1beta1.BackingImageDataSource, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(backingimagedatasourcesResource, "status", c.ns, backingImageDataSource), &v1beta1.BackingImageDataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageDataSource), err +} + +// Delete takes name of the backingImageDataSource and deletes it. Returns an error if one occurs. +func (c *FakeBackingImageDataSources) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backingimagedatasourcesResource, c.ns, name, opts), &v1beta1.BackingImageDataSource{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackingImageDataSources) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backingimagedatasourcesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.BackingImageDataSourceList{}) + return err +} + +// Patch applies the patch and returns the patched backingImageDataSource. +func (c *FakeBackingImageDataSources) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackingImageDataSource, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backingimagedatasourcesResource, c.ns, name, pt, data, subresources...), &v1beta1.BackingImageDataSource{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageDataSource), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backingimagemanager.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backingimagemanager.go new file mode 100644 index 00000000..45cf72df --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backingimagemanager.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBackingImageManagers implements BackingImageManagerInterface +type FakeBackingImageManagers struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var backingimagemanagersResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "backingimagemanagers"} + +var backingimagemanagersKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "BackingImageManager"} + +// Get takes name of the backingImageManager, and returns the corresponding backingImageManager object, and an error if there is any. +func (c *FakeBackingImageManagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackingImageManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backingimagemanagersResource, c.ns, name), &v1beta1.BackingImageManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageManager), err +} + +// List takes label and field selectors, and returns the list of BackingImageManagers that match those selectors. +func (c *FakeBackingImageManagers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackingImageManagerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backingimagemanagersResource, backingimagemanagersKind, c.ns, opts), &v1beta1.BackingImageManagerList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.BackingImageManagerList{ListMeta: obj.(*v1beta1.BackingImageManagerList).ListMeta} + for _, item := range obj.(*v1beta1.BackingImageManagerList).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 backingImageManagers. +func (c *FakeBackingImageManagers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backingimagemanagersResource, c.ns, opts)) + +} + +// Create takes the representation of a backingImageManager and creates it. Returns the server's representation of the backingImageManager, and an error, if there is any. +func (c *FakeBackingImageManagers) Create(ctx context.Context, backingImageManager *v1beta1.BackingImageManager, opts v1.CreateOptions) (result *v1beta1.BackingImageManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backingimagemanagersResource, c.ns, backingImageManager), &v1beta1.BackingImageManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageManager), err +} + +// Update takes the representation of a backingImageManager and updates it. Returns the server's representation of the backingImageManager, and an error, if there is any. +func (c *FakeBackingImageManagers) Update(ctx context.Context, backingImageManager *v1beta1.BackingImageManager, opts v1.UpdateOptions) (result *v1beta1.BackingImageManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backingimagemanagersResource, c.ns, backingImageManager), &v1beta1.BackingImageManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageManager), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBackingImageManagers) UpdateStatus(ctx context.Context, backingImageManager *v1beta1.BackingImageManager, opts v1.UpdateOptions) (*v1beta1.BackingImageManager, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(backingimagemanagersResource, "status", c.ns, backingImageManager), &v1beta1.BackingImageManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageManager), err +} + +// Delete takes name of the backingImageManager and deletes it. Returns an error if one occurs. +func (c *FakeBackingImageManagers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backingimagemanagersResource, c.ns, name, opts), &v1beta1.BackingImageManager{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackingImageManagers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backingimagemanagersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.BackingImageManagerList{}) + return err +} + +// Patch applies the patch and returns the patched backingImageManager. +func (c *FakeBackingImageManagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackingImageManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backingimagemanagersResource, c.ns, name, pt, data, subresources...), &v1beta1.BackingImageManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackingImageManager), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backup.go new file mode 100644 index 00000000..4e1c201c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backup.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBackups implements BackupInterface +type FakeBackups struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var backupsResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "backups"} + +var backupsKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "Backup"} + +// Get takes name of the backup, and returns the corresponding backup object, and an error if there is any. +func (c *FakeBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backupsResource, c.ns, name), &v1beta1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Backup), err +} + +// List takes label and field selectors, and returns the list of Backups that match those selectors. +func (c *FakeBackups) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backupsResource, backupsKind, c.ns, opts), &v1beta1.BackupList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.BackupList{ListMeta: obj.(*v1beta1.BackupList).ListMeta} + for _, item := range obj.(*v1beta1.BackupList).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 backups. +func (c *FakeBackups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backupsResource, c.ns, opts)) + +} + +// Create takes the representation of a backup and creates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *FakeBackups) Create(ctx context.Context, backup *v1beta1.Backup, opts v1.CreateOptions) (result *v1beta1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backupsResource, c.ns, backup), &v1beta1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Backup), err +} + +// Update takes the representation of a backup and updates it. Returns the server's representation of the backup, and an error, if there is any. +func (c *FakeBackups) Update(ctx context.Context, backup *v1beta1.Backup, opts v1.UpdateOptions) (result *v1beta1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backupsResource, c.ns, backup), &v1beta1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Backup), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBackups) UpdateStatus(ctx context.Context, backup *v1beta1.Backup, opts v1.UpdateOptions) (*v1beta1.Backup, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(backupsResource, "status", c.ns, backup), &v1beta1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Backup), err +} + +// Delete takes name of the backup and deletes it. Returns an error if one occurs. +func (c *FakeBackups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backupsResource, c.ns, name, opts), &v1beta1.Backup{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backupsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.BackupList{}) + return err +} + +// Patch applies the patch and returns the patched backup. +func (c *FakeBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Backup, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backupsResource, c.ns, name, pt, data, subresources...), &v1beta1.Backup{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Backup), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backuptarget.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backuptarget.go new file mode 100644 index 00000000..d5f813ef --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backuptarget.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBackupTargets implements BackupTargetInterface +type FakeBackupTargets struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var backuptargetsResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "backuptargets"} + +var backuptargetsKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "BackupTarget"} + +// Get takes name of the backupTarget, and returns the corresponding backupTarget object, and an error if there is any. +func (c *FakeBackupTargets) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackupTarget, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backuptargetsResource, c.ns, name), &v1beta1.BackupTarget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupTarget), err +} + +// List takes label and field selectors, and returns the list of BackupTargets that match those selectors. +func (c *FakeBackupTargets) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackupTargetList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backuptargetsResource, backuptargetsKind, c.ns, opts), &v1beta1.BackupTargetList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.BackupTargetList{ListMeta: obj.(*v1beta1.BackupTargetList).ListMeta} + for _, item := range obj.(*v1beta1.BackupTargetList).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 backupTargets. +func (c *FakeBackupTargets) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backuptargetsResource, c.ns, opts)) + +} + +// Create takes the representation of a backupTarget and creates it. Returns the server's representation of the backupTarget, and an error, if there is any. +func (c *FakeBackupTargets) Create(ctx context.Context, backupTarget *v1beta1.BackupTarget, opts v1.CreateOptions) (result *v1beta1.BackupTarget, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backuptargetsResource, c.ns, backupTarget), &v1beta1.BackupTarget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupTarget), err +} + +// Update takes the representation of a backupTarget and updates it. Returns the server's representation of the backupTarget, and an error, if there is any. +func (c *FakeBackupTargets) Update(ctx context.Context, backupTarget *v1beta1.BackupTarget, opts v1.UpdateOptions) (result *v1beta1.BackupTarget, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backuptargetsResource, c.ns, backupTarget), &v1beta1.BackupTarget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupTarget), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBackupTargets) UpdateStatus(ctx context.Context, backupTarget *v1beta1.BackupTarget, opts v1.UpdateOptions) (*v1beta1.BackupTarget, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(backuptargetsResource, "status", c.ns, backupTarget), &v1beta1.BackupTarget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupTarget), err +} + +// Delete takes name of the backupTarget and deletes it. Returns an error if one occurs. +func (c *FakeBackupTargets) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backuptargetsResource, c.ns, name, opts), &v1beta1.BackupTarget{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackupTargets) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backuptargetsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.BackupTargetList{}) + return err +} + +// Patch applies the patch and returns the patched backupTarget. +func (c *FakeBackupTargets) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupTarget, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backuptargetsResource, c.ns, name, pt, data, subresources...), &v1beta1.BackupTarget{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupTarget), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backupvolume.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backupvolume.go new file mode 100644 index 00000000..3da85cd5 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_backupvolume.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeBackupVolumes implements BackupVolumeInterface +type FakeBackupVolumes struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var backupvolumesResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "backupvolumes"} + +var backupvolumesKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "BackupVolume"} + +// Get takes name of the backupVolume, and returns the corresponding backupVolume object, and an error if there is any. +func (c *FakeBackupVolumes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.BackupVolume, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(backupvolumesResource, c.ns, name), &v1beta1.BackupVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupVolume), err +} + +// List takes label and field selectors, and returns the list of BackupVolumes that match those selectors. +func (c *FakeBackupVolumes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.BackupVolumeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(backupvolumesResource, backupvolumesKind, c.ns, opts), &v1beta1.BackupVolumeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.BackupVolumeList{ListMeta: obj.(*v1beta1.BackupVolumeList).ListMeta} + for _, item := range obj.(*v1beta1.BackupVolumeList).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 backupVolumes. +func (c *FakeBackupVolumes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(backupvolumesResource, c.ns, opts)) + +} + +// Create takes the representation of a backupVolume and creates it. Returns the server's representation of the backupVolume, and an error, if there is any. +func (c *FakeBackupVolumes) Create(ctx context.Context, backupVolume *v1beta1.BackupVolume, opts v1.CreateOptions) (result *v1beta1.BackupVolume, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(backupvolumesResource, c.ns, backupVolume), &v1beta1.BackupVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupVolume), err +} + +// Update takes the representation of a backupVolume and updates it. Returns the server's representation of the backupVolume, and an error, if there is any. +func (c *FakeBackupVolumes) Update(ctx context.Context, backupVolume *v1beta1.BackupVolume, opts v1.UpdateOptions) (result *v1beta1.BackupVolume, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(backupvolumesResource, c.ns, backupVolume), &v1beta1.BackupVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupVolume), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeBackupVolumes) UpdateStatus(ctx context.Context, backupVolume *v1beta1.BackupVolume, opts v1.UpdateOptions) (*v1beta1.BackupVolume, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(backupvolumesResource, "status", c.ns, backupVolume), &v1beta1.BackupVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupVolume), err +} + +// Delete takes name of the backupVolume and deletes it. Returns an error if one occurs. +func (c *FakeBackupVolumes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(backupvolumesResource, c.ns, name, opts), &v1beta1.BackupVolume{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeBackupVolumes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(backupvolumesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.BackupVolumeList{}) + return err +} + +// Patch applies the patch and returns the patched backupVolume. +func (c *FakeBackupVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.BackupVolume, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(backupvolumesResource, c.ns, name, pt, data, subresources...), &v1beta1.BackupVolume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.BackupVolume), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_engine.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_engine.go new file mode 100644 index 00000000..92cb27ae --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_engine.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeEngines implements EngineInterface +type FakeEngines struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var enginesResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "engines"} + +var enginesKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "Engine"} + +// Get takes name of the engine, and returns the corresponding engine object, and an error if there is any. +func (c *FakeEngines) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Engine, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(enginesResource, c.ns, name), &v1beta1.Engine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Engine), err +} + +// List takes label and field selectors, and returns the list of Engines that match those selectors. +func (c *FakeEngines) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EngineList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(enginesResource, enginesKind, c.ns, opts), &v1beta1.EngineList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.EngineList{ListMeta: obj.(*v1beta1.EngineList).ListMeta} + for _, item := range obj.(*v1beta1.EngineList).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 engines. +func (c *FakeEngines) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(enginesResource, c.ns, opts)) + +} + +// Create takes the representation of a engine and creates it. Returns the server's representation of the engine, and an error, if there is any. +func (c *FakeEngines) Create(ctx context.Context, engine *v1beta1.Engine, opts v1.CreateOptions) (result *v1beta1.Engine, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(enginesResource, c.ns, engine), &v1beta1.Engine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Engine), err +} + +// Update takes the representation of a engine and updates it. Returns the server's representation of the engine, and an error, if there is any. +func (c *FakeEngines) Update(ctx context.Context, engine *v1beta1.Engine, opts v1.UpdateOptions) (result *v1beta1.Engine, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(enginesResource, c.ns, engine), &v1beta1.Engine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Engine), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeEngines) UpdateStatus(ctx context.Context, engine *v1beta1.Engine, opts v1.UpdateOptions) (*v1beta1.Engine, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(enginesResource, "status", c.ns, engine), &v1beta1.Engine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Engine), err +} + +// Delete takes name of the engine and deletes it. Returns an error if one occurs. +func (c *FakeEngines) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(enginesResource, c.ns, name, opts), &v1beta1.Engine{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeEngines) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(enginesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.EngineList{}) + return err +} + +// Patch applies the patch and returns the patched engine. +func (c *FakeEngines) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Engine, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(enginesResource, c.ns, name, pt, data, subresources...), &v1beta1.Engine{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Engine), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_engineimage.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_engineimage.go new file mode 100644 index 00000000..1a97ccaa --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_engineimage.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeEngineImages implements EngineImageInterface +type FakeEngineImages struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var engineimagesResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "engineimages"} + +var engineimagesKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "EngineImage"} + +// Get takes name of the engineImage, and returns the corresponding engineImage object, and an error if there is any. +func (c *FakeEngineImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.EngineImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(engineimagesResource, c.ns, name), &v1beta1.EngineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.EngineImage), err +} + +// List takes label and field selectors, and returns the list of EngineImages that match those selectors. +func (c *FakeEngineImages) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.EngineImageList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(engineimagesResource, engineimagesKind, c.ns, opts), &v1beta1.EngineImageList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.EngineImageList{ListMeta: obj.(*v1beta1.EngineImageList).ListMeta} + for _, item := range obj.(*v1beta1.EngineImageList).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 engineImages. +func (c *FakeEngineImages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(engineimagesResource, c.ns, opts)) + +} + +// Create takes the representation of a engineImage and creates it. Returns the server's representation of the engineImage, and an error, if there is any. +func (c *FakeEngineImages) Create(ctx context.Context, engineImage *v1beta1.EngineImage, opts v1.CreateOptions) (result *v1beta1.EngineImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(engineimagesResource, c.ns, engineImage), &v1beta1.EngineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.EngineImage), err +} + +// Update takes the representation of a engineImage and updates it. Returns the server's representation of the engineImage, and an error, if there is any. +func (c *FakeEngineImages) Update(ctx context.Context, engineImage *v1beta1.EngineImage, opts v1.UpdateOptions) (result *v1beta1.EngineImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(engineimagesResource, c.ns, engineImage), &v1beta1.EngineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.EngineImage), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeEngineImages) UpdateStatus(ctx context.Context, engineImage *v1beta1.EngineImage, opts v1.UpdateOptions) (*v1beta1.EngineImage, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(engineimagesResource, "status", c.ns, engineImage), &v1beta1.EngineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.EngineImage), err +} + +// Delete takes name of the engineImage and deletes it. Returns an error if one occurs. +func (c *FakeEngineImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(engineimagesResource, c.ns, name, opts), &v1beta1.EngineImage{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeEngineImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(engineimagesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.EngineImageList{}) + return err +} + +// Patch applies the patch and returns the patched engineImage. +func (c *FakeEngineImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.EngineImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(engineimagesResource, c.ns, name, pt, data, subresources...), &v1beta1.EngineImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.EngineImage), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_instancemanager.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_instancemanager.go new file mode 100644 index 00000000..27192a14 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_instancemanager.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeInstanceManagers implements InstanceManagerInterface +type FakeInstanceManagers struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var instancemanagersResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "instancemanagers"} + +var instancemanagersKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "InstanceManager"} + +// Get takes name of the instanceManager, and returns the corresponding instanceManager object, and an error if there is any. +func (c *FakeInstanceManagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.InstanceManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(instancemanagersResource, c.ns, name), &v1beta1.InstanceManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.InstanceManager), err +} + +// List takes label and field selectors, and returns the list of InstanceManagers that match those selectors. +func (c *FakeInstanceManagers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.InstanceManagerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(instancemanagersResource, instancemanagersKind, c.ns, opts), &v1beta1.InstanceManagerList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.InstanceManagerList{ListMeta: obj.(*v1beta1.InstanceManagerList).ListMeta} + for _, item := range obj.(*v1beta1.InstanceManagerList).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 instanceManagers. +func (c *FakeInstanceManagers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(instancemanagersResource, c.ns, opts)) + +} + +// Create takes the representation of a instanceManager and creates it. Returns the server's representation of the instanceManager, and an error, if there is any. +func (c *FakeInstanceManagers) Create(ctx context.Context, instanceManager *v1beta1.InstanceManager, opts v1.CreateOptions) (result *v1beta1.InstanceManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(instancemanagersResource, c.ns, instanceManager), &v1beta1.InstanceManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.InstanceManager), err +} + +// Update takes the representation of a instanceManager and updates it. Returns the server's representation of the instanceManager, and an error, if there is any. +func (c *FakeInstanceManagers) Update(ctx context.Context, instanceManager *v1beta1.InstanceManager, opts v1.UpdateOptions) (result *v1beta1.InstanceManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(instancemanagersResource, c.ns, instanceManager), &v1beta1.InstanceManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.InstanceManager), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeInstanceManagers) UpdateStatus(ctx context.Context, instanceManager *v1beta1.InstanceManager, opts v1.UpdateOptions) (*v1beta1.InstanceManager, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(instancemanagersResource, "status", c.ns, instanceManager), &v1beta1.InstanceManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.InstanceManager), err +} + +// Delete takes name of the instanceManager and deletes it. Returns an error if one occurs. +func (c *FakeInstanceManagers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(instancemanagersResource, c.ns, name, opts), &v1beta1.InstanceManager{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeInstanceManagers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(instancemanagersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.InstanceManagerList{}) + return err +} + +// Patch applies the patch and returns the patched instanceManager. +func (c *FakeInstanceManagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.InstanceManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(instancemanagersResource, c.ns, name, pt, data, subresources...), &v1beta1.InstanceManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.InstanceManager), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_longhorn.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_longhorn.io_client.go new file mode 100644 index 00000000..fa995f79 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_longhorn.io_client.go @@ -0,0 +1,96 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeLonghornV1beta1 struct { + *testing.Fake +} + +func (c *FakeLonghornV1beta1) BackingImages(namespace string) v1beta1.BackingImageInterface { + return &FakeBackingImages{c, namespace} +} + +func (c *FakeLonghornV1beta1) BackingImageDataSources(namespace string) v1beta1.BackingImageDataSourceInterface { + return &FakeBackingImageDataSources{c, namespace} +} + +func (c *FakeLonghornV1beta1) BackingImageManagers(namespace string) v1beta1.BackingImageManagerInterface { + return &FakeBackingImageManagers{c, namespace} +} + +func (c *FakeLonghornV1beta1) Backups(namespace string) v1beta1.BackupInterface { + return &FakeBackups{c, namespace} +} + +func (c *FakeLonghornV1beta1) BackupTargets(namespace string) v1beta1.BackupTargetInterface { + return &FakeBackupTargets{c, namespace} +} + +func (c *FakeLonghornV1beta1) BackupVolumes(namespace string) v1beta1.BackupVolumeInterface { + return &FakeBackupVolumes{c, namespace} +} + +func (c *FakeLonghornV1beta1) Engines(namespace string) v1beta1.EngineInterface { + return &FakeEngines{c, namespace} +} + +func (c *FakeLonghornV1beta1) EngineImages(namespace string) v1beta1.EngineImageInterface { + return &FakeEngineImages{c, namespace} +} + +func (c *FakeLonghornV1beta1) InstanceManagers(namespace string) v1beta1.InstanceManagerInterface { + return &FakeInstanceManagers{c, namespace} +} + +func (c *FakeLonghornV1beta1) Nodes(namespace string) v1beta1.NodeInterface { + return &FakeNodes{c, namespace} +} + +func (c *FakeLonghornV1beta1) RecurringJobs(namespace string) v1beta1.RecurringJobInterface { + return &FakeRecurringJobs{c, namespace} +} + +func (c *FakeLonghornV1beta1) Replicas(namespace string) v1beta1.ReplicaInterface { + return &FakeReplicas{c, namespace} +} + +func (c *FakeLonghornV1beta1) Settings(namespace string) v1beta1.SettingInterface { + return &FakeSettings{c, namespace} +} + +func (c *FakeLonghornV1beta1) ShareManagers(namespace string) v1beta1.ShareManagerInterface { + return &FakeShareManagers{c, namespace} +} + +func (c *FakeLonghornV1beta1) Volumes(namespace string) v1beta1.VolumeInterface { + return &FakeVolumes{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeLonghornV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_node.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_node.go new file mode 100644 index 00000000..382a9a4a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_node.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNodes implements NodeInterface +type FakeNodes struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var nodesResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "nodes"} + +var nodesKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "Node"} + +// Get takes name of the node, and returns the corresponding node object, and an error if there is any. +func (c *FakeNodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(nodesResource, c.ns, name), &v1beta1.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Node), err +} + +// List takes label and field selectors, and returns the list of Nodes that match those selectors. +func (c *FakeNodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NodeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(nodesResource, nodesKind, c.ns, opts), &v1beta1.NodeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.NodeList{ListMeta: obj.(*v1beta1.NodeList).ListMeta} + for _, item := range obj.(*v1beta1.NodeList).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 nodes. +func (c *FakeNodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(nodesResource, c.ns, opts)) + +} + +// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. +func (c *FakeNodes) Create(ctx context.Context, node *v1beta1.Node, opts v1.CreateOptions) (result *v1beta1.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(nodesResource, c.ns, node), &v1beta1.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Node), err +} + +// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. +func (c *FakeNodes) Update(ctx context.Context, node *v1beta1.Node, opts v1.UpdateOptions) (result *v1beta1.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(nodesResource, c.ns, node), &v1beta1.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Node), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNodes) UpdateStatus(ctx context.Context, node *v1beta1.Node, opts v1.UpdateOptions) (*v1beta1.Node, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(nodesResource, "status", c.ns, node), &v1beta1.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Node), err +} + +// Delete takes name of the node and deletes it. Returns an error if one occurs. +func (c *FakeNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(nodesResource, c.ns, name, opts), &v1beta1.Node{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(nodesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.NodeList{}) + return err +} + +// Patch applies the patch and returns the patched node. +func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(nodesResource, c.ns, name, pt, data, subresources...), &v1beta1.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Node), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_recurringjob.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_recurringjob.go new file mode 100644 index 00000000..7fc8fb22 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_recurringjob.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRecurringJobs implements RecurringJobInterface +type FakeRecurringJobs struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var recurringjobsResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "recurringjobs"} + +var recurringjobsKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "RecurringJob"} + +// Get takes name of the recurringJob, and returns the corresponding recurringJob object, and an error if there is any. +func (c *FakeRecurringJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RecurringJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(recurringjobsResource, c.ns, name), &v1beta1.RecurringJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.RecurringJob), err +} + +// List takes label and field selectors, and returns the list of RecurringJobs that match those selectors. +func (c *FakeRecurringJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RecurringJobList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(recurringjobsResource, recurringjobsKind, c.ns, opts), &v1beta1.RecurringJobList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.RecurringJobList{ListMeta: obj.(*v1beta1.RecurringJobList).ListMeta} + for _, item := range obj.(*v1beta1.RecurringJobList).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 recurringJobs. +func (c *FakeRecurringJobs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(recurringjobsResource, c.ns, opts)) + +} + +// Create takes the representation of a recurringJob and creates it. Returns the server's representation of the recurringJob, and an error, if there is any. +func (c *FakeRecurringJobs) Create(ctx context.Context, recurringJob *v1beta1.RecurringJob, opts v1.CreateOptions) (result *v1beta1.RecurringJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(recurringjobsResource, c.ns, recurringJob), &v1beta1.RecurringJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.RecurringJob), err +} + +// Update takes the representation of a recurringJob and updates it. Returns the server's representation of the recurringJob, and an error, if there is any. +func (c *FakeRecurringJobs) Update(ctx context.Context, recurringJob *v1beta1.RecurringJob, opts v1.UpdateOptions) (result *v1beta1.RecurringJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(recurringjobsResource, c.ns, recurringJob), &v1beta1.RecurringJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.RecurringJob), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeRecurringJobs) UpdateStatus(ctx context.Context, recurringJob *v1beta1.RecurringJob, opts v1.UpdateOptions) (*v1beta1.RecurringJob, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(recurringjobsResource, "status", c.ns, recurringJob), &v1beta1.RecurringJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.RecurringJob), err +} + +// Delete takes name of the recurringJob and deletes it. Returns an error if one occurs. +func (c *FakeRecurringJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(recurringjobsResource, c.ns, name, opts), &v1beta1.RecurringJob{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRecurringJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(recurringjobsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.RecurringJobList{}) + return err +} + +// Patch applies the patch and returns the patched recurringJob. +func (c *FakeRecurringJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RecurringJob, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(recurringjobsResource, c.ns, name, pt, data, subresources...), &v1beta1.RecurringJob{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.RecurringJob), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_replica.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_replica.go new file mode 100644 index 00000000..3c473f33 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_replica.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeReplicas implements ReplicaInterface +type FakeReplicas struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var replicasResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "replicas"} + +var replicasKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "Replica"} + +// Get takes name of the replica, and returns the corresponding replica object, and an error if there is any. +func (c *FakeReplicas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Replica, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(replicasResource, c.ns, name), &v1beta1.Replica{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Replica), err +} + +// List takes label and field selectors, and returns the list of Replicas that match those selectors. +func (c *FakeReplicas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(replicasResource, replicasKind, c.ns, opts), &v1beta1.ReplicaList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ReplicaList{ListMeta: obj.(*v1beta1.ReplicaList).ListMeta} + for _, item := range obj.(*v1beta1.ReplicaList).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 replicas. +func (c *FakeReplicas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(replicasResource, c.ns, opts)) + +} + +// Create takes the representation of a replica and creates it. Returns the server's representation of the replica, and an error, if there is any. +func (c *FakeReplicas) Create(ctx context.Context, replica *v1beta1.Replica, opts v1.CreateOptions) (result *v1beta1.Replica, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(replicasResource, c.ns, replica), &v1beta1.Replica{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Replica), err +} + +// Update takes the representation of a replica and updates it. Returns the server's representation of the replica, and an error, if there is any. +func (c *FakeReplicas) Update(ctx context.Context, replica *v1beta1.Replica, opts v1.UpdateOptions) (result *v1beta1.Replica, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(replicasResource, c.ns, replica), &v1beta1.Replica{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Replica), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeReplicas) UpdateStatus(ctx context.Context, replica *v1beta1.Replica, opts v1.UpdateOptions) (*v1beta1.Replica, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(replicasResource, "status", c.ns, replica), &v1beta1.Replica{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Replica), err +} + +// Delete takes name of the replica and deletes it. Returns an error if one occurs. +func (c *FakeReplicas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(replicasResource, c.ns, name, opts), &v1beta1.Replica{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeReplicas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(replicasResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ReplicaList{}) + return err +} + +// Patch applies the patch and returns the patched replica. +func (c *FakeReplicas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Replica, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(replicasResource, c.ns, name, pt, data, subresources...), &v1beta1.Replica{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Replica), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_setting.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_setting.go new file mode 100644 index 00000000..60b5b0de --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_setting.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSettings implements SettingInterface +type FakeSettings struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var settingsResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "settings"} + +var settingsKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "Setting"} + +// Get takes name of the setting, and returns the corresponding setting object, and an error if there is any. +func (c *FakeSettings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(settingsResource, c.ns, name), &v1beta1.Setting{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Setting), err +} + +// List takes label and field selectors, and returns the list of Settings that match those selectors. +func (c *FakeSettings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SettingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(settingsResource, settingsKind, c.ns, opts), &v1beta1.SettingList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.SettingList{ListMeta: obj.(*v1beta1.SettingList).ListMeta} + for _, item := range obj.(*v1beta1.SettingList).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 settings. +func (c *FakeSettings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(settingsResource, c.ns, opts)) + +} + +// Create takes the representation of a setting and creates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *FakeSettings) Create(ctx context.Context, setting *v1beta1.Setting, opts v1.CreateOptions) (result *v1beta1.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(settingsResource, c.ns, setting), &v1beta1.Setting{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Setting), err +} + +// Update takes the representation of a setting and updates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *FakeSettings) Update(ctx context.Context, setting *v1beta1.Setting, opts v1.UpdateOptions) (result *v1beta1.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(settingsResource, c.ns, setting), &v1beta1.Setting{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Setting), err +} + +// Delete takes name of the setting and deletes it. Returns an error if one occurs. +func (c *FakeSettings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(settingsResource, c.ns, name, opts), &v1beta1.Setting{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSettings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(settingsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.SettingList{}) + return err +} + +// Patch applies the patch and returns the patched setting. +func (c *FakeSettings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(settingsResource, c.ns, name, pt, data, subresources...), &v1beta1.Setting{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Setting), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_sharemanager.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_sharemanager.go new file mode 100644 index 00000000..2f224c78 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_sharemanager.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeShareManagers implements ShareManagerInterface +type FakeShareManagers struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var sharemanagersResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "sharemanagers"} + +var sharemanagersKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "ShareManager"} + +// Get takes name of the shareManager, and returns the corresponding shareManager object, and an error if there is any. +func (c *FakeShareManagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ShareManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(sharemanagersResource, c.ns, name), &v1beta1.ShareManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ShareManager), err +} + +// List takes label and field selectors, and returns the list of ShareManagers that match those selectors. +func (c *FakeShareManagers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ShareManagerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(sharemanagersResource, sharemanagersKind, c.ns, opts), &v1beta1.ShareManagerList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.ShareManagerList{ListMeta: obj.(*v1beta1.ShareManagerList).ListMeta} + for _, item := range obj.(*v1beta1.ShareManagerList).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 shareManagers. +func (c *FakeShareManagers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(sharemanagersResource, c.ns, opts)) + +} + +// Create takes the representation of a shareManager and creates it. Returns the server's representation of the shareManager, and an error, if there is any. +func (c *FakeShareManagers) Create(ctx context.Context, shareManager *v1beta1.ShareManager, opts v1.CreateOptions) (result *v1beta1.ShareManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(sharemanagersResource, c.ns, shareManager), &v1beta1.ShareManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ShareManager), err +} + +// Update takes the representation of a shareManager and updates it. Returns the server's representation of the shareManager, and an error, if there is any. +func (c *FakeShareManagers) Update(ctx context.Context, shareManager *v1beta1.ShareManager, opts v1.UpdateOptions) (result *v1beta1.ShareManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(sharemanagersResource, c.ns, shareManager), &v1beta1.ShareManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ShareManager), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeShareManagers) UpdateStatus(ctx context.Context, shareManager *v1beta1.ShareManager, opts v1.UpdateOptions) (*v1beta1.ShareManager, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(sharemanagersResource, "status", c.ns, shareManager), &v1beta1.ShareManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ShareManager), err +} + +// Delete takes name of the shareManager and deletes it. Returns an error if one occurs. +func (c *FakeShareManagers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(sharemanagersResource, c.ns, name, opts), &v1beta1.ShareManager{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeShareManagers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(sharemanagersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.ShareManagerList{}) + return err +} + +// Patch applies the patch and returns the patched shareManager. +func (c *FakeShareManagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ShareManager, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(sharemanagersResource, c.ns, name, pt, data, subresources...), &v1beta1.ShareManager{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.ShareManager), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_volume.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_volume.go new file mode 100644 index 00000000..253d1f46 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/fake/fake_volume.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumes implements VolumeInterface +type FakeVolumes struct { + Fake *FakeLonghornV1beta1 + ns string +} + +var volumesResource = schema.GroupVersionResource{Group: "longhorn.io", Version: "v1beta1", Resource: "volumes"} + +var volumesKind = schema.GroupVersionKind{Group: "longhorn.io", Version: "v1beta1", Kind: "Volume"} + +// Get takes name of the volume, and returns the corresponding volume object, and an error if there is any. +func (c *FakeVolumes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Volume, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(volumesResource, c.ns, name), &v1beta1.Volume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Volume), err +} + +// List takes label and field selectors, and returns the list of Volumes that match those selectors. +func (c *FakeVolumes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(volumesResource, volumesKind, c.ns, opts), &v1beta1.VolumeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeList{ListMeta: obj.(*v1beta1.VolumeList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeList).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 volumes. +func (c *FakeVolumes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(volumesResource, c.ns, opts)) + +} + +// Create takes the representation of a volume and creates it. Returns the server's representation of the volume, and an error, if there is any. +func (c *FakeVolumes) Create(ctx context.Context, volume *v1beta1.Volume, opts v1.CreateOptions) (result *v1beta1.Volume, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(volumesResource, c.ns, volume), &v1beta1.Volume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Volume), err +} + +// Update takes the representation of a volume and updates it. Returns the server's representation of the volume, and an error, if there is any. +func (c *FakeVolumes) Update(ctx context.Context, volume *v1beta1.Volume, opts v1.UpdateOptions) (result *v1beta1.Volume, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(volumesResource, c.ns, volume), &v1beta1.Volume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Volume), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVolumes) UpdateStatus(ctx context.Context, volume *v1beta1.Volume, opts v1.UpdateOptions) (*v1beta1.Volume, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(volumesResource, "status", c.ns, volume), &v1beta1.Volume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Volume), err +} + +// Delete takes name of the volume and deletes it. Returns an error if one occurs. +func (c *FakeVolumes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(volumesResource, c.ns, name, opts), &v1beta1.Volume{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(volumesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeList{}) + return err +} + +// Patch applies the patch and returns the patched volume. +func (c *FakeVolumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Volume, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(volumesResource, c.ns, name, pt, data, subresources...), &v1beta1.Volume{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.Volume), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/generated_expansion.go new file mode 100644 index 00000000..4b8a68f5 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/generated_expansion.go @@ -0,0 +1,49 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +type BackingImageExpansion interface{} + +type BackingImageDataSourceExpansion interface{} + +type BackingImageManagerExpansion interface{} + +type BackupExpansion interface{} + +type BackupTargetExpansion interface{} + +type BackupVolumeExpansion interface{} + +type EngineExpansion interface{} + +type EngineImageExpansion interface{} + +type InstanceManagerExpansion interface{} + +type NodeExpansion interface{} + +type RecurringJobExpansion interface{} + +type ReplicaExpansion interface{} + +type SettingExpansion interface{} + +type ShareManagerExpansion interface{} + +type VolumeExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/instancemanager.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/instancemanager.go new file mode 100644 index 00000000..89f51a3a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/instancemanager.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// InstanceManagersGetter has a method to return a InstanceManagerInterface. +// A group's client should implement this interface. +type InstanceManagersGetter interface { + InstanceManagers(namespace string) InstanceManagerInterface +} + +// InstanceManagerInterface has methods to work with InstanceManager resources. +type InstanceManagerInterface interface { + Create(ctx context.Context, instanceManager *v1beta1.InstanceManager, opts v1.CreateOptions) (*v1beta1.InstanceManager, error) + Update(ctx context.Context, instanceManager *v1beta1.InstanceManager, opts v1.UpdateOptions) (*v1beta1.InstanceManager, error) + UpdateStatus(ctx context.Context, instanceManager *v1beta1.InstanceManager, opts v1.UpdateOptions) (*v1beta1.InstanceManager, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.InstanceManager, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.InstanceManagerList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.InstanceManager, err error) + InstanceManagerExpansion +} + +// instanceManagers implements InstanceManagerInterface +type instanceManagers struct { + client rest.Interface + ns string +} + +// newInstanceManagers returns a InstanceManagers +func newInstanceManagers(c *LonghornV1beta1Client, namespace string) *instanceManagers { + return &instanceManagers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the instanceManager, and returns the corresponding instanceManager object, and an error if there is any. +func (c *instanceManagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.InstanceManager, err error) { + result = &v1beta1.InstanceManager{} + err = c.client.Get(). + Namespace(c.ns). + Resource("instancemanagers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of InstanceManagers that match those selectors. +func (c *instanceManagers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.InstanceManagerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.InstanceManagerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("instancemanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested instanceManagers. +func (c *instanceManagers) Watch(ctx context.Context, 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("instancemanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a instanceManager and creates it. Returns the server's representation of the instanceManager, and an error, if there is any. +func (c *instanceManagers) Create(ctx context.Context, instanceManager *v1beta1.InstanceManager, opts v1.CreateOptions) (result *v1beta1.InstanceManager, err error) { + result = &v1beta1.InstanceManager{} + err = c.client.Post(). + Namespace(c.ns). + Resource("instancemanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(instanceManager). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a instanceManager and updates it. Returns the server's representation of the instanceManager, and an error, if there is any. +func (c *instanceManagers) Update(ctx context.Context, instanceManager *v1beta1.InstanceManager, opts v1.UpdateOptions) (result *v1beta1.InstanceManager, err error) { + result = &v1beta1.InstanceManager{} + err = c.client.Put(). + Namespace(c.ns). + Resource("instancemanagers"). + Name(instanceManager.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(instanceManager). + Do(ctx). + 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 *instanceManagers) UpdateStatus(ctx context.Context, instanceManager *v1beta1.InstanceManager, opts v1.UpdateOptions) (result *v1beta1.InstanceManager, err error) { + result = &v1beta1.InstanceManager{} + err = c.client.Put(). + Namespace(c.ns). + Resource("instancemanagers"). + Name(instanceManager.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(instanceManager). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the instanceManager and deletes it. Returns an error if one occurs. +func (c *instanceManagers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("instancemanagers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *instanceManagers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("instancemanagers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched instanceManager. +func (c *instanceManagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.InstanceManager, err error) { + result = &v1beta1.InstanceManager{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("instancemanagers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/longhorn.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/longhorn.io_client.go new file mode 100644 index 00000000..c1cce93c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/longhorn.io_client.go @@ -0,0 +1,177 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "net/http" + + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + rest "k8s.io/client-go/rest" +) + +type LonghornV1beta1Interface interface { + RESTClient() rest.Interface + BackingImagesGetter + BackingImageDataSourcesGetter + BackingImageManagersGetter + BackupsGetter + BackupTargetsGetter + BackupVolumesGetter + EnginesGetter + EngineImagesGetter + InstanceManagersGetter + NodesGetter + RecurringJobsGetter + ReplicasGetter + SettingsGetter + ShareManagersGetter + VolumesGetter +} + +// LonghornV1beta1Client is used to interact with features provided by the longhorn.io group. +type LonghornV1beta1Client struct { + restClient rest.Interface +} + +func (c *LonghornV1beta1Client) BackingImages(namespace string) BackingImageInterface { + return newBackingImages(c, namespace) +} + +func (c *LonghornV1beta1Client) BackingImageDataSources(namespace string) BackingImageDataSourceInterface { + return newBackingImageDataSources(c, namespace) +} + +func (c *LonghornV1beta1Client) BackingImageManagers(namespace string) BackingImageManagerInterface { + return newBackingImageManagers(c, namespace) +} + +func (c *LonghornV1beta1Client) Backups(namespace string) BackupInterface { + return newBackups(c, namespace) +} + +func (c *LonghornV1beta1Client) BackupTargets(namespace string) BackupTargetInterface { + return newBackupTargets(c, namespace) +} + +func (c *LonghornV1beta1Client) BackupVolumes(namespace string) BackupVolumeInterface { + return newBackupVolumes(c, namespace) +} + +func (c *LonghornV1beta1Client) Engines(namespace string) EngineInterface { + return newEngines(c, namespace) +} + +func (c *LonghornV1beta1Client) EngineImages(namespace string) EngineImageInterface { + return newEngineImages(c, namespace) +} + +func (c *LonghornV1beta1Client) InstanceManagers(namespace string) InstanceManagerInterface { + return newInstanceManagers(c, namespace) +} + +func (c *LonghornV1beta1Client) Nodes(namespace string) NodeInterface { + return newNodes(c, namespace) +} + +func (c *LonghornV1beta1Client) RecurringJobs(namespace string) RecurringJobInterface { + return newRecurringJobs(c, namespace) +} + +func (c *LonghornV1beta1Client) Replicas(namespace string) ReplicaInterface { + return newReplicas(c, namespace) +} + +func (c *LonghornV1beta1Client) Settings(namespace string) SettingInterface { + return newSettings(c, namespace) +} + +func (c *LonghornV1beta1Client) ShareManagers(namespace string) ShareManagerInterface { + return newShareManagers(c, namespace) +} + +func (c *LonghornV1beta1Client) Volumes(namespace string) VolumeInterface { + return newVolumes(c, namespace) +} + +// NewForConfig creates a new LonghornV1beta1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*LonghornV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new LonghornV1beta1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*LonghornV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &LonghornV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new LonghornV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *LonghornV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new LonghornV1beta1Client for the given RESTClient. +func New(c rest.Interface) *LonghornV1beta1Client { + return &LonghornV1beta1Client{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 *LonghornV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/node.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/node.go new file mode 100644 index 00000000..c4c2b0f9 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/node.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// NodesGetter has a method to return a NodeInterface. +// A group's client should implement this interface. +type NodesGetter interface { + Nodes(namespace string) NodeInterface +} + +// NodeInterface has methods to work with Node resources. +type NodeInterface interface { + Create(ctx context.Context, node *v1beta1.Node, opts v1.CreateOptions) (*v1beta1.Node, error) + Update(ctx context.Context, node *v1beta1.Node, opts v1.UpdateOptions) (*v1beta1.Node, error) + UpdateStatus(ctx context.Context, node *v1beta1.Node, opts v1.UpdateOptions) (*v1beta1.Node, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Node, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.NodeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Node, err error) + NodeExpansion +} + +// nodes implements NodeInterface +type nodes struct { + client rest.Interface + ns string +} + +// newNodes returns a Nodes +func newNodes(c *LonghornV1beta1Client, namespace string) *nodes { + return &nodes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the node, and returns the corresponding node object, and an error if there is any. +func (c *nodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Node, err error) { + result = &v1beta1.Node{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Nodes that match those selectors. +func (c *nodes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.NodeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.NodeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodes. +func (c *nodes) Watch(ctx context.Context, 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("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. +func (c *nodes) Create(ctx context.Context, node *v1beta1.Node, opts v1.CreateOptions) (result *v1beta1.Node, err error) { + result = &v1beta1.Node{} + err = c.client.Post(). + Namespace(c.ns). + Resource("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(node). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. +func (c *nodes) Update(ctx context.Context, node *v1beta1.Node, opts v1.UpdateOptions) (result *v1beta1.Node, err error) { + result = &v1beta1.Node{} + err = c.client.Put(). + Namespace(c.ns). + Resource("nodes"). + Name(node.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(node). + Do(ctx). + 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 *nodes) UpdateStatus(ctx context.Context, node *v1beta1.Node, opts v1.UpdateOptions) (result *v1beta1.Node, err error) { + result = &v1beta1.Node{} + err = c.client.Put(). + Namespace(c.ns). + Resource("nodes"). + Name(node.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(node). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the node and deletes it. Returns an error if one occurs. +func (c *nodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("nodes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("nodes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched node. +func (c *nodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Node, err error) { + result = &v1beta1.Node{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("nodes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/recurringjob.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/recurringjob.go new file mode 100644 index 00000000..a1abf7be --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/recurringjob.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// RecurringJobsGetter has a method to return a RecurringJobInterface. +// A group's client should implement this interface. +type RecurringJobsGetter interface { + RecurringJobs(namespace string) RecurringJobInterface +} + +// RecurringJobInterface has methods to work with RecurringJob resources. +type RecurringJobInterface interface { + Create(ctx context.Context, recurringJob *v1beta1.RecurringJob, opts v1.CreateOptions) (*v1beta1.RecurringJob, error) + Update(ctx context.Context, recurringJob *v1beta1.RecurringJob, opts v1.UpdateOptions) (*v1beta1.RecurringJob, error) + UpdateStatus(ctx context.Context, recurringJob *v1beta1.RecurringJob, opts v1.UpdateOptions) (*v1beta1.RecurringJob, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.RecurringJob, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.RecurringJobList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RecurringJob, err error) + RecurringJobExpansion +} + +// recurringJobs implements RecurringJobInterface +type recurringJobs struct { + client rest.Interface + ns string +} + +// newRecurringJobs returns a RecurringJobs +func newRecurringJobs(c *LonghornV1beta1Client, namespace string) *recurringJobs { + return &recurringJobs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the recurringJob, and returns the corresponding recurringJob object, and an error if there is any. +func (c *recurringJobs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.RecurringJob, err error) { + result = &v1beta1.RecurringJob{} + err = c.client.Get(). + Namespace(c.ns). + Resource("recurringjobs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RecurringJobs that match those selectors. +func (c *recurringJobs) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.RecurringJobList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.RecurringJobList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("recurringjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested recurringJobs. +func (c *recurringJobs) Watch(ctx context.Context, 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("recurringjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a recurringJob and creates it. Returns the server's representation of the recurringJob, and an error, if there is any. +func (c *recurringJobs) Create(ctx context.Context, recurringJob *v1beta1.RecurringJob, opts v1.CreateOptions) (result *v1beta1.RecurringJob, err error) { + result = &v1beta1.RecurringJob{} + err = c.client.Post(). + Namespace(c.ns). + Resource("recurringjobs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(recurringJob). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a recurringJob and updates it. Returns the server's representation of the recurringJob, and an error, if there is any. +func (c *recurringJobs) Update(ctx context.Context, recurringJob *v1beta1.RecurringJob, opts v1.UpdateOptions) (result *v1beta1.RecurringJob, err error) { + result = &v1beta1.RecurringJob{} + err = c.client.Put(). + Namespace(c.ns). + Resource("recurringjobs"). + Name(recurringJob.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(recurringJob). + Do(ctx). + 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 *recurringJobs) UpdateStatus(ctx context.Context, recurringJob *v1beta1.RecurringJob, opts v1.UpdateOptions) (result *v1beta1.RecurringJob, err error) { + result = &v1beta1.RecurringJob{} + err = c.client.Put(). + Namespace(c.ns). + Resource("recurringjobs"). + Name(recurringJob.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(recurringJob). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the recurringJob and deletes it. Returns an error if one occurs. +func (c *recurringJobs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("recurringjobs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *recurringJobs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("recurringjobs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched recurringJob. +func (c *recurringJobs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.RecurringJob, err error) { + result = &v1beta1.RecurringJob{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("recurringjobs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/replica.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/replica.go new file mode 100644 index 00000000..787428b3 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/replica.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// ReplicasGetter has a method to return a ReplicaInterface. +// A group's client should implement this interface. +type ReplicasGetter interface { + Replicas(namespace string) ReplicaInterface +} + +// ReplicaInterface has methods to work with Replica resources. +type ReplicaInterface interface { + Create(ctx context.Context, replica *v1beta1.Replica, opts v1.CreateOptions) (*v1beta1.Replica, error) + Update(ctx context.Context, replica *v1beta1.Replica, opts v1.UpdateOptions) (*v1beta1.Replica, error) + UpdateStatus(ctx context.Context, replica *v1beta1.Replica, opts v1.UpdateOptions) (*v1beta1.Replica, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Replica, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ReplicaList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Replica, err error) + ReplicaExpansion +} + +// replicas implements ReplicaInterface +type replicas struct { + client rest.Interface + ns string +} + +// newReplicas returns a Replicas +func newReplicas(c *LonghornV1beta1Client, namespace string) *replicas { + return &replicas{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the replica, and returns the corresponding replica object, and an error if there is any. +func (c *replicas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Replica, err error) { + result = &v1beta1.Replica{} + err = c.client.Get(). + Namespace(c.ns). + Resource("replicas"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Replicas that match those selectors. +func (c *replicas) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ReplicaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ReplicaList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("replicas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested replicas. +func (c *replicas) Watch(ctx context.Context, 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("replicas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a replica and creates it. Returns the server's representation of the replica, and an error, if there is any. +func (c *replicas) Create(ctx context.Context, replica *v1beta1.Replica, opts v1.CreateOptions) (result *v1beta1.Replica, err error) { + result = &v1beta1.Replica{} + err = c.client.Post(). + Namespace(c.ns). + Resource("replicas"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(replica). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a replica and updates it. Returns the server's representation of the replica, and an error, if there is any. +func (c *replicas) Update(ctx context.Context, replica *v1beta1.Replica, opts v1.UpdateOptions) (result *v1beta1.Replica, err error) { + result = &v1beta1.Replica{} + err = c.client.Put(). + Namespace(c.ns). + Resource("replicas"). + Name(replica.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(replica). + Do(ctx). + 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 *replicas) UpdateStatus(ctx context.Context, replica *v1beta1.Replica, opts v1.UpdateOptions) (result *v1beta1.Replica, err error) { + result = &v1beta1.Replica{} + err = c.client.Put(). + Namespace(c.ns). + Resource("replicas"). + Name(replica.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(replica). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the replica and deletes it. Returns an error if one occurs. +func (c *replicas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("replicas"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *replicas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("replicas"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched replica. +func (c *replicas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Replica, err error) { + result = &v1beta1.Replica{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("replicas"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/setting.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/setting.go new file mode 100644 index 00000000..70899800 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/setting.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// SettingsGetter has a method to return a SettingInterface. +// A group's client should implement this interface. +type SettingsGetter interface { + Settings(namespace string) SettingInterface +} + +// SettingInterface has methods to work with Setting resources. +type SettingInterface interface { + Create(ctx context.Context, setting *v1beta1.Setting, opts v1.CreateOptions) (*v1beta1.Setting, error) + Update(ctx context.Context, setting *v1beta1.Setting, opts v1.UpdateOptions) (*v1beta1.Setting, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Setting, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.SettingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Setting, err error) + SettingExpansion +} + +// settings implements SettingInterface +type settings struct { + client rest.Interface + ns string +} + +// newSettings returns a Settings +func newSettings(c *LonghornV1beta1Client, namespace string) *settings { + return &settings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the setting, and returns the corresponding setting object, and an error if there is any. +func (c *settings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Setting, err error) { + result = &v1beta1.Setting{} + err = c.client.Get(). + Namespace(c.ns). + Resource("settings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Settings that match those selectors. +func (c *settings) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.SettingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.SettingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("settings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested settings. +func (c *settings) Watch(ctx context.Context, 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("settings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a setting and creates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *settings) Create(ctx context.Context, setting *v1beta1.Setting, opts v1.CreateOptions) (result *v1beta1.Setting, err error) { + result = &v1beta1.Setting{} + err = c.client.Post(). + Namespace(c.ns). + Resource("settings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(setting). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a setting and updates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *settings) Update(ctx context.Context, setting *v1beta1.Setting, opts v1.UpdateOptions) (result *v1beta1.Setting, err error) { + result = &v1beta1.Setting{} + err = c.client.Put(). + Namespace(c.ns). + Resource("settings"). + Name(setting.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(setting). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the setting and deletes it. Returns an error if one occurs. +func (c *settings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("settings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *settings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("settings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched setting. +func (c *settings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Setting, err error) { + result = &v1beta1.Setting{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("settings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/sharemanager.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/sharemanager.go new file mode 100644 index 00000000..10a9d913 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/sharemanager.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// ShareManagersGetter has a method to return a ShareManagerInterface. +// A group's client should implement this interface. +type ShareManagersGetter interface { + ShareManagers(namespace string) ShareManagerInterface +} + +// ShareManagerInterface has methods to work with ShareManager resources. +type ShareManagerInterface interface { + Create(ctx context.Context, shareManager *v1beta1.ShareManager, opts v1.CreateOptions) (*v1beta1.ShareManager, error) + Update(ctx context.Context, shareManager *v1beta1.ShareManager, opts v1.UpdateOptions) (*v1beta1.ShareManager, error) + UpdateStatus(ctx context.Context, shareManager *v1beta1.ShareManager, opts v1.UpdateOptions) (*v1beta1.ShareManager, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.ShareManager, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.ShareManagerList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ShareManager, err error) + ShareManagerExpansion +} + +// shareManagers implements ShareManagerInterface +type shareManagers struct { + client rest.Interface + ns string +} + +// newShareManagers returns a ShareManagers +func newShareManagers(c *LonghornV1beta1Client, namespace string) *shareManagers { + return &shareManagers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the shareManager, and returns the corresponding shareManager object, and an error if there is any. +func (c *shareManagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.ShareManager, err error) { + result = &v1beta1.ShareManager{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sharemanagers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ShareManagers that match those selectors. +func (c *shareManagers) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.ShareManagerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.ShareManagerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("sharemanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested shareManagers. +func (c *shareManagers) Watch(ctx context.Context, 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("sharemanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a shareManager and creates it. Returns the server's representation of the shareManager, and an error, if there is any. +func (c *shareManagers) Create(ctx context.Context, shareManager *v1beta1.ShareManager, opts v1.CreateOptions) (result *v1beta1.ShareManager, err error) { + result = &v1beta1.ShareManager{} + err = c.client.Post(). + Namespace(c.ns). + Resource("sharemanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(shareManager). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a shareManager and updates it. Returns the server's representation of the shareManager, and an error, if there is any. +func (c *shareManagers) Update(ctx context.Context, shareManager *v1beta1.ShareManager, opts v1.UpdateOptions) (result *v1beta1.ShareManager, err error) { + result = &v1beta1.ShareManager{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sharemanagers"). + Name(shareManager.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(shareManager). + Do(ctx). + 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 *shareManagers) UpdateStatus(ctx context.Context, shareManager *v1beta1.ShareManager, opts v1.UpdateOptions) (result *v1beta1.ShareManager, err error) { + result = &v1beta1.ShareManager{} + err = c.client.Put(). + Namespace(c.ns). + Resource("sharemanagers"). + Name(shareManager.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(shareManager). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the shareManager and deletes it. Returns an error if one occurs. +func (c *shareManagers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("sharemanagers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *shareManagers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("sharemanagers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched shareManager. +func (c *shareManagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.ShareManager, err error) { + result = &v1beta1.ShareManager{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("sharemanagers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/volume.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/volume.go new file mode 100644 index 00000000..86ed07d6 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1/volume.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + 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" +) + +// VolumesGetter has a method to return a VolumeInterface. +// A group's client should implement this interface. +type VolumesGetter interface { + Volumes(namespace string) VolumeInterface +} + +// VolumeInterface has methods to work with Volume resources. +type VolumeInterface interface { + Create(ctx context.Context, volume *v1beta1.Volume, opts v1.CreateOptions) (*v1beta1.Volume, error) + Update(ctx context.Context, volume *v1beta1.Volume, opts v1.UpdateOptions) (*v1beta1.Volume, error) + UpdateStatus(ctx context.Context, volume *v1beta1.Volume, opts v1.UpdateOptions) (*v1beta1.Volume, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.Volume, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Volume, err error) + VolumeExpansion +} + +// volumes implements VolumeInterface +type volumes struct { + client rest.Interface + ns string +} + +// newVolumes returns a Volumes +func newVolumes(c *LonghornV1beta1Client, namespace string) *volumes { + return &volumes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the volume, and returns the corresponding volume object, and an error if there is any. +func (c *volumes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.Volume, err error) { + result = &v1beta1.Volume{} + err = c.client.Get(). + Namespace(c.ns). + Resource("volumes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Volumes that match those selectors. +func (c *volumes) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VolumeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("volumes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested volumes. +func (c *volumes) Watch(ctx context.Context, 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("volumes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a volume and creates it. Returns the server's representation of the volume, and an error, if there is any. +func (c *volumes) Create(ctx context.Context, volume *v1beta1.Volume, opts v1.CreateOptions) (result *v1beta1.Volume, err error) { + result = &v1beta1.Volume{} + err = c.client.Post(). + Namespace(c.ns). + Resource("volumes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volume). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a volume and updates it. Returns the server's representation of the volume, and an error, if there is any. +func (c *volumes) Update(ctx context.Context, volume *v1beta1.Volume, opts v1.UpdateOptions) (result *v1beta1.Volume, err error) { + result = &v1beta1.Volume{} + err = c.client.Put(). + Namespace(c.ns). + Resource("volumes"). + Name(volume.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volume). + Do(ctx). + 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 *volumes) UpdateStatus(ctx context.Context, volume *v1beta1.Volume, opts v1.UpdateOptions) (result *v1beta1.Volume, err error) { + result = &v1beta1.Volume{} + err = c.client.Put(). + Namespace(c.ns). + Resource("volumes"). + Name(volume.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volume). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the volume and deletes it. Returns an error if one occurs. +func (c *volumes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("volumes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *volumes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("volumes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched volume. +func (c *volumes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.Volume, err error) { + result = &v1beta1.Volume{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("volumes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/activedirectoryprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/activedirectoryprovider.go new file mode 100644 index 00000000..49a95e54 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/activedirectoryprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ActiveDirectoryProvidersGetter has a method to return a ActiveDirectoryProviderInterface. +// A group's client should implement this interface. +type ActiveDirectoryProvidersGetter interface { + ActiveDirectoryProviders() ActiveDirectoryProviderInterface +} + +// ActiveDirectoryProviderInterface has methods to work with ActiveDirectoryProvider resources. +type ActiveDirectoryProviderInterface interface { + Create(ctx context.Context, activeDirectoryProvider *v3.ActiveDirectoryProvider, opts v1.CreateOptions) (*v3.ActiveDirectoryProvider, error) + Update(ctx context.Context, activeDirectoryProvider *v3.ActiveDirectoryProvider, opts v1.UpdateOptions) (*v3.ActiveDirectoryProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ActiveDirectoryProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ActiveDirectoryProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ActiveDirectoryProvider, err error) + ActiveDirectoryProviderExpansion +} + +// activeDirectoryProviders implements ActiveDirectoryProviderInterface +type activeDirectoryProviders struct { + client rest.Interface +} + +// newActiveDirectoryProviders returns a ActiveDirectoryProviders +func newActiveDirectoryProviders(c *ManagementV3Client) *activeDirectoryProviders { + return &activeDirectoryProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the activeDirectoryProvider, and returns the corresponding activeDirectoryProvider object, and an error if there is any. +func (c *activeDirectoryProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ActiveDirectoryProvider, err error) { + result = &v3.ActiveDirectoryProvider{} + err = c.client.Get(). + Resource("activedirectoryproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ActiveDirectoryProviders that match those selectors. +func (c *activeDirectoryProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.ActiveDirectoryProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ActiveDirectoryProviderList{} + err = c.client.Get(). + Resource("activedirectoryproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested activeDirectoryProviders. +func (c *activeDirectoryProviders) Watch(ctx context.Context, 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(). + Resource("activedirectoryproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a activeDirectoryProvider and creates it. Returns the server's representation of the activeDirectoryProvider, and an error, if there is any. +func (c *activeDirectoryProviders) Create(ctx context.Context, activeDirectoryProvider *v3.ActiveDirectoryProvider, opts v1.CreateOptions) (result *v3.ActiveDirectoryProvider, err error) { + result = &v3.ActiveDirectoryProvider{} + err = c.client.Post(). + Resource("activedirectoryproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(activeDirectoryProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a activeDirectoryProvider and updates it. Returns the server's representation of the activeDirectoryProvider, and an error, if there is any. +func (c *activeDirectoryProviders) Update(ctx context.Context, activeDirectoryProvider *v3.ActiveDirectoryProvider, opts v1.UpdateOptions) (result *v3.ActiveDirectoryProvider, err error) { + result = &v3.ActiveDirectoryProvider{} + err = c.client.Put(). + Resource("activedirectoryproviders"). + Name(activeDirectoryProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(activeDirectoryProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the activeDirectoryProvider and deletes it. Returns an error if one occurs. +func (c *activeDirectoryProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("activedirectoryproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *activeDirectoryProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("activedirectoryproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched activeDirectoryProvider. +func (c *activeDirectoryProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ActiveDirectoryProvider, err error) { + result = &v3.ActiveDirectoryProvider{} + err = c.client.Patch(pt). + Resource("activedirectoryproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/apiservice.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/apiservice.go new file mode 100644 index 00000000..9d0227dd --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/apiservice.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// APIServicesGetter has a method to return a APIServiceInterface. +// A group's client should implement this interface. +type APIServicesGetter interface { + APIServices() APIServiceInterface +} + +// APIServiceInterface has methods to work with APIService resources. +type APIServiceInterface interface { + Create(ctx context.Context, aPIService *v3.APIService, opts v1.CreateOptions) (*v3.APIService, error) + Update(ctx context.Context, aPIService *v3.APIService, opts v1.UpdateOptions) (*v3.APIService, error) + UpdateStatus(ctx context.Context, aPIService *v3.APIService, opts v1.UpdateOptions) (*v3.APIService, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.APIService, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.APIServiceList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.APIService, err error) + APIServiceExpansion +} + +// aPIServices implements APIServiceInterface +type aPIServices struct { + client rest.Interface +} + +// newAPIServices returns a APIServices +func newAPIServices(c *ManagementV3Client) *aPIServices { + return &aPIServices{ + client: c.RESTClient(), + } +} + +// Get takes name of the aPIService, and returns the corresponding aPIService object, and an error if there is any. +func (c *aPIServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.APIService, err error) { + result = &v3.APIService{} + err = c.client.Get(). + Resource("apiservices"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of APIServices that match those selectors. +func (c *aPIServices) List(ctx context.Context, opts v1.ListOptions) (result *v3.APIServiceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.APIServiceList{} + err = c.client.Get(). + Resource("apiservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested aPIServices. +func (c *aPIServices) Watch(ctx context.Context, 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(). + Resource("apiservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a aPIService and creates it. Returns the server's representation of the aPIService, and an error, if there is any. +func (c *aPIServices) Create(ctx context.Context, aPIService *v3.APIService, opts v1.CreateOptions) (result *v3.APIService, err error) { + result = &v3.APIService{} + err = c.client.Post(). + Resource("apiservices"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aPIService). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a aPIService and updates it. Returns the server's representation of the aPIService, and an error, if there is any. +func (c *aPIServices) Update(ctx context.Context, aPIService *v3.APIService, opts v1.UpdateOptions) (result *v3.APIService, err error) { + result = &v3.APIService{} + err = c.client.Put(). + Resource("apiservices"). + Name(aPIService.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aPIService). + Do(ctx). + 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 *aPIServices) UpdateStatus(ctx context.Context, aPIService *v3.APIService, opts v1.UpdateOptions) (result *v3.APIService, err error) { + result = &v3.APIService{} + err = c.client.Put(). + Resource("apiservices"). + Name(aPIService.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(aPIService). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the aPIService and deletes it. Returns an error if one occurs. +func (c *aPIServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("apiservices"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *aPIServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("apiservices"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched aPIService. +func (c *aPIServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.APIService, err error) { + result = &v3.APIService{} + err = c.client.Patch(pt). + Resource("apiservices"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/authconfig.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/authconfig.go new file mode 100644 index 00000000..05593953 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/authconfig.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// AuthConfigsGetter has a method to return a AuthConfigInterface. +// A group's client should implement this interface. +type AuthConfigsGetter interface { + AuthConfigs() AuthConfigInterface +} + +// AuthConfigInterface has methods to work with AuthConfig resources. +type AuthConfigInterface interface { + Create(ctx context.Context, authConfig *v3.AuthConfig, opts v1.CreateOptions) (*v3.AuthConfig, error) + Update(ctx context.Context, authConfig *v3.AuthConfig, opts v1.UpdateOptions) (*v3.AuthConfig, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.AuthConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.AuthConfigList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AuthConfig, err error) + AuthConfigExpansion +} + +// authConfigs implements AuthConfigInterface +type authConfigs struct { + client rest.Interface +} + +// newAuthConfigs returns a AuthConfigs +func newAuthConfigs(c *ManagementV3Client) *authConfigs { + return &authConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the authConfig, and returns the corresponding authConfig object, and an error if there is any. +func (c *authConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.AuthConfig, err error) { + result = &v3.AuthConfig{} + err = c.client.Get(). + Resource("authconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AuthConfigs that match those selectors. +func (c *authConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v3.AuthConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.AuthConfigList{} + err = c.client.Get(). + Resource("authconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested authConfigs. +func (c *authConfigs) Watch(ctx context.Context, 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(). + Resource("authconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a authConfig and creates it. Returns the server's representation of the authConfig, and an error, if there is any. +func (c *authConfigs) Create(ctx context.Context, authConfig *v3.AuthConfig, opts v1.CreateOptions) (result *v3.AuthConfig, err error) { + result = &v3.AuthConfig{} + err = c.client.Post(). + Resource("authconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a authConfig and updates it. Returns the server's representation of the authConfig, and an error, if there is any. +func (c *authConfigs) Update(ctx context.Context, authConfig *v3.AuthConfig, opts v1.UpdateOptions) (result *v3.AuthConfig, err error) { + result = &v3.AuthConfig{} + err = c.client.Put(). + Resource("authconfigs"). + Name(authConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the authConfig and deletes it. Returns an error if one occurs. +func (c *authConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("authconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *authConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("authconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched authConfig. +func (c *authConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AuthConfig, err error) { + result = &v3.AuthConfig{} + err = c.client.Patch(pt). + Resource("authconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/authprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/authprovider.go new file mode 100644 index 00000000..c1102244 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/authprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// AuthProvidersGetter has a method to return a AuthProviderInterface. +// A group's client should implement this interface. +type AuthProvidersGetter interface { + AuthProviders() AuthProviderInterface +} + +// AuthProviderInterface has methods to work with AuthProvider resources. +type AuthProviderInterface interface { + Create(ctx context.Context, authProvider *v3.AuthProvider, opts v1.CreateOptions) (*v3.AuthProvider, error) + Update(ctx context.Context, authProvider *v3.AuthProvider, opts v1.UpdateOptions) (*v3.AuthProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.AuthProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.AuthProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AuthProvider, err error) + AuthProviderExpansion +} + +// authProviders implements AuthProviderInterface +type authProviders struct { + client rest.Interface +} + +// newAuthProviders returns a AuthProviders +func newAuthProviders(c *ManagementV3Client) *authProviders { + return &authProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the authProvider, and returns the corresponding authProvider object, and an error if there is any. +func (c *authProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.AuthProvider, err error) { + result = &v3.AuthProvider{} + err = c.client.Get(). + Resource("authproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AuthProviders that match those selectors. +func (c *authProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.AuthProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.AuthProviderList{} + err = c.client.Get(). + Resource("authproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested authProviders. +func (c *authProviders) Watch(ctx context.Context, 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(). + Resource("authproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a authProvider and creates it. Returns the server's representation of the authProvider, and an error, if there is any. +func (c *authProviders) Create(ctx context.Context, authProvider *v3.AuthProvider, opts v1.CreateOptions) (result *v3.AuthProvider, err error) { + result = &v3.AuthProvider{} + err = c.client.Post(). + Resource("authproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a authProvider and updates it. Returns the server's representation of the authProvider, and an error, if there is any. +func (c *authProviders) Update(ctx context.Context, authProvider *v3.AuthProvider, opts v1.UpdateOptions) (result *v3.AuthProvider, err error) { + result = &v3.AuthProvider{} + err = c.client.Put(). + Resource("authproviders"). + Name(authProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the authProvider and deletes it. Returns an error if one occurs. +func (c *authProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("authproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *authProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("authproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched authProvider. +func (c *authProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AuthProvider, err error) { + result = &v3.AuthProvider{} + err = c.client.Patch(pt). + Resource("authproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/authtoken.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/authtoken.go new file mode 100644 index 00000000..93e605ca --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/authtoken.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// AuthTokensGetter has a method to return a AuthTokenInterface. +// A group's client should implement this interface. +type AuthTokensGetter interface { + AuthTokens() AuthTokenInterface +} + +// AuthTokenInterface has methods to work with AuthToken resources. +type AuthTokenInterface interface { + Create(ctx context.Context, authToken *v3.AuthToken, opts v1.CreateOptions) (*v3.AuthToken, error) + Update(ctx context.Context, authToken *v3.AuthToken, opts v1.UpdateOptions) (*v3.AuthToken, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.AuthToken, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.AuthTokenList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AuthToken, err error) + AuthTokenExpansion +} + +// authTokens implements AuthTokenInterface +type authTokens struct { + client rest.Interface +} + +// newAuthTokens returns a AuthTokens +func newAuthTokens(c *ManagementV3Client) *authTokens { + return &authTokens{ + client: c.RESTClient(), + } +} + +// Get takes name of the authToken, and returns the corresponding authToken object, and an error if there is any. +func (c *authTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.AuthToken, err error) { + result = &v3.AuthToken{} + err = c.client.Get(). + Resource("authtokens"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AuthTokens that match those selectors. +func (c *authTokens) List(ctx context.Context, opts v1.ListOptions) (result *v3.AuthTokenList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.AuthTokenList{} + err = c.client.Get(). + Resource("authtokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested authTokens. +func (c *authTokens) Watch(ctx context.Context, 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(). + Resource("authtokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a authToken and creates it. Returns the server's representation of the authToken, and an error, if there is any. +func (c *authTokens) Create(ctx context.Context, authToken *v3.AuthToken, opts v1.CreateOptions) (result *v3.AuthToken, err error) { + result = &v3.AuthToken{} + err = c.client.Post(). + Resource("authtokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authToken). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a authToken and updates it. Returns the server's representation of the authToken, and an error, if there is any. +func (c *authTokens) Update(ctx context.Context, authToken *v3.AuthToken, opts v1.UpdateOptions) (result *v3.AuthToken, err error) { + result = &v3.AuthToken{} + err = c.client.Put(). + Resource("authtokens"). + Name(authToken.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(authToken). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the authToken and deletes it. Returns an error if one occurs. +func (c *authTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("authtokens"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *authTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("authtokens"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched authToken. +func (c *authTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AuthToken, err error) { + result = &v3.AuthToken{} + err = c.client.Patch(pt). + Resource("authtokens"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/azureadprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/azureadprovider.go new file mode 100644 index 00000000..1c3dd89f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/azureadprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// AzureADProvidersGetter has a method to return a AzureADProviderInterface. +// A group's client should implement this interface. +type AzureADProvidersGetter interface { + AzureADProviders() AzureADProviderInterface +} + +// AzureADProviderInterface has methods to work with AzureADProvider resources. +type AzureADProviderInterface interface { + Create(ctx context.Context, azureADProvider *v3.AzureADProvider, opts v1.CreateOptions) (*v3.AzureADProvider, error) + Update(ctx context.Context, azureADProvider *v3.AzureADProvider, opts v1.UpdateOptions) (*v3.AzureADProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.AzureADProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.AzureADProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AzureADProvider, err error) + AzureADProviderExpansion +} + +// azureADProviders implements AzureADProviderInterface +type azureADProviders struct { + client rest.Interface +} + +// newAzureADProviders returns a AzureADProviders +func newAzureADProviders(c *ManagementV3Client) *azureADProviders { + return &azureADProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the azureADProvider, and returns the corresponding azureADProvider object, and an error if there is any. +func (c *azureADProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.AzureADProvider, err error) { + result = &v3.AzureADProvider{} + err = c.client.Get(). + Resource("azureadproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of AzureADProviders that match those selectors. +func (c *azureADProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.AzureADProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.AzureADProviderList{} + err = c.client.Get(). + Resource("azureadproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested azureADProviders. +func (c *azureADProviders) Watch(ctx context.Context, 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(). + Resource("azureadproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a azureADProvider and creates it. Returns the server's representation of the azureADProvider, and an error, if there is any. +func (c *azureADProviders) Create(ctx context.Context, azureADProvider *v3.AzureADProvider, opts v1.CreateOptions) (result *v3.AzureADProvider, err error) { + result = &v3.AzureADProvider{} + err = c.client.Post(). + Resource("azureadproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(azureADProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a azureADProvider and updates it. Returns the server's representation of the azureADProvider, and an error, if there is any. +func (c *azureADProviders) Update(ctx context.Context, azureADProvider *v3.AzureADProvider, opts v1.UpdateOptions) (result *v3.AzureADProvider, err error) { + result = &v3.AzureADProvider{} + err = c.client.Put(). + Resource("azureadproviders"). + Name(azureADProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(azureADProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the azureADProvider and deletes it. Returns an error if one occurs. +func (c *azureADProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("azureadproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *azureADProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("azureadproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched azureADProvider. +func (c *azureADProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AzureADProvider, err error) { + result = &v3.AzureADProvider{} + err = c.client.Patch(pt). + Resource("azureadproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/catalog.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/catalog.go new file mode 100644 index 00000000..ea36f51f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/catalog.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// CatalogsGetter has a method to return a CatalogInterface. +// A group's client should implement this interface. +type CatalogsGetter interface { + Catalogs() CatalogInterface +} + +// CatalogInterface has methods to work with Catalog resources. +type CatalogInterface interface { + Create(ctx context.Context, catalog *v3.Catalog, opts v1.CreateOptions) (*v3.Catalog, error) + Update(ctx context.Context, catalog *v3.Catalog, opts v1.UpdateOptions) (*v3.Catalog, error) + UpdateStatus(ctx context.Context, catalog *v3.Catalog, opts v1.UpdateOptions) (*v3.Catalog, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Catalog, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.CatalogList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Catalog, err error) + CatalogExpansion +} + +// catalogs implements CatalogInterface +type catalogs struct { + client rest.Interface +} + +// newCatalogs returns a Catalogs +func newCatalogs(c *ManagementV3Client) *catalogs { + return &catalogs{ + client: c.RESTClient(), + } +} + +// Get takes name of the catalog, and returns the corresponding catalog object, and an error if there is any. +func (c *catalogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Catalog, err error) { + result = &v3.Catalog{} + err = c.client.Get(). + Resource("catalogs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Catalogs that match those selectors. +func (c *catalogs) List(ctx context.Context, opts v1.ListOptions) (result *v3.CatalogList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.CatalogList{} + err = c.client.Get(). + Resource("catalogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested catalogs. +func (c *catalogs) Watch(ctx context.Context, 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(). + Resource("catalogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a catalog and creates it. Returns the server's representation of the catalog, and an error, if there is any. +func (c *catalogs) Create(ctx context.Context, catalog *v3.Catalog, opts v1.CreateOptions) (result *v3.Catalog, err error) { + result = &v3.Catalog{} + err = c.client.Post(). + Resource("catalogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(catalog). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a catalog and updates it. Returns the server's representation of the catalog, and an error, if there is any. +func (c *catalogs) Update(ctx context.Context, catalog *v3.Catalog, opts v1.UpdateOptions) (result *v3.Catalog, err error) { + result = &v3.Catalog{} + err = c.client.Put(). + Resource("catalogs"). + Name(catalog.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(catalog). + Do(ctx). + 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 *catalogs) UpdateStatus(ctx context.Context, catalog *v3.Catalog, opts v1.UpdateOptions) (result *v3.Catalog, err error) { + result = &v3.Catalog{} + err = c.client.Put(). + Resource("catalogs"). + Name(catalog.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(catalog). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the catalog and deletes it. Returns an error if one occurs. +func (c *catalogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("catalogs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *catalogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("catalogs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched catalog. +func (c *catalogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Catalog, err error) { + result = &v3.Catalog{} + err = c.client.Patch(pt). + Resource("catalogs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/catalogtemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/catalogtemplate.go new file mode 100644 index 00000000..a905cf4d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/catalogtemplate.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// CatalogTemplatesGetter has a method to return a CatalogTemplateInterface. +// A group's client should implement this interface. +type CatalogTemplatesGetter interface { + CatalogTemplates(namespace string) CatalogTemplateInterface +} + +// CatalogTemplateInterface has methods to work with CatalogTemplate resources. +type CatalogTemplateInterface interface { + Create(ctx context.Context, catalogTemplate *v3.CatalogTemplate, opts v1.CreateOptions) (*v3.CatalogTemplate, error) + Update(ctx context.Context, catalogTemplate *v3.CatalogTemplate, opts v1.UpdateOptions) (*v3.CatalogTemplate, error) + UpdateStatus(ctx context.Context, catalogTemplate *v3.CatalogTemplate, opts v1.UpdateOptions) (*v3.CatalogTemplate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.CatalogTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.CatalogTemplateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CatalogTemplate, err error) + CatalogTemplateExpansion +} + +// catalogTemplates implements CatalogTemplateInterface +type catalogTemplates struct { + client rest.Interface + ns string +} + +// newCatalogTemplates returns a CatalogTemplates +func newCatalogTemplates(c *ManagementV3Client, namespace string) *catalogTemplates { + return &catalogTemplates{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the catalogTemplate, and returns the corresponding catalogTemplate object, and an error if there is any. +func (c *catalogTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CatalogTemplate, err error) { + result = &v3.CatalogTemplate{} + err = c.client.Get(). + Namespace(c.ns). + Resource("catalogtemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CatalogTemplates that match those selectors. +func (c *catalogTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.CatalogTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.CatalogTemplateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("catalogtemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested catalogTemplates. +func (c *catalogTemplates) Watch(ctx context.Context, 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("catalogtemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a catalogTemplate and creates it. Returns the server's representation of the catalogTemplate, and an error, if there is any. +func (c *catalogTemplates) Create(ctx context.Context, catalogTemplate *v3.CatalogTemplate, opts v1.CreateOptions) (result *v3.CatalogTemplate, err error) { + result = &v3.CatalogTemplate{} + err = c.client.Post(). + Namespace(c.ns). + Resource("catalogtemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(catalogTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a catalogTemplate and updates it. Returns the server's representation of the catalogTemplate, and an error, if there is any. +func (c *catalogTemplates) Update(ctx context.Context, catalogTemplate *v3.CatalogTemplate, opts v1.UpdateOptions) (result *v3.CatalogTemplate, err error) { + result = &v3.CatalogTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("catalogtemplates"). + Name(catalogTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(catalogTemplate). + Do(ctx). + 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 *catalogTemplates) UpdateStatus(ctx context.Context, catalogTemplate *v3.CatalogTemplate, opts v1.UpdateOptions) (result *v3.CatalogTemplate, err error) { + result = &v3.CatalogTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("catalogtemplates"). + Name(catalogTemplate.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(catalogTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the catalogTemplate and deletes it. Returns an error if one occurs. +func (c *catalogTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("catalogtemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *catalogTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("catalogtemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched catalogTemplate. +func (c *catalogTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CatalogTemplate, err error) { + result = &v3.CatalogTemplate{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("catalogtemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/catalogtemplateversion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/catalogtemplateversion.go new file mode 100644 index 00000000..c5a52375 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/catalogtemplateversion.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// CatalogTemplateVersionsGetter has a method to return a CatalogTemplateVersionInterface. +// A group's client should implement this interface. +type CatalogTemplateVersionsGetter interface { + CatalogTemplateVersions(namespace string) CatalogTemplateVersionInterface +} + +// CatalogTemplateVersionInterface has methods to work with CatalogTemplateVersion resources. +type CatalogTemplateVersionInterface interface { + Create(ctx context.Context, catalogTemplateVersion *v3.CatalogTemplateVersion, opts v1.CreateOptions) (*v3.CatalogTemplateVersion, error) + Update(ctx context.Context, catalogTemplateVersion *v3.CatalogTemplateVersion, opts v1.UpdateOptions) (*v3.CatalogTemplateVersion, error) + UpdateStatus(ctx context.Context, catalogTemplateVersion *v3.CatalogTemplateVersion, opts v1.UpdateOptions) (*v3.CatalogTemplateVersion, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.CatalogTemplateVersion, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.CatalogTemplateVersionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CatalogTemplateVersion, err error) + CatalogTemplateVersionExpansion +} + +// catalogTemplateVersions implements CatalogTemplateVersionInterface +type catalogTemplateVersions struct { + client rest.Interface + ns string +} + +// newCatalogTemplateVersions returns a CatalogTemplateVersions +func newCatalogTemplateVersions(c *ManagementV3Client, namespace string) *catalogTemplateVersions { + return &catalogTemplateVersions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the catalogTemplateVersion, and returns the corresponding catalogTemplateVersion object, and an error if there is any. +func (c *catalogTemplateVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CatalogTemplateVersion, err error) { + result = &v3.CatalogTemplateVersion{} + err = c.client.Get(). + Namespace(c.ns). + Resource("catalogtemplateversions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CatalogTemplateVersions that match those selectors. +func (c *catalogTemplateVersions) List(ctx context.Context, opts v1.ListOptions) (result *v3.CatalogTemplateVersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.CatalogTemplateVersionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("catalogtemplateversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested catalogTemplateVersions. +func (c *catalogTemplateVersions) Watch(ctx context.Context, 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("catalogtemplateversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a catalogTemplateVersion and creates it. Returns the server's representation of the catalogTemplateVersion, and an error, if there is any. +func (c *catalogTemplateVersions) Create(ctx context.Context, catalogTemplateVersion *v3.CatalogTemplateVersion, opts v1.CreateOptions) (result *v3.CatalogTemplateVersion, err error) { + result = &v3.CatalogTemplateVersion{} + err = c.client.Post(). + Namespace(c.ns). + Resource("catalogtemplateversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(catalogTemplateVersion). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a catalogTemplateVersion and updates it. Returns the server's representation of the catalogTemplateVersion, and an error, if there is any. +func (c *catalogTemplateVersions) Update(ctx context.Context, catalogTemplateVersion *v3.CatalogTemplateVersion, opts v1.UpdateOptions) (result *v3.CatalogTemplateVersion, err error) { + result = &v3.CatalogTemplateVersion{} + err = c.client.Put(). + Namespace(c.ns). + Resource("catalogtemplateversions"). + Name(catalogTemplateVersion.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(catalogTemplateVersion). + Do(ctx). + 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 *catalogTemplateVersions) UpdateStatus(ctx context.Context, catalogTemplateVersion *v3.CatalogTemplateVersion, opts v1.UpdateOptions) (result *v3.CatalogTemplateVersion, err error) { + result = &v3.CatalogTemplateVersion{} + err = c.client.Put(). + Namespace(c.ns). + Resource("catalogtemplateversions"). + Name(catalogTemplateVersion.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(catalogTemplateVersion). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the catalogTemplateVersion and deletes it. Returns an error if one occurs. +func (c *catalogTemplateVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("catalogtemplateversions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *catalogTemplateVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("catalogtemplateversions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched catalogTemplateVersion. +func (c *catalogTemplateVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CatalogTemplateVersion, err error) { + result = &v3.CatalogTemplateVersion{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("catalogtemplateversions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cisbenchmarkversion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cisbenchmarkversion.go new file mode 100644 index 00000000..348a83fd --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cisbenchmarkversion.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// CisBenchmarkVersionsGetter has a method to return a CisBenchmarkVersionInterface. +// A group's client should implement this interface. +type CisBenchmarkVersionsGetter interface { + CisBenchmarkVersions(namespace string) CisBenchmarkVersionInterface +} + +// CisBenchmarkVersionInterface has methods to work with CisBenchmarkVersion resources. +type CisBenchmarkVersionInterface interface { + Create(ctx context.Context, cisBenchmarkVersion *v3.CisBenchmarkVersion, opts v1.CreateOptions) (*v3.CisBenchmarkVersion, error) + Update(ctx context.Context, cisBenchmarkVersion *v3.CisBenchmarkVersion, opts v1.UpdateOptions) (*v3.CisBenchmarkVersion, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.CisBenchmarkVersion, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.CisBenchmarkVersionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CisBenchmarkVersion, err error) + CisBenchmarkVersionExpansion +} + +// cisBenchmarkVersions implements CisBenchmarkVersionInterface +type cisBenchmarkVersions struct { + client rest.Interface + ns string +} + +// newCisBenchmarkVersions returns a CisBenchmarkVersions +func newCisBenchmarkVersions(c *ManagementV3Client, namespace string) *cisBenchmarkVersions { + return &cisBenchmarkVersions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the cisBenchmarkVersion, and returns the corresponding cisBenchmarkVersion object, and an error if there is any. +func (c *cisBenchmarkVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CisBenchmarkVersion, err error) { + result = &v3.CisBenchmarkVersion{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cisbenchmarkversions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CisBenchmarkVersions that match those selectors. +func (c *cisBenchmarkVersions) List(ctx context.Context, opts v1.ListOptions) (result *v3.CisBenchmarkVersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.CisBenchmarkVersionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cisbenchmarkversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested cisBenchmarkVersions. +func (c *cisBenchmarkVersions) Watch(ctx context.Context, 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("cisbenchmarkversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a cisBenchmarkVersion and creates it. Returns the server's representation of the cisBenchmarkVersion, and an error, if there is any. +func (c *cisBenchmarkVersions) Create(ctx context.Context, cisBenchmarkVersion *v3.CisBenchmarkVersion, opts v1.CreateOptions) (result *v3.CisBenchmarkVersion, err error) { + result = &v3.CisBenchmarkVersion{} + err = c.client.Post(). + Namespace(c.ns). + Resource("cisbenchmarkversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cisBenchmarkVersion). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a cisBenchmarkVersion and updates it. Returns the server's representation of the cisBenchmarkVersion, and an error, if there is any. +func (c *cisBenchmarkVersions) Update(ctx context.Context, cisBenchmarkVersion *v3.CisBenchmarkVersion, opts v1.UpdateOptions) (result *v3.CisBenchmarkVersion, err error) { + result = &v3.CisBenchmarkVersion{} + err = c.client.Put(). + Namespace(c.ns). + Resource("cisbenchmarkversions"). + Name(cisBenchmarkVersion.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cisBenchmarkVersion). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the cisBenchmarkVersion and deletes it. Returns an error if one occurs. +func (c *cisBenchmarkVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("cisbenchmarkversions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *cisBenchmarkVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("cisbenchmarkversions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched cisBenchmarkVersion. +func (c *cisBenchmarkVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CisBenchmarkVersion, err error) { + result = &v3.CisBenchmarkVersion{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("cisbenchmarkversions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cisconfig.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cisconfig.go new file mode 100644 index 00000000..c8b0540b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cisconfig.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// CisConfigsGetter has a method to return a CisConfigInterface. +// A group's client should implement this interface. +type CisConfigsGetter interface { + CisConfigs(namespace string) CisConfigInterface +} + +// CisConfigInterface has methods to work with CisConfig resources. +type CisConfigInterface interface { + Create(ctx context.Context, cisConfig *v3.CisConfig, opts v1.CreateOptions) (*v3.CisConfig, error) + Update(ctx context.Context, cisConfig *v3.CisConfig, opts v1.UpdateOptions) (*v3.CisConfig, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.CisConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.CisConfigList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CisConfig, err error) + CisConfigExpansion +} + +// cisConfigs implements CisConfigInterface +type cisConfigs struct { + client rest.Interface + ns string +} + +// newCisConfigs returns a CisConfigs +func newCisConfigs(c *ManagementV3Client, namespace string) *cisConfigs { + return &cisConfigs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the cisConfig, and returns the corresponding cisConfig object, and an error if there is any. +func (c *cisConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CisConfig, err error) { + result = &v3.CisConfig{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cisconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CisConfigs that match those selectors. +func (c *cisConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v3.CisConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.CisConfigList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cisconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested cisConfigs. +func (c *cisConfigs) Watch(ctx context.Context, 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("cisconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a cisConfig and creates it. Returns the server's representation of the cisConfig, and an error, if there is any. +func (c *cisConfigs) Create(ctx context.Context, cisConfig *v3.CisConfig, opts v1.CreateOptions) (result *v3.CisConfig, err error) { + result = &v3.CisConfig{} + err = c.client.Post(). + Namespace(c.ns). + Resource("cisconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cisConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a cisConfig and updates it. Returns the server's representation of the cisConfig, and an error, if there is any. +func (c *cisConfigs) Update(ctx context.Context, cisConfig *v3.CisConfig, opts v1.UpdateOptions) (result *v3.CisConfig, err error) { + result = &v3.CisConfig{} + err = c.client.Put(). + Namespace(c.ns). + Resource("cisconfigs"). + Name(cisConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cisConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the cisConfig and deletes it. Returns an error if one occurs. +func (c *cisConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("cisconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *cisConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("cisconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched cisConfig. +func (c *cisConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CisConfig, err error) { + result = &v3.CisConfig{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("cisconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cloudcredential.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cloudcredential.go new file mode 100644 index 00000000..8879ace6 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cloudcredential.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// CloudCredentialsGetter has a method to return a CloudCredentialInterface. +// A group's client should implement this interface. +type CloudCredentialsGetter interface { + CloudCredentials(namespace string) CloudCredentialInterface +} + +// CloudCredentialInterface has methods to work with CloudCredential resources. +type CloudCredentialInterface interface { + Create(ctx context.Context, cloudCredential *v3.CloudCredential, opts v1.CreateOptions) (*v3.CloudCredential, error) + Update(ctx context.Context, cloudCredential *v3.CloudCredential, opts v1.UpdateOptions) (*v3.CloudCredential, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.CloudCredential, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.CloudCredentialList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CloudCredential, err error) + CloudCredentialExpansion +} + +// cloudCredentials implements CloudCredentialInterface +type cloudCredentials struct { + client rest.Interface + ns string +} + +// newCloudCredentials returns a CloudCredentials +func newCloudCredentials(c *ManagementV3Client, namespace string) *cloudCredentials { + return &cloudCredentials{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the cloudCredential, and returns the corresponding cloudCredential object, and an error if there is any. +func (c *cloudCredentials) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CloudCredential, err error) { + result = &v3.CloudCredential{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cloudcredentials"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of CloudCredentials that match those selectors. +func (c *cloudCredentials) List(ctx context.Context, opts v1.ListOptions) (result *v3.CloudCredentialList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.CloudCredentialList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("cloudcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested cloudCredentials. +func (c *cloudCredentials) Watch(ctx context.Context, 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("cloudcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a cloudCredential and creates it. Returns the server's representation of the cloudCredential, and an error, if there is any. +func (c *cloudCredentials) Create(ctx context.Context, cloudCredential *v3.CloudCredential, opts v1.CreateOptions) (result *v3.CloudCredential, err error) { + result = &v3.CloudCredential{} + err = c.client.Post(). + Namespace(c.ns). + Resource("cloudcredentials"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cloudCredential). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a cloudCredential and updates it. Returns the server's representation of the cloudCredential, and an error, if there is any. +func (c *cloudCredentials) Update(ctx context.Context, cloudCredential *v3.CloudCredential, opts v1.UpdateOptions) (result *v3.CloudCredential, err error) { + result = &v3.CloudCredential{} + err = c.client.Put(). + Namespace(c.ns). + Resource("cloudcredentials"). + Name(cloudCredential.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cloudCredential). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the cloudCredential and deletes it. Returns an error if one occurs. +func (c *cloudCredentials) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("cloudcredentials"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *cloudCredentials) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("cloudcredentials"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched cloudCredential. +func (c *cloudCredentials) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CloudCredential, err error) { + result = &v3.CloudCredential{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("cloudcredentials"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cluster.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cluster.go new file mode 100644 index 00000000..8e2e8eba --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/cluster.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// 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(ctx context.Context, cluster *v3.Cluster, opts v1.CreateOptions) (*v3.Cluster, error) + Update(ctx context.Context, cluster *v3.Cluster, opts v1.UpdateOptions) (*v3.Cluster, error) + UpdateStatus(ctx context.Context, cluster *v3.Cluster, opts v1.UpdateOptions) (*v3.Cluster, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Cluster, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Cluster, err error) + ClusterExpansion +} + +// clusters implements ClusterInterface +type clusters struct { + client rest.Interface +} + +// newClusters returns a Clusters +func newClusters(c *ManagementV3Client) *clusters { + return &clusters{ + client: c.RESTClient(), + } +} + +// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. +func (c *clusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Cluster, err error) { + result = &v3.Cluster{} + err = c.client.Get(). + Resource("clusters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Clusters that match those selectors. +func (c *clusters) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterList{} + err = c.client.Get(). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusters. +func (c *clusters) Watch(ctx context.Context, 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(). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// 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(ctx context.Context, cluster *v3.Cluster, opts v1.CreateOptions) (result *v3.Cluster, err error) { + result = &v3.Cluster{} + err = c.client.Post(). + Resource("clusters"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cluster). + Do(ctx). + 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(ctx context.Context, cluster *v3.Cluster, opts v1.UpdateOptions) (result *v3.Cluster, err error) { + result = &v3.Cluster{} + err = c.client.Put(). + Resource("clusters"). + Name(cluster.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cluster). + Do(ctx). + 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 *clusters) UpdateStatus(ctx context.Context, cluster *v3.Cluster, opts v1.UpdateOptions) (result *v3.Cluster, err error) { + result = &v3.Cluster{} + err = c.client.Put(). + Resource("clusters"). + Name(cluster.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(cluster). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the cluster and deletes it. Returns an error if one occurs. +func (c *clusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("clusters"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("clusters"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched cluster. +func (c *clusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Cluster, err error) { + result = &v3.Cluster{} + err = c.client.Patch(pt). + Resource("clusters"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusteralert.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusteralert.go new file mode 100644 index 00000000..b38f3cd0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusteralert.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterAlertsGetter has a method to return a ClusterAlertInterface. +// A group's client should implement this interface. +type ClusterAlertsGetter interface { + ClusterAlerts(namespace string) ClusterAlertInterface +} + +// ClusterAlertInterface has methods to work with ClusterAlert resources. +type ClusterAlertInterface interface { + Create(ctx context.Context, clusterAlert *v3.ClusterAlert, opts v1.CreateOptions) (*v3.ClusterAlert, error) + Update(ctx context.Context, clusterAlert *v3.ClusterAlert, opts v1.UpdateOptions) (*v3.ClusterAlert, error) + UpdateStatus(ctx context.Context, clusterAlert *v3.ClusterAlert, opts v1.UpdateOptions) (*v3.ClusterAlert, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterAlert, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterAlertList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterAlert, err error) + ClusterAlertExpansion +} + +// clusterAlerts implements ClusterAlertInterface +type clusterAlerts struct { + client rest.Interface + ns string +} + +// newClusterAlerts returns a ClusterAlerts +func newClusterAlerts(c *ManagementV3Client, namespace string) *clusterAlerts { + return &clusterAlerts{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterAlert, and returns the corresponding clusterAlert object, and an error if there is any. +func (c *clusterAlerts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterAlert, err error) { + result = &v3.ClusterAlert{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusteralerts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterAlerts that match those selectors. +func (c *clusterAlerts) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterAlertList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterAlertList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusteralerts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterAlerts. +func (c *clusterAlerts) Watch(ctx context.Context, 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("clusteralerts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterAlert and creates it. Returns the server's representation of the clusterAlert, and an error, if there is any. +func (c *clusterAlerts) Create(ctx context.Context, clusterAlert *v3.ClusterAlert, opts v1.CreateOptions) (result *v3.ClusterAlert, err error) { + result = &v3.ClusterAlert{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clusteralerts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterAlert). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterAlert and updates it. Returns the server's representation of the clusterAlert, and an error, if there is any. +func (c *clusterAlerts) Update(ctx context.Context, clusterAlert *v3.ClusterAlert, opts v1.UpdateOptions) (result *v3.ClusterAlert, err error) { + result = &v3.ClusterAlert{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusteralerts"). + Name(clusterAlert.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterAlert). + Do(ctx). + 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 *clusterAlerts) UpdateStatus(ctx context.Context, clusterAlert *v3.ClusterAlert, opts v1.UpdateOptions) (result *v3.ClusterAlert, err error) { + result = &v3.ClusterAlert{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusteralerts"). + Name(clusterAlert.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterAlert). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterAlert and deletes it. Returns an error if one occurs. +func (c *clusterAlerts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clusteralerts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterAlerts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clusteralerts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterAlert. +func (c *clusterAlerts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterAlert, err error) { + result = &v3.ClusterAlert{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clusteralerts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusteralertgroup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusteralertgroup.go new file mode 100644 index 00000000..ae004694 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusteralertgroup.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterAlertGroupsGetter has a method to return a ClusterAlertGroupInterface. +// A group's client should implement this interface. +type ClusterAlertGroupsGetter interface { + ClusterAlertGroups(namespace string) ClusterAlertGroupInterface +} + +// ClusterAlertGroupInterface has methods to work with ClusterAlertGroup resources. +type ClusterAlertGroupInterface interface { + Create(ctx context.Context, clusterAlertGroup *v3.ClusterAlertGroup, opts v1.CreateOptions) (*v3.ClusterAlertGroup, error) + Update(ctx context.Context, clusterAlertGroup *v3.ClusterAlertGroup, opts v1.UpdateOptions) (*v3.ClusterAlertGroup, error) + UpdateStatus(ctx context.Context, clusterAlertGroup *v3.ClusterAlertGroup, opts v1.UpdateOptions) (*v3.ClusterAlertGroup, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterAlertGroup, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterAlertGroupList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterAlertGroup, err error) + ClusterAlertGroupExpansion +} + +// clusterAlertGroups implements ClusterAlertGroupInterface +type clusterAlertGroups struct { + client rest.Interface + ns string +} + +// newClusterAlertGroups returns a ClusterAlertGroups +func newClusterAlertGroups(c *ManagementV3Client, namespace string) *clusterAlertGroups { + return &clusterAlertGroups{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterAlertGroup, and returns the corresponding clusterAlertGroup object, and an error if there is any. +func (c *clusterAlertGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterAlertGroup, err error) { + result = &v3.ClusterAlertGroup{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusteralertgroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterAlertGroups that match those selectors. +func (c *clusterAlertGroups) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterAlertGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterAlertGroupList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusteralertgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterAlertGroups. +func (c *clusterAlertGroups) Watch(ctx context.Context, 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("clusteralertgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterAlertGroup and creates it. Returns the server's representation of the clusterAlertGroup, and an error, if there is any. +func (c *clusterAlertGroups) Create(ctx context.Context, clusterAlertGroup *v3.ClusterAlertGroup, opts v1.CreateOptions) (result *v3.ClusterAlertGroup, err error) { + result = &v3.ClusterAlertGroup{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clusteralertgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterAlertGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterAlertGroup and updates it. Returns the server's representation of the clusterAlertGroup, and an error, if there is any. +func (c *clusterAlertGroups) Update(ctx context.Context, clusterAlertGroup *v3.ClusterAlertGroup, opts v1.UpdateOptions) (result *v3.ClusterAlertGroup, err error) { + result = &v3.ClusterAlertGroup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusteralertgroups"). + Name(clusterAlertGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterAlertGroup). + Do(ctx). + 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 *clusterAlertGroups) UpdateStatus(ctx context.Context, clusterAlertGroup *v3.ClusterAlertGroup, opts v1.UpdateOptions) (result *v3.ClusterAlertGroup, err error) { + result = &v3.ClusterAlertGroup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusteralertgroups"). + Name(clusterAlertGroup.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterAlertGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterAlertGroup and deletes it. Returns an error if one occurs. +func (c *clusterAlertGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clusteralertgroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterAlertGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clusteralertgroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterAlertGroup. +func (c *clusterAlertGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterAlertGroup, err error) { + result = &v3.ClusterAlertGroup{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clusteralertgroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusteralertrule.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusteralertrule.go new file mode 100644 index 00000000..552a370a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusteralertrule.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterAlertRulesGetter has a method to return a ClusterAlertRuleInterface. +// A group's client should implement this interface. +type ClusterAlertRulesGetter interface { + ClusterAlertRules(namespace string) ClusterAlertRuleInterface +} + +// ClusterAlertRuleInterface has methods to work with ClusterAlertRule resources. +type ClusterAlertRuleInterface interface { + Create(ctx context.Context, clusterAlertRule *v3.ClusterAlertRule, opts v1.CreateOptions) (*v3.ClusterAlertRule, error) + Update(ctx context.Context, clusterAlertRule *v3.ClusterAlertRule, opts v1.UpdateOptions) (*v3.ClusterAlertRule, error) + UpdateStatus(ctx context.Context, clusterAlertRule *v3.ClusterAlertRule, opts v1.UpdateOptions) (*v3.ClusterAlertRule, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterAlertRule, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterAlertRuleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterAlertRule, err error) + ClusterAlertRuleExpansion +} + +// clusterAlertRules implements ClusterAlertRuleInterface +type clusterAlertRules struct { + client rest.Interface + ns string +} + +// newClusterAlertRules returns a ClusterAlertRules +func newClusterAlertRules(c *ManagementV3Client, namespace string) *clusterAlertRules { + return &clusterAlertRules{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterAlertRule, and returns the corresponding clusterAlertRule object, and an error if there is any. +func (c *clusterAlertRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterAlertRule, err error) { + result = &v3.ClusterAlertRule{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusteralertrules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterAlertRules that match those selectors. +func (c *clusterAlertRules) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterAlertRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterAlertRuleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusteralertrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterAlertRules. +func (c *clusterAlertRules) Watch(ctx context.Context, 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("clusteralertrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterAlertRule and creates it. Returns the server's representation of the clusterAlertRule, and an error, if there is any. +func (c *clusterAlertRules) Create(ctx context.Context, clusterAlertRule *v3.ClusterAlertRule, opts v1.CreateOptions) (result *v3.ClusterAlertRule, err error) { + result = &v3.ClusterAlertRule{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clusteralertrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterAlertRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterAlertRule and updates it. Returns the server's representation of the clusterAlertRule, and an error, if there is any. +func (c *clusterAlertRules) Update(ctx context.Context, clusterAlertRule *v3.ClusterAlertRule, opts v1.UpdateOptions) (result *v3.ClusterAlertRule, err error) { + result = &v3.ClusterAlertRule{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusteralertrules"). + Name(clusterAlertRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterAlertRule). + Do(ctx). + 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 *clusterAlertRules) UpdateStatus(ctx context.Context, clusterAlertRule *v3.ClusterAlertRule, opts v1.UpdateOptions) (result *v3.ClusterAlertRule, err error) { + result = &v3.ClusterAlertRule{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusteralertrules"). + Name(clusterAlertRule.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterAlertRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterAlertRule and deletes it. Returns an error if one occurs. +func (c *clusterAlertRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clusteralertrules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterAlertRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clusteralertrules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterAlertRule. +func (c *clusterAlertRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterAlertRule, err error) { + result = &v3.ClusterAlertRule{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clusteralertrules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustercatalog.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustercatalog.go new file mode 100644 index 00000000..5ff444c2 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustercatalog.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterCatalogsGetter has a method to return a ClusterCatalogInterface. +// A group's client should implement this interface. +type ClusterCatalogsGetter interface { + ClusterCatalogs(namespace string) ClusterCatalogInterface +} + +// ClusterCatalogInterface has methods to work with ClusterCatalog resources. +type ClusterCatalogInterface interface { + Create(ctx context.Context, clusterCatalog *v3.ClusterCatalog, opts v1.CreateOptions) (*v3.ClusterCatalog, error) + Update(ctx context.Context, clusterCatalog *v3.ClusterCatalog, opts v1.UpdateOptions) (*v3.ClusterCatalog, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterCatalog, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterCatalogList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterCatalog, err error) + ClusterCatalogExpansion +} + +// clusterCatalogs implements ClusterCatalogInterface +type clusterCatalogs struct { + client rest.Interface + ns string +} + +// newClusterCatalogs returns a ClusterCatalogs +func newClusterCatalogs(c *ManagementV3Client, namespace string) *clusterCatalogs { + return &clusterCatalogs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterCatalog, and returns the corresponding clusterCatalog object, and an error if there is any. +func (c *clusterCatalogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterCatalog, err error) { + result = &v3.ClusterCatalog{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clustercatalogs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterCatalogs that match those selectors. +func (c *clusterCatalogs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterCatalogList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterCatalogList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clustercatalogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterCatalogs. +func (c *clusterCatalogs) Watch(ctx context.Context, 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("clustercatalogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterCatalog and creates it. Returns the server's representation of the clusterCatalog, and an error, if there is any. +func (c *clusterCatalogs) Create(ctx context.Context, clusterCatalog *v3.ClusterCatalog, opts v1.CreateOptions) (result *v3.ClusterCatalog, err error) { + result = &v3.ClusterCatalog{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clustercatalogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterCatalog). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterCatalog and updates it. Returns the server's representation of the clusterCatalog, and an error, if there is any. +func (c *clusterCatalogs) Update(ctx context.Context, clusterCatalog *v3.ClusterCatalog, opts v1.UpdateOptions) (result *v3.ClusterCatalog, err error) { + result = &v3.ClusterCatalog{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clustercatalogs"). + Name(clusterCatalog.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterCatalog). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterCatalog and deletes it. Returns an error if one occurs. +func (c *clusterCatalogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clustercatalogs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterCatalogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clustercatalogs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterCatalog. +func (c *clusterCatalogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterCatalog, err error) { + result = &v3.ClusterCatalog{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clustercatalogs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterlogging.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterlogging.go new file mode 100644 index 00000000..015fdce9 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterlogging.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterLoggingsGetter has a method to return a ClusterLoggingInterface. +// A group's client should implement this interface. +type ClusterLoggingsGetter interface { + ClusterLoggings(namespace string) ClusterLoggingInterface +} + +// ClusterLoggingInterface has methods to work with ClusterLogging resources. +type ClusterLoggingInterface interface { + Create(ctx context.Context, clusterLogging *v3.ClusterLogging, opts v1.CreateOptions) (*v3.ClusterLogging, error) + Update(ctx context.Context, clusterLogging *v3.ClusterLogging, opts v1.UpdateOptions) (*v3.ClusterLogging, error) + UpdateStatus(ctx context.Context, clusterLogging *v3.ClusterLogging, opts v1.UpdateOptions) (*v3.ClusterLogging, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterLogging, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterLoggingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterLogging, err error) + ClusterLoggingExpansion +} + +// clusterLoggings implements ClusterLoggingInterface +type clusterLoggings struct { + client rest.Interface + ns string +} + +// newClusterLoggings returns a ClusterLoggings +func newClusterLoggings(c *ManagementV3Client, namespace string) *clusterLoggings { + return &clusterLoggings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterLogging, and returns the corresponding clusterLogging object, and an error if there is any. +func (c *clusterLoggings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterLogging, err error) { + result = &v3.ClusterLogging{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusterloggings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterLoggings that match those selectors. +func (c *clusterLoggings) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterLoggingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterLoggingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusterloggings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterLoggings. +func (c *clusterLoggings) Watch(ctx context.Context, 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("clusterloggings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterLogging and creates it. Returns the server's representation of the clusterLogging, and an error, if there is any. +func (c *clusterLoggings) Create(ctx context.Context, clusterLogging *v3.ClusterLogging, opts v1.CreateOptions) (result *v3.ClusterLogging, err error) { + result = &v3.ClusterLogging{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clusterloggings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterLogging). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterLogging and updates it. Returns the server's representation of the clusterLogging, and an error, if there is any. +func (c *clusterLoggings) Update(ctx context.Context, clusterLogging *v3.ClusterLogging, opts v1.UpdateOptions) (result *v3.ClusterLogging, err error) { + result = &v3.ClusterLogging{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusterloggings"). + Name(clusterLogging.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterLogging). + Do(ctx). + 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 *clusterLoggings) UpdateStatus(ctx context.Context, clusterLogging *v3.ClusterLogging, opts v1.UpdateOptions) (result *v3.ClusterLogging, err error) { + result = &v3.ClusterLogging{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusterloggings"). + Name(clusterLogging.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterLogging). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterLogging and deletes it. Returns an error if one occurs. +func (c *clusterLoggings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clusterloggings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterLoggings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clusterloggings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterLogging. +func (c *clusterLoggings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterLogging, err error) { + result = &v3.ClusterLogging{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clusterloggings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustermonitorgraph.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustermonitorgraph.go new file mode 100644 index 00000000..cecf44f1 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustermonitorgraph.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterMonitorGraphsGetter has a method to return a ClusterMonitorGraphInterface. +// A group's client should implement this interface. +type ClusterMonitorGraphsGetter interface { + ClusterMonitorGraphs(namespace string) ClusterMonitorGraphInterface +} + +// ClusterMonitorGraphInterface has methods to work with ClusterMonitorGraph resources. +type ClusterMonitorGraphInterface interface { + Create(ctx context.Context, clusterMonitorGraph *v3.ClusterMonitorGraph, opts v1.CreateOptions) (*v3.ClusterMonitorGraph, error) + Update(ctx context.Context, clusterMonitorGraph *v3.ClusterMonitorGraph, opts v1.UpdateOptions) (*v3.ClusterMonitorGraph, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterMonitorGraph, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterMonitorGraphList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterMonitorGraph, err error) + ClusterMonitorGraphExpansion +} + +// clusterMonitorGraphs implements ClusterMonitorGraphInterface +type clusterMonitorGraphs struct { + client rest.Interface + ns string +} + +// newClusterMonitorGraphs returns a ClusterMonitorGraphs +func newClusterMonitorGraphs(c *ManagementV3Client, namespace string) *clusterMonitorGraphs { + return &clusterMonitorGraphs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterMonitorGraph, and returns the corresponding clusterMonitorGraph object, and an error if there is any. +func (c *clusterMonitorGraphs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterMonitorGraph, err error) { + result = &v3.ClusterMonitorGraph{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clustermonitorgraphs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterMonitorGraphs that match those selectors. +func (c *clusterMonitorGraphs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterMonitorGraphList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterMonitorGraphList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clustermonitorgraphs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterMonitorGraphs. +func (c *clusterMonitorGraphs) Watch(ctx context.Context, 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("clustermonitorgraphs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterMonitorGraph and creates it. Returns the server's representation of the clusterMonitorGraph, and an error, if there is any. +func (c *clusterMonitorGraphs) Create(ctx context.Context, clusterMonitorGraph *v3.ClusterMonitorGraph, opts v1.CreateOptions) (result *v3.ClusterMonitorGraph, err error) { + result = &v3.ClusterMonitorGraph{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clustermonitorgraphs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterMonitorGraph). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterMonitorGraph and updates it. Returns the server's representation of the clusterMonitorGraph, and an error, if there is any. +func (c *clusterMonitorGraphs) Update(ctx context.Context, clusterMonitorGraph *v3.ClusterMonitorGraph, opts v1.UpdateOptions) (result *v3.ClusterMonitorGraph, err error) { + result = &v3.ClusterMonitorGraph{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clustermonitorgraphs"). + Name(clusterMonitorGraph.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterMonitorGraph). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterMonitorGraph and deletes it. Returns an error if one occurs. +func (c *clusterMonitorGraphs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clustermonitorgraphs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterMonitorGraphs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clustermonitorgraphs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterMonitorGraph. +func (c *clusterMonitorGraphs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterMonitorGraph, err error) { + result = &v3.ClusterMonitorGraph{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clustermonitorgraphs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterregistrationtoken.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterregistrationtoken.go new file mode 100644 index 00000000..71b0ac2b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterregistrationtoken.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterRegistrationTokensGetter has a method to return a ClusterRegistrationTokenInterface. +// A group's client should implement this interface. +type ClusterRegistrationTokensGetter interface { + ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface +} + +// ClusterRegistrationTokenInterface has methods to work with ClusterRegistrationToken resources. +type ClusterRegistrationTokenInterface interface { + Create(ctx context.Context, clusterRegistrationToken *v3.ClusterRegistrationToken, opts v1.CreateOptions) (*v3.ClusterRegistrationToken, error) + Update(ctx context.Context, clusterRegistrationToken *v3.ClusterRegistrationToken, opts v1.UpdateOptions) (*v3.ClusterRegistrationToken, error) + UpdateStatus(ctx context.Context, clusterRegistrationToken *v3.ClusterRegistrationToken, opts v1.UpdateOptions) (*v3.ClusterRegistrationToken, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterRegistrationToken, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterRegistrationTokenList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterRegistrationToken, err error) + ClusterRegistrationTokenExpansion +} + +// clusterRegistrationTokens implements ClusterRegistrationTokenInterface +type clusterRegistrationTokens struct { + client rest.Interface + ns string +} + +// newClusterRegistrationTokens returns a ClusterRegistrationTokens +func newClusterRegistrationTokens(c *ManagementV3Client, namespace string) *clusterRegistrationTokens { + return &clusterRegistrationTokens{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterRegistrationToken, and returns the corresponding clusterRegistrationToken object, and an error if there is any. +func (c *clusterRegistrationTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterRegistrationToken, err error) { + result = &v3.ClusterRegistrationToken{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusterregistrationtokens"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterRegistrationTokens that match those selectors. +func (c *clusterRegistrationTokens) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterRegistrationTokenList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterRegistrationTokenList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusterregistrationtokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterRegistrationTokens. +func (c *clusterRegistrationTokens) Watch(ctx context.Context, 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("clusterregistrationtokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterRegistrationToken and creates it. Returns the server's representation of the clusterRegistrationToken, and an error, if there is any. +func (c *clusterRegistrationTokens) Create(ctx context.Context, clusterRegistrationToken *v3.ClusterRegistrationToken, opts v1.CreateOptions) (result *v3.ClusterRegistrationToken, err error) { + result = &v3.ClusterRegistrationToken{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clusterregistrationtokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterRegistrationToken). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterRegistrationToken and updates it. Returns the server's representation of the clusterRegistrationToken, and an error, if there is any. +func (c *clusterRegistrationTokens) Update(ctx context.Context, clusterRegistrationToken *v3.ClusterRegistrationToken, opts v1.UpdateOptions) (result *v3.ClusterRegistrationToken, err error) { + result = &v3.ClusterRegistrationToken{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusterregistrationtokens"). + Name(clusterRegistrationToken.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterRegistrationToken). + Do(ctx). + 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 *clusterRegistrationTokens) UpdateStatus(ctx context.Context, clusterRegistrationToken *v3.ClusterRegistrationToken, opts v1.UpdateOptions) (result *v3.ClusterRegistrationToken, err error) { + result = &v3.ClusterRegistrationToken{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusterregistrationtokens"). + Name(clusterRegistrationToken.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterRegistrationToken). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterRegistrationToken and deletes it. Returns an error if one occurs. +func (c *clusterRegistrationTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clusterregistrationtokens"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterRegistrationTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clusterregistrationtokens"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterRegistrationToken. +func (c *clusterRegistrationTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterRegistrationToken, err error) { + result = &v3.ClusterRegistrationToken{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clusterregistrationtokens"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterroletemplatebinding.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterroletemplatebinding.go new file mode 100644 index 00000000..35441c0e --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterroletemplatebinding.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterRoleTemplateBindingsGetter has a method to return a ClusterRoleTemplateBindingInterface. +// A group's client should implement this interface. +type ClusterRoleTemplateBindingsGetter interface { + ClusterRoleTemplateBindings(namespace string) ClusterRoleTemplateBindingInterface +} + +// ClusterRoleTemplateBindingInterface has methods to work with ClusterRoleTemplateBinding resources. +type ClusterRoleTemplateBindingInterface interface { + Create(ctx context.Context, clusterRoleTemplateBinding *v3.ClusterRoleTemplateBinding, opts v1.CreateOptions) (*v3.ClusterRoleTemplateBinding, error) + Update(ctx context.Context, clusterRoleTemplateBinding *v3.ClusterRoleTemplateBinding, opts v1.UpdateOptions) (*v3.ClusterRoleTemplateBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterRoleTemplateBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterRoleTemplateBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterRoleTemplateBinding, err error) + ClusterRoleTemplateBindingExpansion +} + +// clusterRoleTemplateBindings implements ClusterRoleTemplateBindingInterface +type clusterRoleTemplateBindings struct { + client rest.Interface + ns string +} + +// newClusterRoleTemplateBindings returns a ClusterRoleTemplateBindings +func newClusterRoleTemplateBindings(c *ManagementV3Client, namespace string) *clusterRoleTemplateBindings { + return &clusterRoleTemplateBindings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterRoleTemplateBinding, and returns the corresponding clusterRoleTemplateBinding object, and an error if there is any. +func (c *clusterRoleTemplateBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterRoleTemplateBinding, err error) { + result = &v3.ClusterRoleTemplateBinding{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusterroletemplatebindings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterRoleTemplateBindings that match those selectors. +func (c *clusterRoleTemplateBindings) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterRoleTemplateBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterRoleTemplateBindingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusterroletemplatebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterRoleTemplateBindings. +func (c *clusterRoleTemplateBindings) Watch(ctx context.Context, 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("clusterroletemplatebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterRoleTemplateBinding and creates it. Returns the server's representation of the clusterRoleTemplateBinding, and an error, if there is any. +func (c *clusterRoleTemplateBindings) Create(ctx context.Context, clusterRoleTemplateBinding *v3.ClusterRoleTemplateBinding, opts v1.CreateOptions) (result *v3.ClusterRoleTemplateBinding, err error) { + result = &v3.ClusterRoleTemplateBinding{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clusterroletemplatebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterRoleTemplateBinding). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterRoleTemplateBinding and updates it. Returns the server's representation of the clusterRoleTemplateBinding, and an error, if there is any. +func (c *clusterRoleTemplateBindings) Update(ctx context.Context, clusterRoleTemplateBinding *v3.ClusterRoleTemplateBinding, opts v1.UpdateOptions) (result *v3.ClusterRoleTemplateBinding, err error) { + result = &v3.ClusterRoleTemplateBinding{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusterroletemplatebindings"). + Name(clusterRoleTemplateBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterRoleTemplateBinding). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterRoleTemplateBinding and deletes it. Returns an error if one occurs. +func (c *clusterRoleTemplateBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clusterroletemplatebindings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterRoleTemplateBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clusterroletemplatebindings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterRoleTemplateBinding. +func (c *clusterRoleTemplateBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterRoleTemplateBinding, err error) { + result = &v3.ClusterRoleTemplateBinding{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clusterroletemplatebindings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterscan.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterscan.go new file mode 100644 index 00000000..603f9bcd --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clusterscan.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterScansGetter has a method to return a ClusterScanInterface. +// A group's client should implement this interface. +type ClusterScansGetter interface { + ClusterScans(namespace string) ClusterScanInterface +} + +// ClusterScanInterface has methods to work with ClusterScan resources. +type ClusterScanInterface interface { + Create(ctx context.Context, clusterScan *v3.ClusterScan, opts v1.CreateOptions) (*v3.ClusterScan, error) + Update(ctx context.Context, clusterScan *v3.ClusterScan, opts v1.UpdateOptions) (*v3.ClusterScan, error) + UpdateStatus(ctx context.Context, clusterScan *v3.ClusterScan, opts v1.UpdateOptions) (*v3.ClusterScan, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterScan, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterScanList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterScan, err error) + ClusterScanExpansion +} + +// clusterScans implements ClusterScanInterface +type clusterScans struct { + client rest.Interface + ns string +} + +// newClusterScans returns a ClusterScans +func newClusterScans(c *ManagementV3Client, namespace string) *clusterScans { + return &clusterScans{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterScan, and returns the corresponding clusterScan object, and an error if there is any. +func (c *clusterScans) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterScan, err error) { + result = &v3.ClusterScan{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusterscans"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterScans that match those selectors. +func (c *clusterScans) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterScanList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterScanList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clusterscans"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterScans. +func (c *clusterScans) Watch(ctx context.Context, 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("clusterscans"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterScan and creates it. Returns the server's representation of the clusterScan, and an error, if there is any. +func (c *clusterScans) Create(ctx context.Context, clusterScan *v3.ClusterScan, opts v1.CreateOptions) (result *v3.ClusterScan, err error) { + result = &v3.ClusterScan{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clusterscans"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterScan). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterScan and updates it. Returns the server's representation of the clusterScan, and an error, if there is any. +func (c *clusterScans) Update(ctx context.Context, clusterScan *v3.ClusterScan, opts v1.UpdateOptions) (result *v3.ClusterScan, err error) { + result = &v3.ClusterScan{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusterscans"). + Name(clusterScan.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterScan). + Do(ctx). + 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 *clusterScans) UpdateStatus(ctx context.Context, clusterScan *v3.ClusterScan, opts v1.UpdateOptions) (result *v3.ClusterScan, err error) { + result = &v3.ClusterScan{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clusterscans"). + Name(clusterScan.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterScan). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterScan and deletes it. Returns an error if one occurs. +func (c *clusterScans) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clusterscans"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterScans) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clusterscans"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterScan. +func (c *clusterScans) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterScan, err error) { + result = &v3.ClusterScan{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clusterscans"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustertemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustertemplate.go new file mode 100644 index 00000000..b4b0b7c2 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustertemplate.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterTemplatesGetter has a method to return a ClusterTemplateInterface. +// A group's client should implement this interface. +type ClusterTemplatesGetter interface { + ClusterTemplates(namespace string) ClusterTemplateInterface +} + +// ClusterTemplateInterface has methods to work with ClusterTemplate resources. +type ClusterTemplateInterface interface { + Create(ctx context.Context, clusterTemplate *v3.ClusterTemplate, opts v1.CreateOptions) (*v3.ClusterTemplate, error) + Update(ctx context.Context, clusterTemplate *v3.ClusterTemplate, opts v1.UpdateOptions) (*v3.ClusterTemplate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterTemplateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterTemplate, err error) + ClusterTemplateExpansion +} + +// clusterTemplates implements ClusterTemplateInterface +type clusterTemplates struct { + client rest.Interface + ns string +} + +// newClusterTemplates returns a ClusterTemplates +func newClusterTemplates(c *ManagementV3Client, namespace string) *clusterTemplates { + return &clusterTemplates{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterTemplate, and returns the corresponding clusterTemplate object, and an error if there is any. +func (c *clusterTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterTemplate, err error) { + result = &v3.ClusterTemplate{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clustertemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterTemplates that match those selectors. +func (c *clusterTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterTemplateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clustertemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterTemplates. +func (c *clusterTemplates) Watch(ctx context.Context, 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("clustertemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterTemplate and creates it. Returns the server's representation of the clusterTemplate, and an error, if there is any. +func (c *clusterTemplates) Create(ctx context.Context, clusterTemplate *v3.ClusterTemplate, opts v1.CreateOptions) (result *v3.ClusterTemplate, err error) { + result = &v3.ClusterTemplate{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clustertemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterTemplate and updates it. Returns the server's representation of the clusterTemplate, and an error, if there is any. +func (c *clusterTemplates) Update(ctx context.Context, clusterTemplate *v3.ClusterTemplate, opts v1.UpdateOptions) (result *v3.ClusterTemplate, err error) { + result = &v3.ClusterTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clustertemplates"). + Name(clusterTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterTemplate and deletes it. Returns an error if one occurs. +func (c *clusterTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clustertemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clustertemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterTemplate. +func (c *clusterTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterTemplate, err error) { + result = &v3.ClusterTemplate{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clustertemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustertemplaterevision.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustertemplaterevision.go new file mode 100644 index 00000000..41522af1 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/clustertemplaterevision.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ClusterTemplateRevisionsGetter has a method to return a ClusterTemplateRevisionInterface. +// A group's client should implement this interface. +type ClusterTemplateRevisionsGetter interface { + ClusterTemplateRevisions(namespace string) ClusterTemplateRevisionInterface +} + +// ClusterTemplateRevisionInterface has methods to work with ClusterTemplateRevision resources. +type ClusterTemplateRevisionInterface interface { + Create(ctx context.Context, clusterTemplateRevision *v3.ClusterTemplateRevision, opts v1.CreateOptions) (*v3.ClusterTemplateRevision, error) + Update(ctx context.Context, clusterTemplateRevision *v3.ClusterTemplateRevision, opts v1.UpdateOptions) (*v3.ClusterTemplateRevision, error) + UpdateStatus(ctx context.Context, clusterTemplateRevision *v3.ClusterTemplateRevision, opts v1.UpdateOptions) (*v3.ClusterTemplateRevision, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ClusterTemplateRevision, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ClusterTemplateRevisionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterTemplateRevision, err error) + ClusterTemplateRevisionExpansion +} + +// clusterTemplateRevisions implements ClusterTemplateRevisionInterface +type clusterTemplateRevisions struct { + client rest.Interface + ns string +} + +// newClusterTemplateRevisions returns a ClusterTemplateRevisions +func newClusterTemplateRevisions(c *ManagementV3Client, namespace string) *clusterTemplateRevisions { + return &clusterTemplateRevisions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the clusterTemplateRevision, and returns the corresponding clusterTemplateRevision object, and an error if there is any. +func (c *clusterTemplateRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterTemplateRevision, err error) { + result = &v3.ClusterTemplateRevision{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clustertemplaterevisions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ClusterTemplateRevisions that match those selectors. +func (c *clusterTemplateRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterTemplateRevisionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ClusterTemplateRevisionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("clustertemplaterevisions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested clusterTemplateRevisions. +func (c *clusterTemplateRevisions) Watch(ctx context.Context, 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("clustertemplaterevisions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a clusterTemplateRevision and creates it. Returns the server's representation of the clusterTemplateRevision, and an error, if there is any. +func (c *clusterTemplateRevisions) Create(ctx context.Context, clusterTemplateRevision *v3.ClusterTemplateRevision, opts v1.CreateOptions) (result *v3.ClusterTemplateRevision, err error) { + result = &v3.ClusterTemplateRevision{} + err = c.client.Post(). + Namespace(c.ns). + Resource("clustertemplaterevisions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTemplateRevision). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a clusterTemplateRevision and updates it. Returns the server's representation of the clusterTemplateRevision, and an error, if there is any. +func (c *clusterTemplateRevisions) Update(ctx context.Context, clusterTemplateRevision *v3.ClusterTemplateRevision, opts v1.UpdateOptions) (result *v3.ClusterTemplateRevision, err error) { + result = &v3.ClusterTemplateRevision{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clustertemplaterevisions"). + Name(clusterTemplateRevision.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTemplateRevision). + Do(ctx). + 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 *clusterTemplateRevisions) UpdateStatus(ctx context.Context, clusterTemplateRevision *v3.ClusterTemplateRevision, opts v1.UpdateOptions) (result *v3.ClusterTemplateRevision, err error) { + result = &v3.ClusterTemplateRevision{} + err = c.client.Put(). + Namespace(c.ns). + Resource("clustertemplaterevisions"). + Name(clusterTemplateRevision.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(clusterTemplateRevision). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the clusterTemplateRevision and deletes it. Returns an error if one occurs. +func (c *clusterTemplateRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("clustertemplaterevisions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *clusterTemplateRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("clustertemplaterevisions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched clusterTemplateRevision. +func (c *clusterTemplateRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterTemplateRevision, err error) { + result = &v3.ClusterTemplateRevision{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("clustertemplaterevisions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/composeconfig.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/composeconfig.go new file mode 100644 index 00000000..c6bd9c25 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/composeconfig.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ComposeConfigsGetter has a method to return a ComposeConfigInterface. +// A group's client should implement this interface. +type ComposeConfigsGetter interface { + ComposeConfigs() ComposeConfigInterface +} + +// ComposeConfigInterface has methods to work with ComposeConfig resources. +type ComposeConfigInterface interface { + Create(ctx context.Context, composeConfig *v3.ComposeConfig, opts v1.CreateOptions) (*v3.ComposeConfig, error) + Update(ctx context.Context, composeConfig *v3.ComposeConfig, opts v1.UpdateOptions) (*v3.ComposeConfig, error) + UpdateStatus(ctx context.Context, composeConfig *v3.ComposeConfig, opts v1.UpdateOptions) (*v3.ComposeConfig, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ComposeConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ComposeConfigList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ComposeConfig, err error) + ComposeConfigExpansion +} + +// composeConfigs implements ComposeConfigInterface +type composeConfigs struct { + client rest.Interface +} + +// newComposeConfigs returns a ComposeConfigs +func newComposeConfigs(c *ManagementV3Client) *composeConfigs { + return &composeConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the composeConfig, and returns the corresponding composeConfig object, and an error if there is any. +func (c *composeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ComposeConfig, err error) { + result = &v3.ComposeConfig{} + err = c.client.Get(). + Resource("composeconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ComposeConfigs that match those selectors. +func (c *composeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ComposeConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ComposeConfigList{} + err = c.client.Get(). + Resource("composeconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested composeConfigs. +func (c *composeConfigs) Watch(ctx context.Context, 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(). + Resource("composeconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a composeConfig and creates it. Returns the server's representation of the composeConfig, and an error, if there is any. +func (c *composeConfigs) Create(ctx context.Context, composeConfig *v3.ComposeConfig, opts v1.CreateOptions) (result *v3.ComposeConfig, err error) { + result = &v3.ComposeConfig{} + err = c.client.Post(). + Resource("composeconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(composeConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a composeConfig and updates it. Returns the server's representation of the composeConfig, and an error, if there is any. +func (c *composeConfigs) Update(ctx context.Context, composeConfig *v3.ComposeConfig, opts v1.UpdateOptions) (result *v3.ComposeConfig, err error) { + result = &v3.ComposeConfig{} + err = c.client.Put(). + Resource("composeconfigs"). + Name(composeConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(composeConfig). + Do(ctx). + 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 *composeConfigs) UpdateStatus(ctx context.Context, composeConfig *v3.ComposeConfig, opts v1.UpdateOptions) (result *v3.ComposeConfig, err error) { + result = &v3.ComposeConfig{} + err = c.client.Put(). + Resource("composeconfigs"). + Name(composeConfig.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(composeConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the composeConfig and deletes it. Returns an error if one occurs. +func (c *composeConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("composeconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *composeConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("composeconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched composeConfig. +func (c *composeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ComposeConfig, err error) { + result = &v3.ComposeConfig{} + err = c.client.Patch(pt). + Resource("composeconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/doc.go new file mode 100644 index 00000000..030d01f0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v3 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/dynamicschema.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/dynamicschema.go new file mode 100644 index 00000000..0285a24d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/dynamicschema.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// DynamicSchemasGetter has a method to return a DynamicSchemaInterface. +// A group's client should implement this interface. +type DynamicSchemasGetter interface { + DynamicSchemas() DynamicSchemaInterface +} + +// DynamicSchemaInterface has methods to work with DynamicSchema resources. +type DynamicSchemaInterface interface { + Create(ctx context.Context, dynamicSchema *v3.DynamicSchema, opts v1.CreateOptions) (*v3.DynamicSchema, error) + Update(ctx context.Context, dynamicSchema *v3.DynamicSchema, opts v1.UpdateOptions) (*v3.DynamicSchema, error) + UpdateStatus(ctx context.Context, dynamicSchema *v3.DynamicSchema, opts v1.UpdateOptions) (*v3.DynamicSchema, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.DynamicSchema, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.DynamicSchemaList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.DynamicSchema, err error) + DynamicSchemaExpansion +} + +// dynamicSchemas implements DynamicSchemaInterface +type dynamicSchemas struct { + client rest.Interface +} + +// newDynamicSchemas returns a DynamicSchemas +func newDynamicSchemas(c *ManagementV3Client) *dynamicSchemas { + return &dynamicSchemas{ + client: c.RESTClient(), + } +} + +// Get takes name of the dynamicSchema, and returns the corresponding dynamicSchema object, and an error if there is any. +func (c *dynamicSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.DynamicSchema, err error) { + result = &v3.DynamicSchema{} + err = c.client.Get(). + Resource("dynamicschemas"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of DynamicSchemas that match those selectors. +func (c *dynamicSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v3.DynamicSchemaList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.DynamicSchemaList{} + err = c.client.Get(). + Resource("dynamicschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested dynamicSchemas. +func (c *dynamicSchemas) Watch(ctx context.Context, 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(). + Resource("dynamicschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a dynamicSchema and creates it. Returns the server's representation of the dynamicSchema, and an error, if there is any. +func (c *dynamicSchemas) Create(ctx context.Context, dynamicSchema *v3.DynamicSchema, opts v1.CreateOptions) (result *v3.DynamicSchema, err error) { + result = &v3.DynamicSchema{} + err = c.client.Post(). + Resource("dynamicschemas"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dynamicSchema). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a dynamicSchema and updates it. Returns the server's representation of the dynamicSchema, and an error, if there is any. +func (c *dynamicSchemas) Update(ctx context.Context, dynamicSchema *v3.DynamicSchema, opts v1.UpdateOptions) (result *v3.DynamicSchema, err error) { + result = &v3.DynamicSchema{} + err = c.client.Put(). + Resource("dynamicschemas"). + Name(dynamicSchema.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dynamicSchema). + Do(ctx). + 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 *dynamicSchemas) UpdateStatus(ctx context.Context, dynamicSchema *v3.DynamicSchema, opts v1.UpdateOptions) (result *v3.DynamicSchema, err error) { + result = &v3.DynamicSchema{} + err = c.client.Put(). + Resource("dynamicschemas"). + Name(dynamicSchema.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(dynamicSchema). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the dynamicSchema and deletes it. Returns an error if one occurs. +func (c *dynamicSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("dynamicschemas"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *dynamicSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("dynamicschemas"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched dynamicSchema. +func (c *dynamicSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.DynamicSchema, err error) { + result = &v3.DynamicSchema{} + err = c.client.Patch(pt). + Resource("dynamicschemas"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/etcdbackup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/etcdbackup.go new file mode 100644 index 00000000..867beef1 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/etcdbackup.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// EtcdBackupsGetter has a method to return a EtcdBackupInterface. +// A group's client should implement this interface. +type EtcdBackupsGetter interface { + EtcdBackups(namespace string) EtcdBackupInterface +} + +// EtcdBackupInterface has methods to work with EtcdBackup resources. +type EtcdBackupInterface interface { + Create(ctx context.Context, etcdBackup *v3.EtcdBackup, opts v1.CreateOptions) (*v3.EtcdBackup, error) + Update(ctx context.Context, etcdBackup *v3.EtcdBackup, opts v1.UpdateOptions) (*v3.EtcdBackup, error) + UpdateStatus(ctx context.Context, etcdBackup *v3.EtcdBackup, opts v1.UpdateOptions) (*v3.EtcdBackup, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.EtcdBackup, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.EtcdBackupList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.EtcdBackup, err error) + EtcdBackupExpansion +} + +// etcdBackups implements EtcdBackupInterface +type etcdBackups struct { + client rest.Interface + ns string +} + +// newEtcdBackups returns a EtcdBackups +func newEtcdBackups(c *ManagementV3Client, namespace string) *etcdBackups { + return &etcdBackups{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the etcdBackup, and returns the corresponding etcdBackup object, and an error if there is any. +func (c *etcdBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.EtcdBackup, err error) { + result = &v3.EtcdBackup{} + err = c.client.Get(). + Namespace(c.ns). + Resource("etcdbackups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of EtcdBackups that match those selectors. +func (c *etcdBackups) List(ctx context.Context, opts v1.ListOptions) (result *v3.EtcdBackupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.EtcdBackupList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("etcdbackups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested etcdBackups. +func (c *etcdBackups) Watch(ctx context.Context, 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("etcdbackups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a etcdBackup and creates it. Returns the server's representation of the etcdBackup, and an error, if there is any. +func (c *etcdBackups) Create(ctx context.Context, etcdBackup *v3.EtcdBackup, opts v1.CreateOptions) (result *v3.EtcdBackup, err error) { + result = &v3.EtcdBackup{} + err = c.client.Post(). + Namespace(c.ns). + Resource("etcdbackups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(etcdBackup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a etcdBackup and updates it. Returns the server's representation of the etcdBackup, and an error, if there is any. +func (c *etcdBackups) Update(ctx context.Context, etcdBackup *v3.EtcdBackup, opts v1.UpdateOptions) (result *v3.EtcdBackup, err error) { + result = &v3.EtcdBackup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("etcdbackups"). + Name(etcdBackup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(etcdBackup). + Do(ctx). + 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 *etcdBackups) UpdateStatus(ctx context.Context, etcdBackup *v3.EtcdBackup, opts v1.UpdateOptions) (result *v3.EtcdBackup, err error) { + result = &v3.EtcdBackup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("etcdbackups"). + Name(etcdBackup.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(etcdBackup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the etcdBackup and deletes it. Returns an error if one occurs. +func (c *etcdBackups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("etcdbackups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *etcdBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("etcdbackups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched etcdBackup. +func (c *etcdBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.EtcdBackup, err error) { + result = &v3.EtcdBackup{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("etcdbackups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_activedirectoryprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_activedirectoryprovider.go new file mode 100644 index 00000000..478aea10 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_activedirectoryprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeActiveDirectoryProviders implements ActiveDirectoryProviderInterface +type FakeActiveDirectoryProviders struct { + Fake *FakeManagementV3 +} + +var activedirectoryprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "activedirectoryproviders"} + +var activedirectoryprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ActiveDirectoryProvider"} + +// Get takes name of the activeDirectoryProvider, and returns the corresponding activeDirectoryProvider object, and an error if there is any. +func (c *FakeActiveDirectoryProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ActiveDirectoryProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(activedirectoryprovidersResource, name), &v3.ActiveDirectoryProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.ActiveDirectoryProvider), err +} + +// List takes label and field selectors, and returns the list of ActiveDirectoryProviders that match those selectors. +func (c *FakeActiveDirectoryProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.ActiveDirectoryProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(activedirectoryprovidersResource, activedirectoryprovidersKind, opts), &v3.ActiveDirectoryProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ActiveDirectoryProviderList{ListMeta: obj.(*v3.ActiveDirectoryProviderList).ListMeta} + for _, item := range obj.(*v3.ActiveDirectoryProviderList).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 activeDirectoryProviders. +func (c *FakeActiveDirectoryProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(activedirectoryprovidersResource, opts)) +} + +// Create takes the representation of a activeDirectoryProvider and creates it. Returns the server's representation of the activeDirectoryProvider, and an error, if there is any. +func (c *FakeActiveDirectoryProviders) Create(ctx context.Context, activeDirectoryProvider *v3.ActiveDirectoryProvider, opts v1.CreateOptions) (result *v3.ActiveDirectoryProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(activedirectoryprovidersResource, activeDirectoryProvider), &v3.ActiveDirectoryProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.ActiveDirectoryProvider), err +} + +// Update takes the representation of a activeDirectoryProvider and updates it. Returns the server's representation of the activeDirectoryProvider, and an error, if there is any. +func (c *FakeActiveDirectoryProviders) Update(ctx context.Context, activeDirectoryProvider *v3.ActiveDirectoryProvider, opts v1.UpdateOptions) (result *v3.ActiveDirectoryProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(activedirectoryprovidersResource, activeDirectoryProvider), &v3.ActiveDirectoryProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.ActiveDirectoryProvider), err +} + +// Delete takes name of the activeDirectoryProvider and deletes it. Returns an error if one occurs. +func (c *FakeActiveDirectoryProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(activedirectoryprovidersResource, name, opts), &v3.ActiveDirectoryProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeActiveDirectoryProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(activedirectoryprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ActiveDirectoryProviderList{}) + return err +} + +// Patch applies the patch and returns the patched activeDirectoryProvider. +func (c *FakeActiveDirectoryProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ActiveDirectoryProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(activedirectoryprovidersResource, name, pt, data, subresources...), &v3.ActiveDirectoryProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.ActiveDirectoryProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_apiservice.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_apiservice.go new file mode 100644 index 00000000..58d17af0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_apiservice.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAPIServices implements APIServiceInterface +type FakeAPIServices struct { + Fake *FakeManagementV3 +} + +var apiservicesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "apiservices"} + +var apiservicesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "APIService"} + +// Get takes name of the aPIService, and returns the corresponding aPIService object, and an error if there is any. +func (c *FakeAPIServices) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.APIService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(apiservicesResource, name), &v3.APIService{}) + if obj == nil { + return nil, err + } + return obj.(*v3.APIService), err +} + +// List takes label and field selectors, and returns the list of APIServices that match those selectors. +func (c *FakeAPIServices) List(ctx context.Context, opts v1.ListOptions) (result *v3.APIServiceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(apiservicesResource, apiservicesKind, opts), &v3.APIServiceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.APIServiceList{ListMeta: obj.(*v3.APIServiceList).ListMeta} + for _, item := range obj.(*v3.APIServiceList).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 aPIServices. +func (c *FakeAPIServices) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(apiservicesResource, opts)) +} + +// Create takes the representation of a aPIService and creates it. Returns the server's representation of the aPIService, and an error, if there is any. +func (c *FakeAPIServices) Create(ctx context.Context, aPIService *v3.APIService, opts v1.CreateOptions) (result *v3.APIService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(apiservicesResource, aPIService), &v3.APIService{}) + if obj == nil { + return nil, err + } + return obj.(*v3.APIService), err +} + +// Update takes the representation of a aPIService and updates it. Returns the server's representation of the aPIService, and an error, if there is any. +func (c *FakeAPIServices) Update(ctx context.Context, aPIService *v3.APIService, opts v1.UpdateOptions) (result *v3.APIService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(apiservicesResource, aPIService), &v3.APIService{}) + if obj == nil { + return nil, err + } + return obj.(*v3.APIService), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeAPIServices) UpdateStatus(ctx context.Context, aPIService *v3.APIService, opts v1.UpdateOptions) (*v3.APIService, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(apiservicesResource, "status", aPIService), &v3.APIService{}) + if obj == nil { + return nil, err + } + return obj.(*v3.APIService), err +} + +// Delete takes name of the aPIService and deletes it. Returns an error if one occurs. +func (c *FakeAPIServices) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(apiservicesResource, name, opts), &v3.APIService{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAPIServices) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(apiservicesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.APIServiceList{}) + return err +} + +// Patch applies the patch and returns the patched aPIService. +func (c *FakeAPIServices) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.APIService, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(apiservicesResource, name, pt, data, subresources...), &v3.APIService{}) + if obj == nil { + return nil, err + } + return obj.(*v3.APIService), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_authconfig.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_authconfig.go new file mode 100644 index 00000000..8cfea82d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_authconfig.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAuthConfigs implements AuthConfigInterface +type FakeAuthConfigs struct { + Fake *FakeManagementV3 +} + +var authconfigsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "authconfigs"} + +var authconfigsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "AuthConfig"} + +// Get takes name of the authConfig, and returns the corresponding authConfig object, and an error if there is any. +func (c *FakeAuthConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.AuthConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(authconfigsResource, name), &v3.AuthConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthConfig), err +} + +// List takes label and field selectors, and returns the list of AuthConfigs that match those selectors. +func (c *FakeAuthConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v3.AuthConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(authconfigsResource, authconfigsKind, opts), &v3.AuthConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.AuthConfigList{ListMeta: obj.(*v3.AuthConfigList).ListMeta} + for _, item := range obj.(*v3.AuthConfigList).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 authConfigs. +func (c *FakeAuthConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(authconfigsResource, opts)) +} + +// Create takes the representation of a authConfig and creates it. Returns the server's representation of the authConfig, and an error, if there is any. +func (c *FakeAuthConfigs) Create(ctx context.Context, authConfig *v3.AuthConfig, opts v1.CreateOptions) (result *v3.AuthConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(authconfigsResource, authConfig), &v3.AuthConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthConfig), err +} + +// Update takes the representation of a authConfig and updates it. Returns the server's representation of the authConfig, and an error, if there is any. +func (c *FakeAuthConfigs) Update(ctx context.Context, authConfig *v3.AuthConfig, opts v1.UpdateOptions) (result *v3.AuthConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(authconfigsResource, authConfig), &v3.AuthConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthConfig), err +} + +// Delete takes name of the authConfig and deletes it. Returns an error if one occurs. +func (c *FakeAuthConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(authconfigsResource, name, opts), &v3.AuthConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAuthConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(authconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.AuthConfigList{}) + return err +} + +// Patch applies the patch and returns the patched authConfig. +func (c *FakeAuthConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AuthConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(authconfigsResource, name, pt, data, subresources...), &v3.AuthConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthConfig), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_authprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_authprovider.go new file mode 100644 index 00000000..a406a7f5 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_authprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAuthProviders implements AuthProviderInterface +type FakeAuthProviders struct { + Fake *FakeManagementV3 +} + +var authprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "authproviders"} + +var authprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "AuthProvider"} + +// Get takes name of the authProvider, and returns the corresponding authProvider object, and an error if there is any. +func (c *FakeAuthProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.AuthProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(authprovidersResource, name), &v3.AuthProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthProvider), err +} + +// List takes label and field selectors, and returns the list of AuthProviders that match those selectors. +func (c *FakeAuthProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.AuthProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(authprovidersResource, authprovidersKind, opts), &v3.AuthProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.AuthProviderList{ListMeta: obj.(*v3.AuthProviderList).ListMeta} + for _, item := range obj.(*v3.AuthProviderList).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 authProviders. +func (c *FakeAuthProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(authprovidersResource, opts)) +} + +// Create takes the representation of a authProvider and creates it. Returns the server's representation of the authProvider, and an error, if there is any. +func (c *FakeAuthProviders) Create(ctx context.Context, authProvider *v3.AuthProvider, opts v1.CreateOptions) (result *v3.AuthProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(authprovidersResource, authProvider), &v3.AuthProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthProvider), err +} + +// Update takes the representation of a authProvider and updates it. Returns the server's representation of the authProvider, and an error, if there is any. +func (c *FakeAuthProviders) Update(ctx context.Context, authProvider *v3.AuthProvider, opts v1.UpdateOptions) (result *v3.AuthProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(authprovidersResource, authProvider), &v3.AuthProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthProvider), err +} + +// Delete takes name of the authProvider and deletes it. Returns an error if one occurs. +func (c *FakeAuthProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(authprovidersResource, name, opts), &v3.AuthProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAuthProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(authprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.AuthProviderList{}) + return err +} + +// Patch applies the patch and returns the patched authProvider. +func (c *FakeAuthProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AuthProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(authprovidersResource, name, pt, data, subresources...), &v3.AuthProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_authtoken.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_authtoken.go new file mode 100644 index 00000000..01a4b840 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_authtoken.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAuthTokens implements AuthTokenInterface +type FakeAuthTokens struct { + Fake *FakeManagementV3 +} + +var authtokensResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "authtokens"} + +var authtokensKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "AuthToken"} + +// Get takes name of the authToken, and returns the corresponding authToken object, and an error if there is any. +func (c *FakeAuthTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.AuthToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(authtokensResource, name), &v3.AuthToken{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthToken), err +} + +// List takes label and field selectors, and returns the list of AuthTokens that match those selectors. +func (c *FakeAuthTokens) List(ctx context.Context, opts v1.ListOptions) (result *v3.AuthTokenList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(authtokensResource, authtokensKind, opts), &v3.AuthTokenList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.AuthTokenList{ListMeta: obj.(*v3.AuthTokenList).ListMeta} + for _, item := range obj.(*v3.AuthTokenList).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 authTokens. +func (c *FakeAuthTokens) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(authtokensResource, opts)) +} + +// Create takes the representation of a authToken and creates it. Returns the server's representation of the authToken, and an error, if there is any. +func (c *FakeAuthTokens) Create(ctx context.Context, authToken *v3.AuthToken, opts v1.CreateOptions) (result *v3.AuthToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(authtokensResource, authToken), &v3.AuthToken{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthToken), err +} + +// Update takes the representation of a authToken and updates it. Returns the server's representation of the authToken, and an error, if there is any. +func (c *FakeAuthTokens) Update(ctx context.Context, authToken *v3.AuthToken, opts v1.UpdateOptions) (result *v3.AuthToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(authtokensResource, authToken), &v3.AuthToken{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthToken), err +} + +// Delete takes name of the authToken and deletes it. Returns an error if one occurs. +func (c *FakeAuthTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(authtokensResource, name, opts), &v3.AuthToken{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAuthTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(authtokensResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.AuthTokenList{}) + return err +} + +// Patch applies the patch and returns the patched authToken. +func (c *FakeAuthTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AuthToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(authtokensResource, name, pt, data, subresources...), &v3.AuthToken{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AuthToken), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_azureadprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_azureadprovider.go new file mode 100644 index 00000000..ebb79fd0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_azureadprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAzureADProviders implements AzureADProviderInterface +type FakeAzureADProviders struct { + Fake *FakeManagementV3 +} + +var azureadprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "azureadproviders"} + +var azureadprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "AzureADProvider"} + +// Get takes name of the azureADProvider, and returns the corresponding azureADProvider object, and an error if there is any. +func (c *FakeAzureADProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.AzureADProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(azureadprovidersResource, name), &v3.AzureADProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AzureADProvider), err +} + +// List takes label and field selectors, and returns the list of AzureADProviders that match those selectors. +func (c *FakeAzureADProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.AzureADProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(azureadprovidersResource, azureadprovidersKind, opts), &v3.AzureADProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.AzureADProviderList{ListMeta: obj.(*v3.AzureADProviderList).ListMeta} + for _, item := range obj.(*v3.AzureADProviderList).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 azureADProviders. +func (c *FakeAzureADProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(azureadprovidersResource, opts)) +} + +// Create takes the representation of a azureADProvider and creates it. Returns the server's representation of the azureADProvider, and an error, if there is any. +func (c *FakeAzureADProviders) Create(ctx context.Context, azureADProvider *v3.AzureADProvider, opts v1.CreateOptions) (result *v3.AzureADProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(azureadprovidersResource, azureADProvider), &v3.AzureADProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AzureADProvider), err +} + +// Update takes the representation of a azureADProvider and updates it. Returns the server's representation of the azureADProvider, and an error, if there is any. +func (c *FakeAzureADProviders) Update(ctx context.Context, azureADProvider *v3.AzureADProvider, opts v1.UpdateOptions) (result *v3.AzureADProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(azureadprovidersResource, azureADProvider), &v3.AzureADProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AzureADProvider), err +} + +// Delete takes name of the azureADProvider and deletes it. Returns an error if one occurs. +func (c *FakeAzureADProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(azureadprovidersResource, name, opts), &v3.AzureADProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAzureADProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(azureadprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.AzureADProviderList{}) + return err +} + +// Patch applies the patch and returns the patched azureADProvider. +func (c *FakeAzureADProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.AzureADProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(azureadprovidersResource, name, pt, data, subresources...), &v3.AzureADProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.AzureADProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_catalog.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_catalog.go new file mode 100644 index 00000000..a127e107 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_catalog.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeCatalogs implements CatalogInterface +type FakeCatalogs struct { + Fake *FakeManagementV3 +} + +var catalogsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "catalogs"} + +var catalogsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Catalog"} + +// Get takes name of the catalog, and returns the corresponding catalog object, and an error if there is any. +func (c *FakeCatalogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Catalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(catalogsResource, name), &v3.Catalog{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Catalog), err +} + +// List takes label and field selectors, and returns the list of Catalogs that match those selectors. +func (c *FakeCatalogs) List(ctx context.Context, opts v1.ListOptions) (result *v3.CatalogList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(catalogsResource, catalogsKind, opts), &v3.CatalogList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.CatalogList{ListMeta: obj.(*v3.CatalogList).ListMeta} + for _, item := range obj.(*v3.CatalogList).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 catalogs. +func (c *FakeCatalogs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(catalogsResource, opts)) +} + +// Create takes the representation of a catalog and creates it. Returns the server's representation of the catalog, and an error, if there is any. +func (c *FakeCatalogs) Create(ctx context.Context, catalog *v3.Catalog, opts v1.CreateOptions) (result *v3.Catalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(catalogsResource, catalog), &v3.Catalog{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Catalog), err +} + +// Update takes the representation of a catalog and updates it. Returns the server's representation of the catalog, and an error, if there is any. +func (c *FakeCatalogs) Update(ctx context.Context, catalog *v3.Catalog, opts v1.UpdateOptions) (result *v3.Catalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(catalogsResource, catalog), &v3.Catalog{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Catalog), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeCatalogs) UpdateStatus(ctx context.Context, catalog *v3.Catalog, opts v1.UpdateOptions) (*v3.Catalog, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(catalogsResource, "status", catalog), &v3.Catalog{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Catalog), err +} + +// Delete takes name of the catalog and deletes it. Returns an error if one occurs. +func (c *FakeCatalogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(catalogsResource, name, opts), &v3.Catalog{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCatalogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(catalogsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.CatalogList{}) + return err +} + +// Patch applies the patch and returns the patched catalog. +func (c *FakeCatalogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Catalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(catalogsResource, name, pt, data, subresources...), &v3.Catalog{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Catalog), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_catalogtemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_catalogtemplate.go new file mode 100644 index 00000000..b8b4a39f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_catalogtemplate.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeCatalogTemplates implements CatalogTemplateInterface +type FakeCatalogTemplates struct { + Fake *FakeManagementV3 + ns string +} + +var catalogtemplatesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "catalogtemplates"} + +var catalogtemplatesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "CatalogTemplate"} + +// Get takes name of the catalogTemplate, and returns the corresponding catalogTemplate object, and an error if there is any. +func (c *FakeCatalogTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CatalogTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(catalogtemplatesResource, c.ns, name), &v3.CatalogTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplate), err +} + +// List takes label and field selectors, and returns the list of CatalogTemplates that match those selectors. +func (c *FakeCatalogTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.CatalogTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(catalogtemplatesResource, catalogtemplatesKind, c.ns, opts), &v3.CatalogTemplateList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.CatalogTemplateList{ListMeta: obj.(*v3.CatalogTemplateList).ListMeta} + for _, item := range obj.(*v3.CatalogTemplateList).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 catalogTemplates. +func (c *FakeCatalogTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(catalogtemplatesResource, c.ns, opts)) + +} + +// Create takes the representation of a catalogTemplate and creates it. Returns the server's representation of the catalogTemplate, and an error, if there is any. +func (c *FakeCatalogTemplates) Create(ctx context.Context, catalogTemplate *v3.CatalogTemplate, opts v1.CreateOptions) (result *v3.CatalogTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(catalogtemplatesResource, c.ns, catalogTemplate), &v3.CatalogTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplate), err +} + +// Update takes the representation of a catalogTemplate and updates it. Returns the server's representation of the catalogTemplate, and an error, if there is any. +func (c *FakeCatalogTemplates) Update(ctx context.Context, catalogTemplate *v3.CatalogTemplate, opts v1.UpdateOptions) (result *v3.CatalogTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(catalogtemplatesResource, c.ns, catalogTemplate), &v3.CatalogTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplate), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeCatalogTemplates) UpdateStatus(ctx context.Context, catalogTemplate *v3.CatalogTemplate, opts v1.UpdateOptions) (*v3.CatalogTemplate, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(catalogtemplatesResource, "status", c.ns, catalogTemplate), &v3.CatalogTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplate), err +} + +// Delete takes name of the catalogTemplate and deletes it. Returns an error if one occurs. +func (c *FakeCatalogTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(catalogtemplatesResource, c.ns, name, opts), &v3.CatalogTemplate{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCatalogTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(catalogtemplatesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.CatalogTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched catalogTemplate. +func (c *FakeCatalogTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CatalogTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(catalogtemplatesResource, c.ns, name, pt, data, subresources...), &v3.CatalogTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplate), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_catalogtemplateversion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_catalogtemplateversion.go new file mode 100644 index 00000000..eba0775b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_catalogtemplateversion.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeCatalogTemplateVersions implements CatalogTemplateVersionInterface +type FakeCatalogTemplateVersions struct { + Fake *FakeManagementV3 + ns string +} + +var catalogtemplateversionsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "catalogtemplateversions"} + +var catalogtemplateversionsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "CatalogTemplateVersion"} + +// Get takes name of the catalogTemplateVersion, and returns the corresponding catalogTemplateVersion object, and an error if there is any. +func (c *FakeCatalogTemplateVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CatalogTemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(catalogtemplateversionsResource, c.ns, name), &v3.CatalogTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplateVersion), err +} + +// List takes label and field selectors, and returns the list of CatalogTemplateVersions that match those selectors. +func (c *FakeCatalogTemplateVersions) List(ctx context.Context, opts v1.ListOptions) (result *v3.CatalogTemplateVersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(catalogtemplateversionsResource, catalogtemplateversionsKind, c.ns, opts), &v3.CatalogTemplateVersionList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.CatalogTemplateVersionList{ListMeta: obj.(*v3.CatalogTemplateVersionList).ListMeta} + for _, item := range obj.(*v3.CatalogTemplateVersionList).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 catalogTemplateVersions. +func (c *FakeCatalogTemplateVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(catalogtemplateversionsResource, c.ns, opts)) + +} + +// Create takes the representation of a catalogTemplateVersion and creates it. Returns the server's representation of the catalogTemplateVersion, and an error, if there is any. +func (c *FakeCatalogTemplateVersions) Create(ctx context.Context, catalogTemplateVersion *v3.CatalogTemplateVersion, opts v1.CreateOptions) (result *v3.CatalogTemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(catalogtemplateversionsResource, c.ns, catalogTemplateVersion), &v3.CatalogTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplateVersion), err +} + +// Update takes the representation of a catalogTemplateVersion and updates it. Returns the server's representation of the catalogTemplateVersion, and an error, if there is any. +func (c *FakeCatalogTemplateVersions) Update(ctx context.Context, catalogTemplateVersion *v3.CatalogTemplateVersion, opts v1.UpdateOptions) (result *v3.CatalogTemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(catalogtemplateversionsResource, c.ns, catalogTemplateVersion), &v3.CatalogTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplateVersion), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeCatalogTemplateVersions) UpdateStatus(ctx context.Context, catalogTemplateVersion *v3.CatalogTemplateVersion, opts v1.UpdateOptions) (*v3.CatalogTemplateVersion, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(catalogtemplateversionsResource, "status", c.ns, catalogTemplateVersion), &v3.CatalogTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplateVersion), err +} + +// Delete takes name of the catalogTemplateVersion and deletes it. Returns an error if one occurs. +func (c *FakeCatalogTemplateVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(catalogtemplateversionsResource, c.ns, name, opts), &v3.CatalogTemplateVersion{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCatalogTemplateVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(catalogtemplateversionsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.CatalogTemplateVersionList{}) + return err +} + +// Patch applies the patch and returns the patched catalogTemplateVersion. +func (c *FakeCatalogTemplateVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CatalogTemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(catalogtemplateversionsResource, c.ns, name, pt, data, subresources...), &v3.CatalogTemplateVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CatalogTemplateVersion), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cisbenchmarkversion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cisbenchmarkversion.go new file mode 100644 index 00000000..f1e73c6c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cisbenchmarkversion.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeCisBenchmarkVersions implements CisBenchmarkVersionInterface +type FakeCisBenchmarkVersions struct { + Fake *FakeManagementV3 + ns string +} + +var cisbenchmarkversionsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "cisbenchmarkversions"} + +var cisbenchmarkversionsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "CisBenchmarkVersion"} + +// Get takes name of the cisBenchmarkVersion, and returns the corresponding cisBenchmarkVersion object, and an error if there is any. +func (c *FakeCisBenchmarkVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CisBenchmarkVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(cisbenchmarkversionsResource, c.ns, name), &v3.CisBenchmarkVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CisBenchmarkVersion), err +} + +// List takes label and field selectors, and returns the list of CisBenchmarkVersions that match those selectors. +func (c *FakeCisBenchmarkVersions) List(ctx context.Context, opts v1.ListOptions) (result *v3.CisBenchmarkVersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(cisbenchmarkversionsResource, cisbenchmarkversionsKind, c.ns, opts), &v3.CisBenchmarkVersionList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.CisBenchmarkVersionList{ListMeta: obj.(*v3.CisBenchmarkVersionList).ListMeta} + for _, item := range obj.(*v3.CisBenchmarkVersionList).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 cisBenchmarkVersions. +func (c *FakeCisBenchmarkVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(cisbenchmarkversionsResource, c.ns, opts)) + +} + +// Create takes the representation of a cisBenchmarkVersion and creates it. Returns the server's representation of the cisBenchmarkVersion, and an error, if there is any. +func (c *FakeCisBenchmarkVersions) Create(ctx context.Context, cisBenchmarkVersion *v3.CisBenchmarkVersion, opts v1.CreateOptions) (result *v3.CisBenchmarkVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(cisbenchmarkversionsResource, c.ns, cisBenchmarkVersion), &v3.CisBenchmarkVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CisBenchmarkVersion), err +} + +// Update takes the representation of a cisBenchmarkVersion and updates it. Returns the server's representation of the cisBenchmarkVersion, and an error, if there is any. +func (c *FakeCisBenchmarkVersions) Update(ctx context.Context, cisBenchmarkVersion *v3.CisBenchmarkVersion, opts v1.UpdateOptions) (result *v3.CisBenchmarkVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(cisbenchmarkversionsResource, c.ns, cisBenchmarkVersion), &v3.CisBenchmarkVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CisBenchmarkVersion), err +} + +// Delete takes name of the cisBenchmarkVersion and deletes it. Returns an error if one occurs. +func (c *FakeCisBenchmarkVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(cisbenchmarkversionsResource, c.ns, name, opts), &v3.CisBenchmarkVersion{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCisBenchmarkVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(cisbenchmarkversionsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.CisBenchmarkVersionList{}) + return err +} + +// Patch applies the patch and returns the patched cisBenchmarkVersion. +func (c *FakeCisBenchmarkVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CisBenchmarkVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(cisbenchmarkversionsResource, c.ns, name, pt, data, subresources...), &v3.CisBenchmarkVersion{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CisBenchmarkVersion), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cisconfig.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cisconfig.go new file mode 100644 index 00000000..cc3a0ada --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cisconfig.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeCisConfigs implements CisConfigInterface +type FakeCisConfigs struct { + Fake *FakeManagementV3 + ns string +} + +var cisconfigsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "cisconfigs"} + +var cisconfigsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "CisConfig"} + +// Get takes name of the cisConfig, and returns the corresponding cisConfig object, and an error if there is any. +func (c *FakeCisConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CisConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(cisconfigsResource, c.ns, name), &v3.CisConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CisConfig), err +} + +// List takes label and field selectors, and returns the list of CisConfigs that match those selectors. +func (c *FakeCisConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v3.CisConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(cisconfigsResource, cisconfigsKind, c.ns, opts), &v3.CisConfigList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.CisConfigList{ListMeta: obj.(*v3.CisConfigList).ListMeta} + for _, item := range obj.(*v3.CisConfigList).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 cisConfigs. +func (c *FakeCisConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(cisconfigsResource, c.ns, opts)) + +} + +// Create takes the representation of a cisConfig and creates it. Returns the server's representation of the cisConfig, and an error, if there is any. +func (c *FakeCisConfigs) Create(ctx context.Context, cisConfig *v3.CisConfig, opts v1.CreateOptions) (result *v3.CisConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(cisconfigsResource, c.ns, cisConfig), &v3.CisConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CisConfig), err +} + +// Update takes the representation of a cisConfig and updates it. Returns the server's representation of the cisConfig, and an error, if there is any. +func (c *FakeCisConfigs) Update(ctx context.Context, cisConfig *v3.CisConfig, opts v1.UpdateOptions) (result *v3.CisConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(cisconfigsResource, c.ns, cisConfig), &v3.CisConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CisConfig), err +} + +// Delete takes name of the cisConfig and deletes it. Returns an error if one occurs. +func (c *FakeCisConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(cisconfigsResource, c.ns, name, opts), &v3.CisConfig{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCisConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(cisconfigsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.CisConfigList{}) + return err +} + +// Patch applies the patch and returns the patched cisConfig. +func (c *FakeCisConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CisConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(cisconfigsResource, c.ns, name, pt, data, subresources...), &v3.CisConfig{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CisConfig), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cloudcredential.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cloudcredential.go new file mode 100644 index 00000000..b28b8f0c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cloudcredential.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeCloudCredentials implements CloudCredentialInterface +type FakeCloudCredentials struct { + Fake *FakeManagementV3 + ns string +} + +var cloudcredentialsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "cloudcredentials"} + +var cloudcredentialsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "CloudCredential"} + +// Get takes name of the cloudCredential, and returns the corresponding cloudCredential object, and an error if there is any. +func (c *FakeCloudCredentials) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.CloudCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(cloudcredentialsResource, c.ns, name), &v3.CloudCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CloudCredential), err +} + +// List takes label and field selectors, and returns the list of CloudCredentials that match those selectors. +func (c *FakeCloudCredentials) List(ctx context.Context, opts v1.ListOptions) (result *v3.CloudCredentialList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(cloudcredentialsResource, cloudcredentialsKind, c.ns, opts), &v3.CloudCredentialList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.CloudCredentialList{ListMeta: obj.(*v3.CloudCredentialList).ListMeta} + for _, item := range obj.(*v3.CloudCredentialList).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 cloudCredentials. +func (c *FakeCloudCredentials) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(cloudcredentialsResource, c.ns, opts)) + +} + +// Create takes the representation of a cloudCredential and creates it. Returns the server's representation of the cloudCredential, and an error, if there is any. +func (c *FakeCloudCredentials) Create(ctx context.Context, cloudCredential *v3.CloudCredential, opts v1.CreateOptions) (result *v3.CloudCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(cloudcredentialsResource, c.ns, cloudCredential), &v3.CloudCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CloudCredential), err +} + +// Update takes the representation of a cloudCredential and updates it. Returns the server's representation of the cloudCredential, and an error, if there is any. +func (c *FakeCloudCredentials) Update(ctx context.Context, cloudCredential *v3.CloudCredential, opts v1.UpdateOptions) (result *v3.CloudCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(cloudcredentialsResource, c.ns, cloudCredential), &v3.CloudCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CloudCredential), err +} + +// Delete takes name of the cloudCredential and deletes it. Returns an error if one occurs. +func (c *FakeCloudCredentials) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(cloudcredentialsResource, c.ns, name, opts), &v3.CloudCredential{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeCloudCredentials) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(cloudcredentialsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.CloudCredentialList{}) + return err +} + +// Patch applies the patch and returns the patched cloudCredential. +func (c *FakeCloudCredentials) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.CloudCredential, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(cloudcredentialsResource, c.ns, name, pt, data, subresources...), &v3.CloudCredential{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.CloudCredential), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cluster.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cluster.go new file mode 100644 index 00000000..6afa9324 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_cluster.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusters implements ClusterInterface +type FakeClusters struct { + Fake *FakeManagementV3 +} + +var clustersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clusters"} + +var clustersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Cluster"} + +// Get takes name of the cluster, and returns the corresponding cluster object, and an error if there is any. +func (c *FakeClusters) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(clustersResource, name), &v3.Cluster{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Cluster), err +} + +// List takes label and field selectors, and returns the list of Clusters that match those selectors. +func (c *FakeClusters) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(clustersResource, clustersKind, opts), &v3.ClusterList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterList{ListMeta: obj.(*v3.ClusterList).ListMeta} + for _, item := range obj.(*v3.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(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(clustersResource, opts)) +} + +// 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 *FakeClusters) Create(ctx context.Context, cluster *v3.Cluster, opts v1.CreateOptions) (result *v3.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(clustersResource, cluster), &v3.Cluster{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Cluster), err +} + +// 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 *FakeClusters) Update(ctx context.Context, cluster *v3.Cluster, opts v1.UpdateOptions) (result *v3.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(clustersResource, cluster), &v3.Cluster{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Cluster), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusters) UpdateStatus(ctx context.Context, cluster *v3.Cluster, opts v1.UpdateOptions) (*v3.Cluster, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(clustersResource, "status", cluster), &v3.Cluster{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Cluster), err +} + +// Delete takes name of the cluster and deletes it. Returns an error if one occurs. +func (c *FakeClusters) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(clustersResource, name, opts), &v3.Cluster{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusters) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(clustersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterList{}) + return err +} + +// Patch applies the patch and returns the patched cluster. +func (c *FakeClusters) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Cluster, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(clustersResource, name, pt, data, subresources...), &v3.Cluster{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Cluster), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusteralert.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusteralert.go new file mode 100644 index 00000000..bb5fc23b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusteralert.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterAlerts implements ClusterAlertInterface +type FakeClusterAlerts struct { + Fake *FakeManagementV3 + ns string +} + +var clusteralertsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clusteralerts"} + +var clusteralertsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterAlert"} + +// Get takes name of the clusterAlert, and returns the corresponding clusterAlert object, and an error if there is any. +func (c *FakeClusterAlerts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterAlert, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clusteralertsResource, c.ns, name), &v3.ClusterAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlert), err +} + +// List takes label and field selectors, and returns the list of ClusterAlerts that match those selectors. +func (c *FakeClusterAlerts) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterAlertList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clusteralertsResource, clusteralertsKind, c.ns, opts), &v3.ClusterAlertList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterAlertList{ListMeta: obj.(*v3.ClusterAlertList).ListMeta} + for _, item := range obj.(*v3.ClusterAlertList).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 clusterAlerts. +func (c *FakeClusterAlerts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clusteralertsResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterAlert and creates it. Returns the server's representation of the clusterAlert, and an error, if there is any. +func (c *FakeClusterAlerts) Create(ctx context.Context, clusterAlert *v3.ClusterAlert, opts v1.CreateOptions) (result *v3.ClusterAlert, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clusteralertsResource, c.ns, clusterAlert), &v3.ClusterAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlert), err +} + +// Update takes the representation of a clusterAlert and updates it. Returns the server's representation of the clusterAlert, and an error, if there is any. +func (c *FakeClusterAlerts) Update(ctx context.Context, clusterAlert *v3.ClusterAlert, opts v1.UpdateOptions) (result *v3.ClusterAlert, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clusteralertsResource, c.ns, clusterAlert), &v3.ClusterAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlert), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterAlerts) UpdateStatus(ctx context.Context, clusterAlert *v3.ClusterAlert, opts v1.UpdateOptions) (*v3.ClusterAlert, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(clusteralertsResource, "status", c.ns, clusterAlert), &v3.ClusterAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlert), err +} + +// Delete takes name of the clusterAlert and deletes it. Returns an error if one occurs. +func (c *FakeClusterAlerts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clusteralertsResource, c.ns, name, opts), &v3.ClusterAlert{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterAlerts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clusteralertsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterAlertList{}) + return err +} + +// Patch applies the patch and returns the patched clusterAlert. +func (c *FakeClusterAlerts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterAlert, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clusteralertsResource, c.ns, name, pt, data, subresources...), &v3.ClusterAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlert), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusteralertgroup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusteralertgroup.go new file mode 100644 index 00000000..743712ec --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusteralertgroup.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterAlertGroups implements ClusterAlertGroupInterface +type FakeClusterAlertGroups struct { + Fake *FakeManagementV3 + ns string +} + +var clusteralertgroupsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clusteralertgroups"} + +var clusteralertgroupsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterAlertGroup"} + +// Get takes name of the clusterAlertGroup, and returns the corresponding clusterAlertGroup object, and an error if there is any. +func (c *FakeClusterAlertGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterAlertGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clusteralertgroupsResource, c.ns, name), &v3.ClusterAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertGroup), err +} + +// List takes label and field selectors, and returns the list of ClusterAlertGroups that match those selectors. +func (c *FakeClusterAlertGroups) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterAlertGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clusteralertgroupsResource, clusteralertgroupsKind, c.ns, opts), &v3.ClusterAlertGroupList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterAlertGroupList{ListMeta: obj.(*v3.ClusterAlertGroupList).ListMeta} + for _, item := range obj.(*v3.ClusterAlertGroupList).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 clusterAlertGroups. +func (c *FakeClusterAlertGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clusteralertgroupsResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterAlertGroup and creates it. Returns the server's representation of the clusterAlertGroup, and an error, if there is any. +func (c *FakeClusterAlertGroups) Create(ctx context.Context, clusterAlertGroup *v3.ClusterAlertGroup, opts v1.CreateOptions) (result *v3.ClusterAlertGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clusteralertgroupsResource, c.ns, clusterAlertGroup), &v3.ClusterAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertGroup), err +} + +// Update takes the representation of a clusterAlertGroup and updates it. Returns the server's representation of the clusterAlertGroup, and an error, if there is any. +func (c *FakeClusterAlertGroups) Update(ctx context.Context, clusterAlertGroup *v3.ClusterAlertGroup, opts v1.UpdateOptions) (result *v3.ClusterAlertGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clusteralertgroupsResource, c.ns, clusterAlertGroup), &v3.ClusterAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertGroup), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterAlertGroups) UpdateStatus(ctx context.Context, clusterAlertGroup *v3.ClusterAlertGroup, opts v1.UpdateOptions) (*v3.ClusterAlertGroup, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(clusteralertgroupsResource, "status", c.ns, clusterAlertGroup), &v3.ClusterAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertGroup), err +} + +// Delete takes name of the clusterAlertGroup and deletes it. Returns an error if one occurs. +func (c *FakeClusterAlertGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clusteralertgroupsResource, c.ns, name, opts), &v3.ClusterAlertGroup{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterAlertGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clusteralertgroupsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterAlertGroupList{}) + return err +} + +// Patch applies the patch and returns the patched clusterAlertGroup. +func (c *FakeClusterAlertGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterAlertGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clusteralertgroupsResource, c.ns, name, pt, data, subresources...), &v3.ClusterAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertGroup), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusteralertrule.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusteralertrule.go new file mode 100644 index 00000000..c2aaf00a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusteralertrule.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterAlertRules implements ClusterAlertRuleInterface +type FakeClusterAlertRules struct { + Fake *FakeManagementV3 + ns string +} + +var clusteralertrulesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clusteralertrules"} + +var clusteralertrulesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterAlertRule"} + +// Get takes name of the clusterAlertRule, and returns the corresponding clusterAlertRule object, and an error if there is any. +func (c *FakeClusterAlertRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterAlertRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clusteralertrulesResource, c.ns, name), &v3.ClusterAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertRule), err +} + +// List takes label and field selectors, and returns the list of ClusterAlertRules that match those selectors. +func (c *FakeClusterAlertRules) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterAlertRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clusteralertrulesResource, clusteralertrulesKind, c.ns, opts), &v3.ClusterAlertRuleList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterAlertRuleList{ListMeta: obj.(*v3.ClusterAlertRuleList).ListMeta} + for _, item := range obj.(*v3.ClusterAlertRuleList).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 clusterAlertRules. +func (c *FakeClusterAlertRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clusteralertrulesResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterAlertRule and creates it. Returns the server's representation of the clusterAlertRule, and an error, if there is any. +func (c *FakeClusterAlertRules) Create(ctx context.Context, clusterAlertRule *v3.ClusterAlertRule, opts v1.CreateOptions) (result *v3.ClusterAlertRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clusteralertrulesResource, c.ns, clusterAlertRule), &v3.ClusterAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertRule), err +} + +// Update takes the representation of a clusterAlertRule and updates it. Returns the server's representation of the clusterAlertRule, and an error, if there is any. +func (c *FakeClusterAlertRules) Update(ctx context.Context, clusterAlertRule *v3.ClusterAlertRule, opts v1.UpdateOptions) (result *v3.ClusterAlertRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clusteralertrulesResource, c.ns, clusterAlertRule), &v3.ClusterAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertRule), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterAlertRules) UpdateStatus(ctx context.Context, clusterAlertRule *v3.ClusterAlertRule, opts v1.UpdateOptions) (*v3.ClusterAlertRule, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(clusteralertrulesResource, "status", c.ns, clusterAlertRule), &v3.ClusterAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertRule), err +} + +// Delete takes name of the clusterAlertRule and deletes it. Returns an error if one occurs. +func (c *FakeClusterAlertRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clusteralertrulesResource, c.ns, name, opts), &v3.ClusterAlertRule{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterAlertRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clusteralertrulesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterAlertRuleList{}) + return err +} + +// Patch applies the patch and returns the patched clusterAlertRule. +func (c *FakeClusterAlertRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterAlertRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clusteralertrulesResource, c.ns, name, pt, data, subresources...), &v3.ClusterAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterAlertRule), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustercatalog.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustercatalog.go new file mode 100644 index 00000000..6975572f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustercatalog.go @@ -0,0 +1,118 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterCatalogs implements ClusterCatalogInterface +type FakeClusterCatalogs struct { + Fake *FakeManagementV3 + ns string +} + +var clustercatalogsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clustercatalogs"} + +var clustercatalogsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterCatalog"} + +// Get takes name of the clusterCatalog, and returns the corresponding clusterCatalog object, and an error if there is any. +func (c *FakeClusterCatalogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterCatalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clustercatalogsResource, c.ns, name), &v3.ClusterCatalog{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterCatalog), err +} + +// List takes label and field selectors, and returns the list of ClusterCatalogs that match those selectors. +func (c *FakeClusterCatalogs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterCatalogList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clustercatalogsResource, clustercatalogsKind, c.ns, opts), &v3.ClusterCatalogList{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterCatalogList), err +} + +// Watch returns a watch.Interface that watches the requested clusterCatalogs. +func (c *FakeClusterCatalogs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clustercatalogsResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterCatalog and creates it. Returns the server's representation of the clusterCatalog, and an error, if there is any. +func (c *FakeClusterCatalogs) Create(ctx context.Context, clusterCatalog *v3.ClusterCatalog, opts v1.CreateOptions) (result *v3.ClusterCatalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clustercatalogsResource, c.ns, clusterCatalog), &v3.ClusterCatalog{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterCatalog), err +} + +// Update takes the representation of a clusterCatalog and updates it. Returns the server's representation of the clusterCatalog, and an error, if there is any. +func (c *FakeClusterCatalogs) Update(ctx context.Context, clusterCatalog *v3.ClusterCatalog, opts v1.UpdateOptions) (result *v3.ClusterCatalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clustercatalogsResource, c.ns, clusterCatalog), &v3.ClusterCatalog{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterCatalog), err +} + +// Delete takes name of the clusterCatalog and deletes it. Returns an error if one occurs. +func (c *FakeClusterCatalogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clustercatalogsResource, c.ns, name, opts), &v3.ClusterCatalog{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterCatalogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clustercatalogsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterCatalogList{}) + return err +} + +// Patch applies the patch and returns the patched clusterCatalog. +func (c *FakeClusterCatalogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterCatalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clustercatalogsResource, c.ns, name, pt, data, subresources...), &v3.ClusterCatalog{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterCatalog), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterlogging.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterlogging.go new file mode 100644 index 00000000..ae817442 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterlogging.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterLoggings implements ClusterLoggingInterface +type FakeClusterLoggings struct { + Fake *FakeManagementV3 + ns string +} + +var clusterloggingsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clusterloggings"} + +var clusterloggingsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterLogging"} + +// Get takes name of the clusterLogging, and returns the corresponding clusterLogging object, and an error if there is any. +func (c *FakeClusterLoggings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterLogging, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clusterloggingsResource, c.ns, name), &v3.ClusterLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterLogging), err +} + +// List takes label and field selectors, and returns the list of ClusterLoggings that match those selectors. +func (c *FakeClusterLoggings) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterLoggingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clusterloggingsResource, clusterloggingsKind, c.ns, opts), &v3.ClusterLoggingList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterLoggingList{ListMeta: obj.(*v3.ClusterLoggingList).ListMeta} + for _, item := range obj.(*v3.ClusterLoggingList).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 clusterLoggings. +func (c *FakeClusterLoggings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clusterloggingsResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterLogging and creates it. Returns the server's representation of the clusterLogging, and an error, if there is any. +func (c *FakeClusterLoggings) Create(ctx context.Context, clusterLogging *v3.ClusterLogging, opts v1.CreateOptions) (result *v3.ClusterLogging, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clusterloggingsResource, c.ns, clusterLogging), &v3.ClusterLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterLogging), err +} + +// Update takes the representation of a clusterLogging and updates it. Returns the server's representation of the clusterLogging, and an error, if there is any. +func (c *FakeClusterLoggings) Update(ctx context.Context, clusterLogging *v3.ClusterLogging, opts v1.UpdateOptions) (result *v3.ClusterLogging, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clusterloggingsResource, c.ns, clusterLogging), &v3.ClusterLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterLogging), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterLoggings) UpdateStatus(ctx context.Context, clusterLogging *v3.ClusterLogging, opts v1.UpdateOptions) (*v3.ClusterLogging, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(clusterloggingsResource, "status", c.ns, clusterLogging), &v3.ClusterLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterLogging), err +} + +// Delete takes name of the clusterLogging and deletes it. Returns an error if one occurs. +func (c *FakeClusterLoggings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clusterloggingsResource, c.ns, name, opts), &v3.ClusterLogging{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterLoggings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clusterloggingsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterLoggingList{}) + return err +} + +// Patch applies the patch and returns the patched clusterLogging. +func (c *FakeClusterLoggings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterLogging, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clusterloggingsResource, c.ns, name, pt, data, subresources...), &v3.ClusterLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterLogging), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustermonitorgraph.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustermonitorgraph.go new file mode 100644 index 00000000..d35755f9 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustermonitorgraph.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterMonitorGraphs implements ClusterMonitorGraphInterface +type FakeClusterMonitorGraphs struct { + Fake *FakeManagementV3 + ns string +} + +var clustermonitorgraphsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clustermonitorgraphs"} + +var clustermonitorgraphsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterMonitorGraph"} + +// Get takes name of the clusterMonitorGraph, and returns the corresponding clusterMonitorGraph object, and an error if there is any. +func (c *FakeClusterMonitorGraphs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterMonitorGraph, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clustermonitorgraphsResource, c.ns, name), &v3.ClusterMonitorGraph{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterMonitorGraph), err +} + +// List takes label and field selectors, and returns the list of ClusterMonitorGraphs that match those selectors. +func (c *FakeClusterMonitorGraphs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterMonitorGraphList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clustermonitorgraphsResource, clustermonitorgraphsKind, c.ns, opts), &v3.ClusterMonitorGraphList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterMonitorGraphList{ListMeta: obj.(*v3.ClusterMonitorGraphList).ListMeta} + for _, item := range obj.(*v3.ClusterMonitorGraphList).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 clusterMonitorGraphs. +func (c *FakeClusterMonitorGraphs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clustermonitorgraphsResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterMonitorGraph and creates it. Returns the server's representation of the clusterMonitorGraph, and an error, if there is any. +func (c *FakeClusterMonitorGraphs) Create(ctx context.Context, clusterMonitorGraph *v3.ClusterMonitorGraph, opts v1.CreateOptions) (result *v3.ClusterMonitorGraph, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clustermonitorgraphsResource, c.ns, clusterMonitorGraph), &v3.ClusterMonitorGraph{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterMonitorGraph), err +} + +// Update takes the representation of a clusterMonitorGraph and updates it. Returns the server's representation of the clusterMonitorGraph, and an error, if there is any. +func (c *FakeClusterMonitorGraphs) Update(ctx context.Context, clusterMonitorGraph *v3.ClusterMonitorGraph, opts v1.UpdateOptions) (result *v3.ClusterMonitorGraph, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clustermonitorgraphsResource, c.ns, clusterMonitorGraph), &v3.ClusterMonitorGraph{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterMonitorGraph), err +} + +// Delete takes name of the clusterMonitorGraph and deletes it. Returns an error if one occurs. +func (c *FakeClusterMonitorGraphs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clustermonitorgraphsResource, c.ns, name, opts), &v3.ClusterMonitorGraph{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterMonitorGraphs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clustermonitorgraphsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterMonitorGraphList{}) + return err +} + +// Patch applies the patch and returns the patched clusterMonitorGraph. +func (c *FakeClusterMonitorGraphs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterMonitorGraph, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clustermonitorgraphsResource, c.ns, name, pt, data, subresources...), &v3.ClusterMonitorGraph{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterMonitorGraph), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterregistrationtoken.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterregistrationtoken.go new file mode 100644 index 00000000..d4f13f07 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterregistrationtoken.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterRegistrationTokens implements ClusterRegistrationTokenInterface +type FakeClusterRegistrationTokens struct { + Fake *FakeManagementV3 + ns string +} + +var clusterregistrationtokensResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clusterregistrationtokens"} + +var clusterregistrationtokensKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterRegistrationToken"} + +// Get takes name of the clusterRegistrationToken, and returns the corresponding clusterRegistrationToken object, and an error if there is any. +func (c *FakeClusterRegistrationTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterRegistrationToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clusterregistrationtokensResource, c.ns, name), &v3.ClusterRegistrationToken{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterRegistrationToken), err +} + +// List takes label and field selectors, and returns the list of ClusterRegistrationTokens that match those selectors. +func (c *FakeClusterRegistrationTokens) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterRegistrationTokenList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clusterregistrationtokensResource, clusterregistrationtokensKind, c.ns, opts), &v3.ClusterRegistrationTokenList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterRegistrationTokenList{ListMeta: obj.(*v3.ClusterRegistrationTokenList).ListMeta} + for _, item := range obj.(*v3.ClusterRegistrationTokenList).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 clusterRegistrationTokens. +func (c *FakeClusterRegistrationTokens) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clusterregistrationtokensResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterRegistrationToken and creates it. Returns the server's representation of the clusterRegistrationToken, and an error, if there is any. +func (c *FakeClusterRegistrationTokens) Create(ctx context.Context, clusterRegistrationToken *v3.ClusterRegistrationToken, opts v1.CreateOptions) (result *v3.ClusterRegistrationToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clusterregistrationtokensResource, c.ns, clusterRegistrationToken), &v3.ClusterRegistrationToken{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterRegistrationToken), err +} + +// Update takes the representation of a clusterRegistrationToken and updates it. Returns the server's representation of the clusterRegistrationToken, and an error, if there is any. +func (c *FakeClusterRegistrationTokens) Update(ctx context.Context, clusterRegistrationToken *v3.ClusterRegistrationToken, opts v1.UpdateOptions) (result *v3.ClusterRegistrationToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clusterregistrationtokensResource, c.ns, clusterRegistrationToken), &v3.ClusterRegistrationToken{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterRegistrationToken), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterRegistrationTokens) UpdateStatus(ctx context.Context, clusterRegistrationToken *v3.ClusterRegistrationToken, opts v1.UpdateOptions) (*v3.ClusterRegistrationToken, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(clusterregistrationtokensResource, "status", c.ns, clusterRegistrationToken), &v3.ClusterRegistrationToken{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterRegistrationToken), err +} + +// Delete takes name of the clusterRegistrationToken and deletes it. Returns an error if one occurs. +func (c *FakeClusterRegistrationTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clusterregistrationtokensResource, c.ns, name, opts), &v3.ClusterRegistrationToken{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterRegistrationTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clusterregistrationtokensResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterRegistrationTokenList{}) + return err +} + +// Patch applies the patch and returns the patched clusterRegistrationToken. +func (c *FakeClusterRegistrationTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterRegistrationToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clusterregistrationtokensResource, c.ns, name, pt, data, subresources...), &v3.ClusterRegistrationToken{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterRegistrationToken), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterroletemplatebinding.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterroletemplatebinding.go new file mode 100644 index 00000000..54acb1df --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterroletemplatebinding.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterRoleTemplateBindings implements ClusterRoleTemplateBindingInterface +type FakeClusterRoleTemplateBindings struct { + Fake *FakeManagementV3 + ns string +} + +var clusterroletemplatebindingsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clusterroletemplatebindings"} + +var clusterroletemplatebindingsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterRoleTemplateBinding"} + +// Get takes name of the clusterRoleTemplateBinding, and returns the corresponding clusterRoleTemplateBinding object, and an error if there is any. +func (c *FakeClusterRoleTemplateBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterRoleTemplateBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clusterroletemplatebindingsResource, c.ns, name), &v3.ClusterRoleTemplateBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterRoleTemplateBinding), err +} + +// List takes label and field selectors, and returns the list of ClusterRoleTemplateBindings that match those selectors. +func (c *FakeClusterRoleTemplateBindings) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterRoleTemplateBindingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clusterroletemplatebindingsResource, clusterroletemplatebindingsKind, c.ns, opts), &v3.ClusterRoleTemplateBindingList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterRoleTemplateBindingList{ListMeta: obj.(*v3.ClusterRoleTemplateBindingList).ListMeta} + for _, item := range obj.(*v3.ClusterRoleTemplateBindingList).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 clusterRoleTemplateBindings. +func (c *FakeClusterRoleTemplateBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clusterroletemplatebindingsResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterRoleTemplateBinding and creates it. Returns the server's representation of the clusterRoleTemplateBinding, and an error, if there is any. +func (c *FakeClusterRoleTemplateBindings) Create(ctx context.Context, clusterRoleTemplateBinding *v3.ClusterRoleTemplateBinding, opts v1.CreateOptions) (result *v3.ClusterRoleTemplateBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clusterroletemplatebindingsResource, c.ns, clusterRoleTemplateBinding), &v3.ClusterRoleTemplateBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterRoleTemplateBinding), err +} + +// Update takes the representation of a clusterRoleTemplateBinding and updates it. Returns the server's representation of the clusterRoleTemplateBinding, and an error, if there is any. +func (c *FakeClusterRoleTemplateBindings) Update(ctx context.Context, clusterRoleTemplateBinding *v3.ClusterRoleTemplateBinding, opts v1.UpdateOptions) (result *v3.ClusterRoleTemplateBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clusterroletemplatebindingsResource, c.ns, clusterRoleTemplateBinding), &v3.ClusterRoleTemplateBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterRoleTemplateBinding), err +} + +// Delete takes name of the clusterRoleTemplateBinding and deletes it. Returns an error if one occurs. +func (c *FakeClusterRoleTemplateBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clusterroletemplatebindingsResource, c.ns, name, opts), &v3.ClusterRoleTemplateBinding{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterRoleTemplateBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clusterroletemplatebindingsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterRoleTemplateBindingList{}) + return err +} + +// Patch applies the patch and returns the patched clusterRoleTemplateBinding. +func (c *FakeClusterRoleTemplateBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterRoleTemplateBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clusterroletemplatebindingsResource, c.ns, name, pt, data, subresources...), &v3.ClusterRoleTemplateBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterRoleTemplateBinding), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterscan.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterscan.go new file mode 100644 index 00000000..7c1c4320 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clusterscan.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterScans implements ClusterScanInterface +type FakeClusterScans struct { + Fake *FakeManagementV3 + ns string +} + +var clusterscansResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clusterscans"} + +var clusterscansKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterScan"} + +// Get takes name of the clusterScan, and returns the corresponding clusterScan object, and an error if there is any. +func (c *FakeClusterScans) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterScan, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clusterscansResource, c.ns, name), &v3.ClusterScan{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterScan), err +} + +// List takes label and field selectors, and returns the list of ClusterScans that match those selectors. +func (c *FakeClusterScans) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterScanList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clusterscansResource, clusterscansKind, c.ns, opts), &v3.ClusterScanList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterScanList{ListMeta: obj.(*v3.ClusterScanList).ListMeta} + for _, item := range obj.(*v3.ClusterScanList).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 clusterScans. +func (c *FakeClusterScans) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clusterscansResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterScan and creates it. Returns the server's representation of the clusterScan, and an error, if there is any. +func (c *FakeClusterScans) Create(ctx context.Context, clusterScan *v3.ClusterScan, opts v1.CreateOptions) (result *v3.ClusterScan, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clusterscansResource, c.ns, clusterScan), &v3.ClusterScan{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterScan), err +} + +// Update takes the representation of a clusterScan and updates it. Returns the server's representation of the clusterScan, and an error, if there is any. +func (c *FakeClusterScans) Update(ctx context.Context, clusterScan *v3.ClusterScan, opts v1.UpdateOptions) (result *v3.ClusterScan, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clusterscansResource, c.ns, clusterScan), &v3.ClusterScan{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterScan), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterScans) UpdateStatus(ctx context.Context, clusterScan *v3.ClusterScan, opts v1.UpdateOptions) (*v3.ClusterScan, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(clusterscansResource, "status", c.ns, clusterScan), &v3.ClusterScan{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterScan), err +} + +// Delete takes name of the clusterScan and deletes it. Returns an error if one occurs. +func (c *FakeClusterScans) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clusterscansResource, c.ns, name, opts), &v3.ClusterScan{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterScans) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clusterscansResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterScanList{}) + return err +} + +// Patch applies the patch and returns the patched clusterScan. +func (c *FakeClusterScans) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterScan, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clusterscansResource, c.ns, name, pt, data, subresources...), &v3.ClusterScan{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterScan), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustertemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustertemplate.go new file mode 100644 index 00000000..18d102c3 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustertemplate.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterTemplates implements ClusterTemplateInterface +type FakeClusterTemplates struct { + Fake *FakeManagementV3 + ns string +} + +var clustertemplatesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clustertemplates"} + +var clustertemplatesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterTemplate"} + +// Get takes name of the clusterTemplate, and returns the corresponding clusterTemplate object, and an error if there is any. +func (c *FakeClusterTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clustertemplatesResource, c.ns, name), &v3.ClusterTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterTemplate), err +} + +// List takes label and field selectors, and returns the list of ClusterTemplates that match those selectors. +func (c *FakeClusterTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clustertemplatesResource, clustertemplatesKind, c.ns, opts), &v3.ClusterTemplateList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterTemplateList{ListMeta: obj.(*v3.ClusterTemplateList).ListMeta} + for _, item := range obj.(*v3.ClusterTemplateList).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 clusterTemplates. +func (c *FakeClusterTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clustertemplatesResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterTemplate and creates it. Returns the server's representation of the clusterTemplate, and an error, if there is any. +func (c *FakeClusterTemplates) Create(ctx context.Context, clusterTemplate *v3.ClusterTemplate, opts v1.CreateOptions) (result *v3.ClusterTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clustertemplatesResource, c.ns, clusterTemplate), &v3.ClusterTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterTemplate), err +} + +// Update takes the representation of a clusterTemplate and updates it. Returns the server's representation of the clusterTemplate, and an error, if there is any. +func (c *FakeClusterTemplates) Update(ctx context.Context, clusterTemplate *v3.ClusterTemplate, opts v1.UpdateOptions) (result *v3.ClusterTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clustertemplatesResource, c.ns, clusterTemplate), &v3.ClusterTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterTemplate), err +} + +// Delete takes name of the clusterTemplate and deletes it. Returns an error if one occurs. +func (c *FakeClusterTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clustertemplatesResource, c.ns, name, opts), &v3.ClusterTemplate{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clustertemplatesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched clusterTemplate. +func (c *FakeClusterTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clustertemplatesResource, c.ns, name, pt, data, subresources...), &v3.ClusterTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterTemplate), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustertemplaterevision.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustertemplaterevision.go new file mode 100644 index 00000000..ed1e66f3 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_clustertemplaterevision.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeClusterTemplateRevisions implements ClusterTemplateRevisionInterface +type FakeClusterTemplateRevisions struct { + Fake *FakeManagementV3 + ns string +} + +var clustertemplaterevisionsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "clustertemplaterevisions"} + +var clustertemplaterevisionsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ClusterTemplateRevision"} + +// Get takes name of the clusterTemplateRevision, and returns the corresponding clusterTemplateRevision object, and an error if there is any. +func (c *FakeClusterTemplateRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ClusterTemplateRevision, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(clustertemplaterevisionsResource, c.ns, name), &v3.ClusterTemplateRevision{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterTemplateRevision), err +} + +// List takes label and field selectors, and returns the list of ClusterTemplateRevisions that match those selectors. +func (c *FakeClusterTemplateRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v3.ClusterTemplateRevisionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(clustertemplaterevisionsResource, clustertemplaterevisionsKind, c.ns, opts), &v3.ClusterTemplateRevisionList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ClusterTemplateRevisionList{ListMeta: obj.(*v3.ClusterTemplateRevisionList).ListMeta} + for _, item := range obj.(*v3.ClusterTemplateRevisionList).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 clusterTemplateRevisions. +func (c *FakeClusterTemplateRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(clustertemplaterevisionsResource, c.ns, opts)) + +} + +// Create takes the representation of a clusterTemplateRevision and creates it. Returns the server's representation of the clusterTemplateRevision, and an error, if there is any. +func (c *FakeClusterTemplateRevisions) Create(ctx context.Context, clusterTemplateRevision *v3.ClusterTemplateRevision, opts v1.CreateOptions) (result *v3.ClusterTemplateRevision, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(clustertemplaterevisionsResource, c.ns, clusterTemplateRevision), &v3.ClusterTemplateRevision{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterTemplateRevision), err +} + +// Update takes the representation of a clusterTemplateRevision and updates it. Returns the server's representation of the clusterTemplateRevision, and an error, if there is any. +func (c *FakeClusterTemplateRevisions) Update(ctx context.Context, clusterTemplateRevision *v3.ClusterTemplateRevision, opts v1.UpdateOptions) (result *v3.ClusterTemplateRevision, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(clustertemplaterevisionsResource, c.ns, clusterTemplateRevision), &v3.ClusterTemplateRevision{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterTemplateRevision), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeClusterTemplateRevisions) UpdateStatus(ctx context.Context, clusterTemplateRevision *v3.ClusterTemplateRevision, opts v1.UpdateOptions) (*v3.ClusterTemplateRevision, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(clustertemplaterevisionsResource, "status", c.ns, clusterTemplateRevision), &v3.ClusterTemplateRevision{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterTemplateRevision), err +} + +// Delete takes name of the clusterTemplateRevision and deletes it. Returns an error if one occurs. +func (c *FakeClusterTemplateRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(clustertemplaterevisionsResource, c.ns, name, opts), &v3.ClusterTemplateRevision{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeClusterTemplateRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(clustertemplaterevisionsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ClusterTemplateRevisionList{}) + return err +} + +// Patch applies the patch and returns the patched clusterTemplateRevision. +func (c *FakeClusterTemplateRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ClusterTemplateRevision, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(clustertemplaterevisionsResource, c.ns, name, pt, data, subresources...), &v3.ClusterTemplateRevision{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ClusterTemplateRevision), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_composeconfig.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_composeconfig.go new file mode 100644 index 00000000..574c3997 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_composeconfig.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeComposeConfigs implements ComposeConfigInterface +type FakeComposeConfigs struct { + Fake *FakeManagementV3 +} + +var composeconfigsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "composeconfigs"} + +var composeconfigsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ComposeConfig"} + +// Get takes name of the composeConfig, and returns the corresponding composeConfig object, and an error if there is any. +func (c *FakeComposeConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ComposeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(composeconfigsResource, name), &v3.ComposeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.ComposeConfig), err +} + +// List takes label and field selectors, and returns the list of ComposeConfigs that match those selectors. +func (c *FakeComposeConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ComposeConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(composeconfigsResource, composeconfigsKind, opts), &v3.ComposeConfigList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ComposeConfigList{ListMeta: obj.(*v3.ComposeConfigList).ListMeta} + for _, item := range obj.(*v3.ComposeConfigList).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 composeConfigs. +func (c *FakeComposeConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(composeconfigsResource, opts)) +} + +// Create takes the representation of a composeConfig and creates it. Returns the server's representation of the composeConfig, and an error, if there is any. +func (c *FakeComposeConfigs) Create(ctx context.Context, composeConfig *v3.ComposeConfig, opts v1.CreateOptions) (result *v3.ComposeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(composeconfigsResource, composeConfig), &v3.ComposeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.ComposeConfig), err +} + +// Update takes the representation of a composeConfig and updates it. Returns the server's representation of the composeConfig, and an error, if there is any. +func (c *FakeComposeConfigs) Update(ctx context.Context, composeConfig *v3.ComposeConfig, opts v1.UpdateOptions) (result *v3.ComposeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(composeconfigsResource, composeConfig), &v3.ComposeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.ComposeConfig), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeComposeConfigs) UpdateStatus(ctx context.Context, composeConfig *v3.ComposeConfig, opts v1.UpdateOptions) (*v3.ComposeConfig, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(composeconfigsResource, "status", composeConfig), &v3.ComposeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.ComposeConfig), err +} + +// Delete takes name of the composeConfig and deletes it. Returns an error if one occurs. +func (c *FakeComposeConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(composeconfigsResource, name, opts), &v3.ComposeConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeComposeConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(composeconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ComposeConfigList{}) + return err +} + +// Patch applies the patch and returns the patched composeConfig. +func (c *FakeComposeConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ComposeConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(composeconfigsResource, name, pt, data, subresources...), &v3.ComposeConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.ComposeConfig), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_dynamicschema.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_dynamicschema.go new file mode 100644 index 00000000..1653103c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_dynamicschema.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeDynamicSchemas implements DynamicSchemaInterface +type FakeDynamicSchemas struct { + Fake *FakeManagementV3 +} + +var dynamicschemasResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "dynamicschemas"} + +var dynamicschemasKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "DynamicSchema"} + +// Get takes name of the dynamicSchema, and returns the corresponding dynamicSchema object, and an error if there is any. +func (c *FakeDynamicSchemas) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.DynamicSchema, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(dynamicschemasResource, name), &v3.DynamicSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v3.DynamicSchema), err +} + +// List takes label and field selectors, and returns the list of DynamicSchemas that match those selectors. +func (c *FakeDynamicSchemas) List(ctx context.Context, opts v1.ListOptions) (result *v3.DynamicSchemaList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(dynamicschemasResource, dynamicschemasKind, opts), &v3.DynamicSchemaList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.DynamicSchemaList{ListMeta: obj.(*v3.DynamicSchemaList).ListMeta} + for _, item := range obj.(*v3.DynamicSchemaList).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 dynamicSchemas. +func (c *FakeDynamicSchemas) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(dynamicschemasResource, opts)) +} + +// Create takes the representation of a dynamicSchema and creates it. Returns the server's representation of the dynamicSchema, and an error, if there is any. +func (c *FakeDynamicSchemas) Create(ctx context.Context, dynamicSchema *v3.DynamicSchema, opts v1.CreateOptions) (result *v3.DynamicSchema, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(dynamicschemasResource, dynamicSchema), &v3.DynamicSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v3.DynamicSchema), err +} + +// Update takes the representation of a dynamicSchema and updates it. Returns the server's representation of the dynamicSchema, and an error, if there is any. +func (c *FakeDynamicSchemas) Update(ctx context.Context, dynamicSchema *v3.DynamicSchema, opts v1.UpdateOptions) (result *v3.DynamicSchema, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(dynamicschemasResource, dynamicSchema), &v3.DynamicSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v3.DynamicSchema), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeDynamicSchemas) UpdateStatus(ctx context.Context, dynamicSchema *v3.DynamicSchema, opts v1.UpdateOptions) (*v3.DynamicSchema, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(dynamicschemasResource, "status", dynamicSchema), &v3.DynamicSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v3.DynamicSchema), err +} + +// Delete takes name of the dynamicSchema and deletes it. Returns an error if one occurs. +func (c *FakeDynamicSchemas) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(dynamicschemasResource, name, opts), &v3.DynamicSchema{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeDynamicSchemas) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(dynamicschemasResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.DynamicSchemaList{}) + return err +} + +// Patch applies the patch and returns the patched dynamicSchema. +func (c *FakeDynamicSchemas) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.DynamicSchema, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(dynamicschemasResource, name, pt, data, subresources...), &v3.DynamicSchema{}) + if obj == nil { + return nil, err + } + return obj.(*v3.DynamicSchema), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_etcdbackup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_etcdbackup.go new file mode 100644 index 00000000..4a6d3533 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_etcdbackup.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeEtcdBackups implements EtcdBackupInterface +type FakeEtcdBackups struct { + Fake *FakeManagementV3 + ns string +} + +var etcdbackupsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "etcdbackups"} + +var etcdbackupsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "EtcdBackup"} + +// Get takes name of the etcdBackup, and returns the corresponding etcdBackup object, and an error if there is any. +func (c *FakeEtcdBackups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.EtcdBackup, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(etcdbackupsResource, c.ns, name), &v3.EtcdBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.EtcdBackup), err +} + +// List takes label and field selectors, and returns the list of EtcdBackups that match those selectors. +func (c *FakeEtcdBackups) List(ctx context.Context, opts v1.ListOptions) (result *v3.EtcdBackupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(etcdbackupsResource, etcdbackupsKind, c.ns, opts), &v3.EtcdBackupList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.EtcdBackupList{ListMeta: obj.(*v3.EtcdBackupList).ListMeta} + for _, item := range obj.(*v3.EtcdBackupList).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 etcdBackups. +func (c *FakeEtcdBackups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(etcdbackupsResource, c.ns, opts)) + +} + +// Create takes the representation of a etcdBackup and creates it. Returns the server's representation of the etcdBackup, and an error, if there is any. +func (c *FakeEtcdBackups) Create(ctx context.Context, etcdBackup *v3.EtcdBackup, opts v1.CreateOptions) (result *v3.EtcdBackup, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(etcdbackupsResource, c.ns, etcdBackup), &v3.EtcdBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.EtcdBackup), err +} + +// Update takes the representation of a etcdBackup and updates it. Returns the server's representation of the etcdBackup, and an error, if there is any. +func (c *FakeEtcdBackups) Update(ctx context.Context, etcdBackup *v3.EtcdBackup, opts v1.UpdateOptions) (result *v3.EtcdBackup, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(etcdbackupsResource, c.ns, etcdBackup), &v3.EtcdBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.EtcdBackup), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeEtcdBackups) UpdateStatus(ctx context.Context, etcdBackup *v3.EtcdBackup, opts v1.UpdateOptions) (*v3.EtcdBackup, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(etcdbackupsResource, "status", c.ns, etcdBackup), &v3.EtcdBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.EtcdBackup), err +} + +// Delete takes name of the etcdBackup and deletes it. Returns an error if one occurs. +func (c *FakeEtcdBackups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(etcdbackupsResource, c.ns, name, opts), &v3.EtcdBackup{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeEtcdBackups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(etcdbackupsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.EtcdBackupList{}) + return err +} + +// Patch applies the patch and returns the patched etcdBackup. +func (c *FakeEtcdBackups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.EtcdBackup, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(etcdbackupsResource, c.ns, name, pt, data, subresources...), &v3.EtcdBackup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.EtcdBackup), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_feature.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_feature.go new file mode 100644 index 00000000..0b18d1b2 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_feature.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeFeatures implements FeatureInterface +type FakeFeatures struct { + Fake *FakeManagementV3 +} + +var featuresResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "features"} + +var featuresKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Feature"} + +// Get takes name of the feature, and returns the corresponding feature object, and an error if there is any. +func (c *FakeFeatures) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Feature, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(featuresResource, name), &v3.Feature{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Feature), err +} + +// List takes label and field selectors, and returns the list of Features that match those selectors. +func (c *FakeFeatures) List(ctx context.Context, opts v1.ListOptions) (result *v3.FeatureList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(featuresResource, featuresKind, opts), &v3.FeatureList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.FeatureList{ListMeta: obj.(*v3.FeatureList).ListMeta} + for _, item := range obj.(*v3.FeatureList).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 features. +func (c *FakeFeatures) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(featuresResource, opts)) +} + +// Create takes the representation of a feature and creates it. Returns the server's representation of the feature, and an error, if there is any. +func (c *FakeFeatures) Create(ctx context.Context, feature *v3.Feature, opts v1.CreateOptions) (result *v3.Feature, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(featuresResource, feature), &v3.Feature{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Feature), err +} + +// Update takes the representation of a feature and updates it. Returns the server's representation of the feature, and an error, if there is any. +func (c *FakeFeatures) Update(ctx context.Context, feature *v3.Feature, opts v1.UpdateOptions) (result *v3.Feature, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(featuresResource, feature), &v3.Feature{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Feature), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeFeatures) UpdateStatus(ctx context.Context, feature *v3.Feature, opts v1.UpdateOptions) (*v3.Feature, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(featuresResource, "status", feature), &v3.Feature{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Feature), err +} + +// Delete takes name of the feature and deletes it. Returns an error if one occurs. +func (c *FakeFeatures) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(featuresResource, name, opts), &v3.Feature{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeFeatures) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(featuresResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.FeatureList{}) + return err +} + +// Patch applies the patch and returns the patched feature. +func (c *FakeFeatures) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Feature, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(featuresResource, name, pt, data, subresources...), &v3.Feature{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Feature), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_fleetworkspace.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_fleetworkspace.go new file mode 100644 index 00000000..b07608f8 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_fleetworkspace.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeFleetWorkspaces implements FleetWorkspaceInterface +type FakeFleetWorkspaces struct { + Fake *FakeManagementV3 +} + +var fleetworkspacesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "fleetworkspaces"} + +var fleetworkspacesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "FleetWorkspace"} + +// Get takes name of the fleetWorkspace, and returns the corresponding fleetWorkspace object, and an error if there is any. +func (c *FakeFleetWorkspaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.FleetWorkspace, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(fleetworkspacesResource, name), &v3.FleetWorkspace{}) + if obj == nil { + return nil, err + } + return obj.(*v3.FleetWorkspace), err +} + +// List takes label and field selectors, and returns the list of FleetWorkspaces that match those selectors. +func (c *FakeFleetWorkspaces) List(ctx context.Context, opts v1.ListOptions) (result *v3.FleetWorkspaceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(fleetworkspacesResource, fleetworkspacesKind, opts), &v3.FleetWorkspaceList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.FleetWorkspaceList{ListMeta: obj.(*v3.FleetWorkspaceList).ListMeta} + for _, item := range obj.(*v3.FleetWorkspaceList).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 fleetWorkspaces. +func (c *FakeFleetWorkspaces) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(fleetworkspacesResource, opts)) +} + +// Create takes the representation of a fleetWorkspace and creates it. Returns the server's representation of the fleetWorkspace, and an error, if there is any. +func (c *FakeFleetWorkspaces) Create(ctx context.Context, fleetWorkspace *v3.FleetWorkspace, opts v1.CreateOptions) (result *v3.FleetWorkspace, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(fleetworkspacesResource, fleetWorkspace), &v3.FleetWorkspace{}) + if obj == nil { + return nil, err + } + return obj.(*v3.FleetWorkspace), err +} + +// Update takes the representation of a fleetWorkspace and updates it. Returns the server's representation of the fleetWorkspace, and an error, if there is any. +func (c *FakeFleetWorkspaces) Update(ctx context.Context, fleetWorkspace *v3.FleetWorkspace, opts v1.UpdateOptions) (result *v3.FleetWorkspace, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(fleetworkspacesResource, fleetWorkspace), &v3.FleetWorkspace{}) + if obj == nil { + return nil, err + } + return obj.(*v3.FleetWorkspace), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeFleetWorkspaces) UpdateStatus(ctx context.Context, fleetWorkspace *v3.FleetWorkspace, opts v1.UpdateOptions) (*v3.FleetWorkspace, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(fleetworkspacesResource, "status", fleetWorkspace), &v3.FleetWorkspace{}) + if obj == nil { + return nil, err + } + return obj.(*v3.FleetWorkspace), err +} + +// Delete takes name of the fleetWorkspace and deletes it. Returns an error if one occurs. +func (c *FakeFleetWorkspaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(fleetworkspacesResource, name, opts), &v3.FleetWorkspace{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeFleetWorkspaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(fleetworkspacesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.FleetWorkspaceList{}) + return err +} + +// Patch applies the patch and returns the patched fleetWorkspace. +func (c *FakeFleetWorkspaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.FleetWorkspace, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(fleetworkspacesResource, name, pt, data, subresources...), &v3.FleetWorkspace{}) + if obj == nil { + return nil, err + } + return obj.(*v3.FleetWorkspace), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_freeipaprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_freeipaprovider.go new file mode 100644 index 00000000..a02ce945 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_freeipaprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeFreeIpaProviders implements FreeIpaProviderInterface +type FakeFreeIpaProviders struct { + Fake *FakeManagementV3 +} + +var freeipaprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "freeipaproviders"} + +var freeipaprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "FreeIpaProvider"} + +// Get takes name of the freeIpaProvider, and returns the corresponding freeIpaProvider object, and an error if there is any. +func (c *FakeFreeIpaProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.FreeIpaProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(freeipaprovidersResource, name), &v3.FreeIpaProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.FreeIpaProvider), err +} + +// List takes label and field selectors, and returns the list of FreeIpaProviders that match those selectors. +func (c *FakeFreeIpaProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.FreeIpaProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(freeipaprovidersResource, freeipaprovidersKind, opts), &v3.FreeIpaProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.FreeIpaProviderList{ListMeta: obj.(*v3.FreeIpaProviderList).ListMeta} + for _, item := range obj.(*v3.FreeIpaProviderList).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 freeIpaProviders. +func (c *FakeFreeIpaProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(freeipaprovidersResource, opts)) +} + +// Create takes the representation of a freeIpaProvider and creates it. Returns the server's representation of the freeIpaProvider, and an error, if there is any. +func (c *FakeFreeIpaProviders) Create(ctx context.Context, freeIpaProvider *v3.FreeIpaProvider, opts v1.CreateOptions) (result *v3.FreeIpaProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(freeipaprovidersResource, freeIpaProvider), &v3.FreeIpaProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.FreeIpaProvider), err +} + +// Update takes the representation of a freeIpaProvider and updates it. Returns the server's representation of the freeIpaProvider, and an error, if there is any. +func (c *FakeFreeIpaProviders) Update(ctx context.Context, freeIpaProvider *v3.FreeIpaProvider, opts v1.UpdateOptions) (result *v3.FreeIpaProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(freeipaprovidersResource, freeIpaProvider), &v3.FreeIpaProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.FreeIpaProvider), err +} + +// Delete takes name of the freeIpaProvider and deletes it. Returns an error if one occurs. +func (c *FakeFreeIpaProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(freeipaprovidersResource, name, opts), &v3.FreeIpaProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeFreeIpaProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(freeipaprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.FreeIpaProviderList{}) + return err +} + +// Patch applies the patch and returns the patched freeIpaProvider. +func (c *FakeFreeIpaProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.FreeIpaProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(freeipaprovidersResource, name, pt, data, subresources...), &v3.FreeIpaProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.FreeIpaProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_githubconfig.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_githubconfig.go new file mode 100644 index 00000000..a366050c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_githubconfig.go @@ -0,0 +1,110 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGithubConfigs implements GithubConfigInterface +type FakeGithubConfigs struct { + Fake *FakeManagementV3 +} + +var githubconfigsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "githubconfigs"} + +var githubconfigsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "GithubConfig"} + +// Get takes name of the githubConfig, and returns the corresponding githubConfig object, and an error if there is any. +func (c *FakeGithubConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GithubConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(githubconfigsResource, name), &v3.GithubConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GithubConfig), err +} + +// List takes label and field selectors, and returns the list of GithubConfigs that match those selectors. +func (c *FakeGithubConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v3.GithubConfigList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(githubconfigsResource, githubconfigsKind, opts), &v3.GithubConfigList{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GithubConfigList), err +} + +// Watch returns a watch.Interface that watches the requested githubConfigs. +func (c *FakeGithubConfigs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(githubconfigsResource, opts)) +} + +// Create takes the representation of a githubConfig and creates it. Returns the server's representation of the githubConfig, and an error, if there is any. +func (c *FakeGithubConfigs) Create(ctx context.Context, githubConfig *v3.GithubConfig, opts v1.CreateOptions) (result *v3.GithubConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(githubconfigsResource, githubConfig), &v3.GithubConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GithubConfig), err +} + +// Update takes the representation of a githubConfig and updates it. Returns the server's representation of the githubConfig, and an error, if there is any. +func (c *FakeGithubConfigs) Update(ctx context.Context, githubConfig *v3.GithubConfig, opts v1.UpdateOptions) (result *v3.GithubConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(githubconfigsResource, githubConfig), &v3.GithubConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GithubConfig), err +} + +// Delete takes name of the githubConfig and deletes it. Returns an error if one occurs. +func (c *FakeGithubConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(githubconfigsResource, name, opts), &v3.GithubConfig{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGithubConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(githubconfigsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.GithubConfigList{}) + return err +} + +// Patch applies the patch and returns the patched githubConfig. +func (c *FakeGithubConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GithubConfig, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(githubconfigsResource, name, pt, data, subresources...), &v3.GithubConfig{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GithubConfig), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_githubprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_githubprovider.go new file mode 100644 index 00000000..6b8a1888 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_githubprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGithubProviders implements GithubProviderInterface +type FakeGithubProviders struct { + Fake *FakeManagementV3 +} + +var githubprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "githubproviders"} + +var githubprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "GithubProvider"} + +// Get takes name of the githubProvider, and returns the corresponding githubProvider object, and an error if there is any. +func (c *FakeGithubProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GithubProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(githubprovidersResource, name), &v3.GithubProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GithubProvider), err +} + +// List takes label and field selectors, and returns the list of GithubProviders that match those selectors. +func (c *FakeGithubProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.GithubProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(githubprovidersResource, githubprovidersKind, opts), &v3.GithubProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.GithubProviderList{ListMeta: obj.(*v3.GithubProviderList).ListMeta} + for _, item := range obj.(*v3.GithubProviderList).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 githubProviders. +func (c *FakeGithubProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(githubprovidersResource, opts)) +} + +// Create takes the representation of a githubProvider and creates it. Returns the server's representation of the githubProvider, and an error, if there is any. +func (c *FakeGithubProviders) Create(ctx context.Context, githubProvider *v3.GithubProvider, opts v1.CreateOptions) (result *v3.GithubProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(githubprovidersResource, githubProvider), &v3.GithubProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GithubProvider), err +} + +// Update takes the representation of a githubProvider and updates it. Returns the server's representation of the githubProvider, and an error, if there is any. +func (c *FakeGithubProviders) Update(ctx context.Context, githubProvider *v3.GithubProvider, opts v1.UpdateOptions) (result *v3.GithubProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(githubprovidersResource, githubProvider), &v3.GithubProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GithubProvider), err +} + +// Delete takes name of the githubProvider and deletes it. Returns an error if one occurs. +func (c *FakeGithubProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(githubprovidersResource, name, opts), &v3.GithubProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGithubProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(githubprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.GithubProviderList{}) + return err +} + +// Patch applies the patch and returns the patched githubProvider. +func (c *FakeGithubProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GithubProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(githubprovidersResource, name, pt, data, subresources...), &v3.GithubProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GithubProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globaldns.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globaldns.go new file mode 100644 index 00000000..afdc86fe --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globaldns.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGlobalDnses implements GlobalDnsInterface +type FakeGlobalDnses struct { + Fake *FakeManagementV3 + ns string +} + +var globaldnsesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "globaldnses"} + +var globaldnsesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "GlobalDns"} + +// Get takes name of the globalDns, and returns the corresponding globalDns object, and an error if there is any. +func (c *FakeGlobalDnses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GlobalDns, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(globaldnsesResource, c.ns, name), &v3.GlobalDns{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalDns), err +} + +// List takes label and field selectors, and returns the list of GlobalDnses that match those selectors. +func (c *FakeGlobalDnses) List(ctx context.Context, opts v1.ListOptions) (result *v3.GlobalDnsList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(globaldnsesResource, globaldnsesKind, c.ns, opts), &v3.GlobalDnsList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.GlobalDnsList{ListMeta: obj.(*v3.GlobalDnsList).ListMeta} + for _, item := range obj.(*v3.GlobalDnsList).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 globalDnses. +func (c *FakeGlobalDnses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(globaldnsesResource, c.ns, opts)) + +} + +// Create takes the representation of a globalDns and creates it. Returns the server's representation of the globalDns, and an error, if there is any. +func (c *FakeGlobalDnses) Create(ctx context.Context, globalDns *v3.GlobalDns, opts v1.CreateOptions) (result *v3.GlobalDns, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(globaldnsesResource, c.ns, globalDns), &v3.GlobalDns{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalDns), err +} + +// Update takes the representation of a globalDns and updates it. Returns the server's representation of the globalDns, and an error, if there is any. +func (c *FakeGlobalDnses) Update(ctx context.Context, globalDns *v3.GlobalDns, opts v1.UpdateOptions) (result *v3.GlobalDns, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(globaldnsesResource, c.ns, globalDns), &v3.GlobalDns{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalDns), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeGlobalDnses) UpdateStatus(ctx context.Context, globalDns *v3.GlobalDns, opts v1.UpdateOptions) (*v3.GlobalDns, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(globaldnsesResource, "status", c.ns, globalDns), &v3.GlobalDns{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalDns), err +} + +// Delete takes name of the globalDns and deletes it. Returns an error if one occurs. +func (c *FakeGlobalDnses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(globaldnsesResource, c.ns, name, opts), &v3.GlobalDns{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGlobalDnses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(globaldnsesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.GlobalDnsList{}) + return err +} + +// Patch applies the patch and returns the patched globalDns. +func (c *FakeGlobalDnses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalDns, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(globaldnsesResource, c.ns, name, pt, data, subresources...), &v3.GlobalDns{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalDns), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globaldnsprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globaldnsprovider.go new file mode 100644 index 00000000..0e25868c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globaldnsprovider.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGlobalDnsProviders implements GlobalDnsProviderInterface +type FakeGlobalDnsProviders struct { + Fake *FakeManagementV3 + ns string +} + +var globaldnsprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "globaldnsproviders"} + +var globaldnsprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "GlobalDnsProvider"} + +// Get takes name of the globalDnsProvider, and returns the corresponding globalDnsProvider object, and an error if there is any. +func (c *FakeGlobalDnsProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GlobalDnsProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(globaldnsprovidersResource, c.ns, name), &v3.GlobalDnsProvider{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalDnsProvider), err +} + +// List takes label and field selectors, and returns the list of GlobalDnsProviders that match those selectors. +func (c *FakeGlobalDnsProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.GlobalDnsProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(globaldnsprovidersResource, globaldnsprovidersKind, c.ns, opts), &v3.GlobalDnsProviderList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.GlobalDnsProviderList{ListMeta: obj.(*v3.GlobalDnsProviderList).ListMeta} + for _, item := range obj.(*v3.GlobalDnsProviderList).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 globalDnsProviders. +func (c *FakeGlobalDnsProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(globaldnsprovidersResource, c.ns, opts)) + +} + +// Create takes the representation of a globalDnsProvider and creates it. Returns the server's representation of the globalDnsProvider, and an error, if there is any. +func (c *FakeGlobalDnsProviders) Create(ctx context.Context, globalDnsProvider *v3.GlobalDnsProvider, opts v1.CreateOptions) (result *v3.GlobalDnsProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(globaldnsprovidersResource, c.ns, globalDnsProvider), &v3.GlobalDnsProvider{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalDnsProvider), err +} + +// Update takes the representation of a globalDnsProvider and updates it. Returns the server's representation of the globalDnsProvider, and an error, if there is any. +func (c *FakeGlobalDnsProviders) Update(ctx context.Context, globalDnsProvider *v3.GlobalDnsProvider, opts v1.UpdateOptions) (result *v3.GlobalDnsProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(globaldnsprovidersResource, c.ns, globalDnsProvider), &v3.GlobalDnsProvider{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalDnsProvider), err +} + +// Delete takes name of the globalDnsProvider and deletes it. Returns an error if one occurs. +func (c *FakeGlobalDnsProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(globaldnsprovidersResource, c.ns, name, opts), &v3.GlobalDnsProvider{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGlobalDnsProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(globaldnsprovidersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.GlobalDnsProviderList{}) + return err +} + +// Patch applies the patch and returns the patched globalDnsProvider. +func (c *FakeGlobalDnsProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalDnsProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(globaldnsprovidersResource, c.ns, name, pt, data, subresources...), &v3.GlobalDnsProvider{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalDnsProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globalrole.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globalrole.go new file mode 100644 index 00000000..e47f6c0b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globalrole.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGlobalRoles implements GlobalRoleInterface +type FakeGlobalRoles struct { + Fake *FakeManagementV3 +} + +var globalrolesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "globalroles"} + +var globalrolesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "GlobalRole"} + +// Get takes name of the globalRole, and returns the corresponding globalRole object, and an error if there is any. +func (c *FakeGlobalRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GlobalRole, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(globalrolesResource, name), &v3.GlobalRole{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalRole), err +} + +// List takes label and field selectors, and returns the list of GlobalRoles that match those selectors. +func (c *FakeGlobalRoles) List(ctx context.Context, opts v1.ListOptions) (result *v3.GlobalRoleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(globalrolesResource, globalrolesKind, opts), &v3.GlobalRoleList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.GlobalRoleList{ListMeta: obj.(*v3.GlobalRoleList).ListMeta} + for _, item := range obj.(*v3.GlobalRoleList).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 globalRoles. +func (c *FakeGlobalRoles) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(globalrolesResource, opts)) +} + +// Create takes the representation of a globalRole and creates it. Returns the server's representation of the globalRole, and an error, if there is any. +func (c *FakeGlobalRoles) Create(ctx context.Context, globalRole *v3.GlobalRole, opts v1.CreateOptions) (result *v3.GlobalRole, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(globalrolesResource, globalRole), &v3.GlobalRole{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalRole), err +} + +// Update takes the representation of a globalRole and updates it. Returns the server's representation of the globalRole, and an error, if there is any. +func (c *FakeGlobalRoles) Update(ctx context.Context, globalRole *v3.GlobalRole, opts v1.UpdateOptions) (result *v3.GlobalRole, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(globalrolesResource, globalRole), &v3.GlobalRole{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalRole), err +} + +// Delete takes name of the globalRole and deletes it. Returns an error if one occurs. +func (c *FakeGlobalRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(globalrolesResource, name, opts), &v3.GlobalRole{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGlobalRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(globalrolesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.GlobalRoleList{}) + return err +} + +// Patch applies the patch and returns the patched globalRole. +func (c *FakeGlobalRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalRole, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(globalrolesResource, name, pt, data, subresources...), &v3.GlobalRole{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalRole), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globalrolebinding.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globalrolebinding.go new file mode 100644 index 00000000..fb4b934b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_globalrolebinding.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGlobalRoleBindings implements GlobalRoleBindingInterface +type FakeGlobalRoleBindings struct { + Fake *FakeManagementV3 +} + +var globalrolebindingsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "globalrolebindings"} + +var globalrolebindingsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "GlobalRoleBinding"} + +// Get takes name of the globalRoleBinding, and returns the corresponding globalRoleBinding object, and an error if there is any. +func (c *FakeGlobalRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GlobalRoleBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(globalrolebindingsResource, name), &v3.GlobalRoleBinding{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalRoleBinding), err +} + +// List takes label and field selectors, and returns the list of GlobalRoleBindings that match those selectors. +func (c *FakeGlobalRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v3.GlobalRoleBindingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(globalrolebindingsResource, globalrolebindingsKind, opts), &v3.GlobalRoleBindingList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.GlobalRoleBindingList{ListMeta: obj.(*v3.GlobalRoleBindingList).ListMeta} + for _, item := range obj.(*v3.GlobalRoleBindingList).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 globalRoleBindings. +func (c *FakeGlobalRoleBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(globalrolebindingsResource, opts)) +} + +// Create takes the representation of a globalRoleBinding and creates it. Returns the server's representation of the globalRoleBinding, and an error, if there is any. +func (c *FakeGlobalRoleBindings) Create(ctx context.Context, globalRoleBinding *v3.GlobalRoleBinding, opts v1.CreateOptions) (result *v3.GlobalRoleBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(globalrolebindingsResource, globalRoleBinding), &v3.GlobalRoleBinding{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalRoleBinding), err +} + +// Update takes the representation of a globalRoleBinding and updates it. Returns the server's representation of the globalRoleBinding, and an error, if there is any. +func (c *FakeGlobalRoleBindings) Update(ctx context.Context, globalRoleBinding *v3.GlobalRoleBinding, opts v1.UpdateOptions) (result *v3.GlobalRoleBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(globalrolebindingsResource, globalRoleBinding), &v3.GlobalRoleBinding{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalRoleBinding), err +} + +// Delete takes name of the globalRoleBinding and deletes it. Returns an error if one occurs. +func (c *FakeGlobalRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(globalrolebindingsResource, name, opts), &v3.GlobalRoleBinding{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGlobalRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(globalrolebindingsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.GlobalRoleBindingList{}) + return err +} + +// Patch applies the patch and returns the patched globalRoleBinding. +func (c *FakeGlobalRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalRoleBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(globalrolebindingsResource, name, pt, data, subresources...), &v3.GlobalRoleBinding{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GlobalRoleBinding), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_googleoauthprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_googleoauthprovider.go new file mode 100644 index 00000000..acf2e1b3 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_googleoauthprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGoogleOAuthProviders implements GoogleOAuthProviderInterface +type FakeGoogleOAuthProviders struct { + Fake *FakeManagementV3 +} + +var googleoauthprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "googleoauthproviders"} + +var googleoauthprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "GoogleOAuthProvider"} + +// Get takes name of the googleOAuthProvider, and returns the corresponding googleOAuthProvider object, and an error if there is any. +func (c *FakeGoogleOAuthProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GoogleOAuthProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(googleoauthprovidersResource, name), &v3.GoogleOAuthProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GoogleOAuthProvider), err +} + +// List takes label and field selectors, and returns the list of GoogleOAuthProviders that match those selectors. +func (c *FakeGoogleOAuthProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.GoogleOAuthProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(googleoauthprovidersResource, googleoauthprovidersKind, opts), &v3.GoogleOAuthProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.GoogleOAuthProviderList{ListMeta: obj.(*v3.GoogleOAuthProviderList).ListMeta} + for _, item := range obj.(*v3.GoogleOAuthProviderList).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 googleOAuthProviders. +func (c *FakeGoogleOAuthProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(googleoauthprovidersResource, opts)) +} + +// Create takes the representation of a googleOAuthProvider and creates it. Returns the server's representation of the googleOAuthProvider, and an error, if there is any. +func (c *FakeGoogleOAuthProviders) Create(ctx context.Context, googleOAuthProvider *v3.GoogleOAuthProvider, opts v1.CreateOptions) (result *v3.GoogleOAuthProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(googleoauthprovidersResource, googleOAuthProvider), &v3.GoogleOAuthProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GoogleOAuthProvider), err +} + +// Update takes the representation of a googleOAuthProvider and updates it. Returns the server's representation of the googleOAuthProvider, and an error, if there is any. +func (c *FakeGoogleOAuthProviders) Update(ctx context.Context, googleOAuthProvider *v3.GoogleOAuthProvider, opts v1.UpdateOptions) (result *v3.GoogleOAuthProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(googleoauthprovidersResource, googleOAuthProvider), &v3.GoogleOAuthProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GoogleOAuthProvider), err +} + +// Delete takes name of the googleOAuthProvider and deletes it. Returns an error if one occurs. +func (c *FakeGoogleOAuthProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(googleoauthprovidersResource, name, opts), &v3.GoogleOAuthProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGoogleOAuthProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(googleoauthprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.GoogleOAuthProviderList{}) + return err +} + +// Patch applies the patch and returns the patched googleOAuthProvider. +func (c *FakeGoogleOAuthProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GoogleOAuthProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(googleoauthprovidersResource, name, pt, data, subresources...), &v3.GoogleOAuthProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GoogleOAuthProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_group.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_group.go new file mode 100644 index 00000000..04b0b51a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_group.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGroups implements GroupInterface +type FakeGroups struct { + Fake *FakeManagementV3 +} + +var groupsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "groups"} + +var groupsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Group"} + +// Get takes name of the group, and returns the corresponding group object, and an error if there is any. +func (c *FakeGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Group, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(groupsResource, name), &v3.Group{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Group), err +} + +// List takes label and field selectors, and returns the list of Groups that match those selectors. +func (c *FakeGroups) List(ctx context.Context, opts v1.ListOptions) (result *v3.GroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(groupsResource, groupsKind, opts), &v3.GroupList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.GroupList{ListMeta: obj.(*v3.GroupList).ListMeta} + for _, item := range obj.(*v3.GroupList).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 groups. +func (c *FakeGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(groupsResource, opts)) +} + +// Create takes the representation of a group and creates it. Returns the server's representation of the group, and an error, if there is any. +func (c *FakeGroups) Create(ctx context.Context, group *v3.Group, opts v1.CreateOptions) (result *v3.Group, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(groupsResource, group), &v3.Group{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Group), err +} + +// Update takes the representation of a group and updates it. Returns the server's representation of the group, and an error, if there is any. +func (c *FakeGroups) Update(ctx context.Context, group *v3.Group, opts v1.UpdateOptions) (result *v3.Group, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(groupsResource, group), &v3.Group{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Group), err +} + +// Delete takes name of the group and deletes it. Returns an error if one occurs. +func (c *FakeGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(groupsResource, name, opts), &v3.Group{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(groupsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.GroupList{}) + return err +} + +// Patch applies the patch and returns the patched group. +func (c *FakeGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Group, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(groupsResource, name, pt, data, subresources...), &v3.Group{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Group), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_groupmember.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_groupmember.go new file mode 100644 index 00000000..ee4ab445 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_groupmember.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeGroupMembers implements GroupMemberInterface +type FakeGroupMembers struct { + Fake *FakeManagementV3 +} + +var groupmembersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "groupmembers"} + +var groupmembersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "GroupMember"} + +// Get takes name of the groupMember, and returns the corresponding groupMember object, and an error if there is any. +func (c *FakeGroupMembers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GroupMember, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(groupmembersResource, name), &v3.GroupMember{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GroupMember), err +} + +// List takes label and field selectors, and returns the list of GroupMembers that match those selectors. +func (c *FakeGroupMembers) List(ctx context.Context, opts v1.ListOptions) (result *v3.GroupMemberList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(groupmembersResource, groupmembersKind, opts), &v3.GroupMemberList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.GroupMemberList{ListMeta: obj.(*v3.GroupMemberList).ListMeta} + for _, item := range obj.(*v3.GroupMemberList).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 groupMembers. +func (c *FakeGroupMembers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(groupmembersResource, opts)) +} + +// Create takes the representation of a groupMember and creates it. Returns the server's representation of the groupMember, and an error, if there is any. +func (c *FakeGroupMembers) Create(ctx context.Context, groupMember *v3.GroupMember, opts v1.CreateOptions) (result *v3.GroupMember, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(groupmembersResource, groupMember), &v3.GroupMember{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GroupMember), err +} + +// Update takes the representation of a groupMember and updates it. Returns the server's representation of the groupMember, and an error, if there is any. +func (c *FakeGroupMembers) Update(ctx context.Context, groupMember *v3.GroupMember, opts v1.UpdateOptions) (result *v3.GroupMember, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(groupmembersResource, groupMember), &v3.GroupMember{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GroupMember), err +} + +// Delete takes name of the groupMember and deletes it. Returns an error if one occurs. +func (c *FakeGroupMembers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(groupmembersResource, name, opts), &v3.GroupMember{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeGroupMembers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(groupmembersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.GroupMemberList{}) + return err +} + +// Patch applies the patch and returns the patched groupMember. +func (c *FakeGroupMembers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GroupMember, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(groupmembersResource, name, pt, data, subresources...), &v3.GroupMember{}) + if obj == nil { + return nil, err + } + return obj.(*v3.GroupMember), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_kontainerdriver.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_kontainerdriver.go new file mode 100644 index 00000000..a0909f46 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_kontainerdriver.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeKontainerDrivers implements KontainerDriverInterface +type FakeKontainerDrivers struct { + Fake *FakeManagementV3 +} + +var kontainerdriversResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "kontainerdrivers"} + +var kontainerdriversKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "KontainerDriver"} + +// Get takes name of the kontainerDriver, and returns the corresponding kontainerDriver object, and an error if there is any. +func (c *FakeKontainerDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.KontainerDriver, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(kontainerdriversResource, name), &v3.KontainerDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.KontainerDriver), err +} + +// List takes label and field selectors, and returns the list of KontainerDrivers that match those selectors. +func (c *FakeKontainerDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v3.KontainerDriverList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(kontainerdriversResource, kontainerdriversKind, opts), &v3.KontainerDriverList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.KontainerDriverList{ListMeta: obj.(*v3.KontainerDriverList).ListMeta} + for _, item := range obj.(*v3.KontainerDriverList).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 kontainerDrivers. +func (c *FakeKontainerDrivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(kontainerdriversResource, opts)) +} + +// Create takes the representation of a kontainerDriver and creates it. Returns the server's representation of the kontainerDriver, and an error, if there is any. +func (c *FakeKontainerDrivers) Create(ctx context.Context, kontainerDriver *v3.KontainerDriver, opts v1.CreateOptions) (result *v3.KontainerDriver, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(kontainerdriversResource, kontainerDriver), &v3.KontainerDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.KontainerDriver), err +} + +// Update takes the representation of a kontainerDriver and updates it. Returns the server's representation of the kontainerDriver, and an error, if there is any. +func (c *FakeKontainerDrivers) Update(ctx context.Context, kontainerDriver *v3.KontainerDriver, opts v1.UpdateOptions) (result *v3.KontainerDriver, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(kontainerdriversResource, kontainerDriver), &v3.KontainerDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.KontainerDriver), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeKontainerDrivers) UpdateStatus(ctx context.Context, kontainerDriver *v3.KontainerDriver, opts v1.UpdateOptions) (*v3.KontainerDriver, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(kontainerdriversResource, "status", kontainerDriver), &v3.KontainerDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.KontainerDriver), err +} + +// Delete takes name of the kontainerDriver and deletes it. Returns an error if one occurs. +func (c *FakeKontainerDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(kontainerdriversResource, name, opts), &v3.KontainerDriver{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeKontainerDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(kontainerdriversResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.KontainerDriverList{}) + return err +} + +// Patch applies the patch and returns the patched kontainerDriver. +func (c *FakeKontainerDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.KontainerDriver, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(kontainerdriversResource, name, pt, data, subresources...), &v3.KontainerDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.KontainerDriver), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_localprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_localprovider.go new file mode 100644 index 00000000..5daad333 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_localprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeLocalProviders implements LocalProviderInterface +type FakeLocalProviders struct { + Fake *FakeManagementV3 +} + +var localprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "localproviders"} + +var localprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "LocalProvider"} + +// Get takes name of the localProvider, and returns the corresponding localProvider object, and an error if there is any. +func (c *FakeLocalProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.LocalProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(localprovidersResource, name), &v3.LocalProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.LocalProvider), err +} + +// List takes label and field selectors, and returns the list of LocalProviders that match those selectors. +func (c *FakeLocalProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.LocalProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(localprovidersResource, localprovidersKind, opts), &v3.LocalProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.LocalProviderList{ListMeta: obj.(*v3.LocalProviderList).ListMeta} + for _, item := range obj.(*v3.LocalProviderList).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 localProviders. +func (c *FakeLocalProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(localprovidersResource, opts)) +} + +// Create takes the representation of a localProvider and creates it. Returns the server's representation of the localProvider, and an error, if there is any. +func (c *FakeLocalProviders) Create(ctx context.Context, localProvider *v3.LocalProvider, opts v1.CreateOptions) (result *v3.LocalProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(localprovidersResource, localProvider), &v3.LocalProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.LocalProvider), err +} + +// Update takes the representation of a localProvider and updates it. Returns the server's representation of the localProvider, and an error, if there is any. +func (c *FakeLocalProviders) Update(ctx context.Context, localProvider *v3.LocalProvider, opts v1.UpdateOptions) (result *v3.LocalProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(localprovidersResource, localProvider), &v3.LocalProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.LocalProvider), err +} + +// Delete takes name of the localProvider and deletes it. Returns an error if one occurs. +func (c *FakeLocalProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(localprovidersResource, name, opts), &v3.LocalProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeLocalProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(localprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.LocalProviderList{}) + return err +} + +// Patch applies the patch and returns the patched localProvider. +func (c *FakeLocalProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.LocalProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(localprovidersResource, name, pt, data, subresources...), &v3.LocalProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.LocalProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_managedchart.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_managedchart.go new file mode 100644 index 00000000..c702b2d7 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_managedchart.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeManagedCharts implements ManagedChartInterface +type FakeManagedCharts struct { + Fake *FakeManagementV3 + ns string +} + +var managedchartsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "managedcharts"} + +var managedchartsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ManagedChart"} + +// Get takes name of the managedChart, and returns the corresponding managedChart object, and an error if there is any. +func (c *FakeManagedCharts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ManagedChart, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(managedchartsResource, c.ns, name), &v3.ManagedChart{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ManagedChart), err +} + +// List takes label and field selectors, and returns the list of ManagedCharts that match those selectors. +func (c *FakeManagedCharts) List(ctx context.Context, opts v1.ListOptions) (result *v3.ManagedChartList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(managedchartsResource, managedchartsKind, c.ns, opts), &v3.ManagedChartList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ManagedChartList{ListMeta: obj.(*v3.ManagedChartList).ListMeta} + for _, item := range obj.(*v3.ManagedChartList).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 managedCharts. +func (c *FakeManagedCharts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(managedchartsResource, c.ns, opts)) + +} + +// Create takes the representation of a managedChart and creates it. Returns the server's representation of the managedChart, and an error, if there is any. +func (c *FakeManagedCharts) Create(ctx context.Context, managedChart *v3.ManagedChart, opts v1.CreateOptions) (result *v3.ManagedChart, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(managedchartsResource, c.ns, managedChart), &v3.ManagedChart{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ManagedChart), err +} + +// Update takes the representation of a managedChart and updates it. Returns the server's representation of the managedChart, and an error, if there is any. +func (c *FakeManagedCharts) Update(ctx context.Context, managedChart *v3.ManagedChart, opts v1.UpdateOptions) (result *v3.ManagedChart, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(managedchartsResource, c.ns, managedChart), &v3.ManagedChart{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ManagedChart), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeManagedCharts) UpdateStatus(ctx context.Context, managedChart *v3.ManagedChart, opts v1.UpdateOptions) (*v3.ManagedChart, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(managedchartsResource, "status", c.ns, managedChart), &v3.ManagedChart{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ManagedChart), err +} + +// Delete takes name of the managedChart and deletes it. Returns an error if one occurs. +func (c *FakeManagedCharts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(managedchartsResource, c.ns, name, opts), &v3.ManagedChart{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeManagedCharts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(managedchartsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ManagedChartList{}) + return err +} + +// Patch applies the patch and returns the patched managedChart. +func (c *FakeManagedCharts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ManagedChart, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(managedchartsResource, c.ns, name, pt, data, subresources...), &v3.ManagedChart{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ManagedChart), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_management.cattle.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_management.cattle.io_client.go new file mode 100644 index 00000000..1c324346 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_management.cattle.io_client.go @@ -0,0 +1,352 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v3 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeManagementV3 struct { + *testing.Fake +} + +func (c *FakeManagementV3) APIServices() v3.APIServiceInterface { + return &FakeAPIServices{c} +} + +func (c *FakeManagementV3) ActiveDirectoryProviders() v3.ActiveDirectoryProviderInterface { + return &FakeActiveDirectoryProviders{c} +} + +func (c *FakeManagementV3) AuthConfigs() v3.AuthConfigInterface { + return &FakeAuthConfigs{c} +} + +func (c *FakeManagementV3) AuthProviders() v3.AuthProviderInterface { + return &FakeAuthProviders{c} +} + +func (c *FakeManagementV3) AuthTokens() v3.AuthTokenInterface { + return &FakeAuthTokens{c} +} + +func (c *FakeManagementV3) AzureADProviders() v3.AzureADProviderInterface { + return &FakeAzureADProviders{c} +} + +func (c *FakeManagementV3) Catalogs() v3.CatalogInterface { + return &FakeCatalogs{c} +} + +func (c *FakeManagementV3) CatalogTemplates(namespace string) v3.CatalogTemplateInterface { + return &FakeCatalogTemplates{c, namespace} +} + +func (c *FakeManagementV3) CatalogTemplateVersions(namespace string) v3.CatalogTemplateVersionInterface { + return &FakeCatalogTemplateVersions{c, namespace} +} + +func (c *FakeManagementV3) CisBenchmarkVersions(namespace string) v3.CisBenchmarkVersionInterface { + return &FakeCisBenchmarkVersions{c, namespace} +} + +func (c *FakeManagementV3) CisConfigs(namespace string) v3.CisConfigInterface { + return &FakeCisConfigs{c, namespace} +} + +func (c *FakeManagementV3) CloudCredentials(namespace string) v3.CloudCredentialInterface { + return &FakeCloudCredentials{c, namespace} +} + +func (c *FakeManagementV3) Clusters() v3.ClusterInterface { + return &FakeClusters{c} +} + +func (c *FakeManagementV3) ClusterAlerts(namespace string) v3.ClusterAlertInterface { + return &FakeClusterAlerts{c, namespace} +} + +func (c *FakeManagementV3) ClusterAlertGroups(namespace string) v3.ClusterAlertGroupInterface { + return &FakeClusterAlertGroups{c, namespace} +} + +func (c *FakeManagementV3) ClusterAlertRules(namespace string) v3.ClusterAlertRuleInterface { + return &FakeClusterAlertRules{c, namespace} +} + +func (c *FakeManagementV3) ClusterCatalogs(namespace string) v3.ClusterCatalogInterface { + return &FakeClusterCatalogs{c, namespace} +} + +func (c *FakeManagementV3) ClusterLoggings(namespace string) v3.ClusterLoggingInterface { + return &FakeClusterLoggings{c, namespace} +} + +func (c *FakeManagementV3) ClusterMonitorGraphs(namespace string) v3.ClusterMonitorGraphInterface { + return &FakeClusterMonitorGraphs{c, namespace} +} + +func (c *FakeManagementV3) ClusterRegistrationTokens(namespace string) v3.ClusterRegistrationTokenInterface { + return &FakeClusterRegistrationTokens{c, namespace} +} + +func (c *FakeManagementV3) ClusterRoleTemplateBindings(namespace string) v3.ClusterRoleTemplateBindingInterface { + return &FakeClusterRoleTemplateBindings{c, namespace} +} + +func (c *FakeManagementV3) ClusterScans(namespace string) v3.ClusterScanInterface { + return &FakeClusterScans{c, namespace} +} + +func (c *FakeManagementV3) ClusterTemplates(namespace string) v3.ClusterTemplateInterface { + return &FakeClusterTemplates{c, namespace} +} + +func (c *FakeManagementV3) ClusterTemplateRevisions(namespace string) v3.ClusterTemplateRevisionInterface { + return &FakeClusterTemplateRevisions{c, namespace} +} + +func (c *FakeManagementV3) ComposeConfigs() v3.ComposeConfigInterface { + return &FakeComposeConfigs{c} +} + +func (c *FakeManagementV3) DynamicSchemas() v3.DynamicSchemaInterface { + return &FakeDynamicSchemas{c} +} + +func (c *FakeManagementV3) EtcdBackups(namespace string) v3.EtcdBackupInterface { + return &FakeEtcdBackups{c, namespace} +} + +func (c *FakeManagementV3) Features() v3.FeatureInterface { + return &FakeFeatures{c} +} + +func (c *FakeManagementV3) FleetWorkspaces() v3.FleetWorkspaceInterface { + return &FakeFleetWorkspaces{c} +} + +func (c *FakeManagementV3) FreeIpaProviders() v3.FreeIpaProviderInterface { + return &FakeFreeIpaProviders{c} +} + +func (c *FakeManagementV3) GithubConfigs() v3.GithubConfigInterface { + return &FakeGithubConfigs{c} +} + +func (c *FakeManagementV3) GithubProviders() v3.GithubProviderInterface { + return &FakeGithubProviders{c} +} + +func (c *FakeManagementV3) GlobalDnses(namespace string) v3.GlobalDnsInterface { + return &FakeGlobalDnses{c, namespace} +} + +func (c *FakeManagementV3) GlobalDnsProviders(namespace string) v3.GlobalDnsProviderInterface { + return &FakeGlobalDnsProviders{c, namespace} +} + +func (c *FakeManagementV3) GlobalRoles() v3.GlobalRoleInterface { + return &FakeGlobalRoles{c} +} + +func (c *FakeManagementV3) GlobalRoleBindings() v3.GlobalRoleBindingInterface { + return &FakeGlobalRoleBindings{c} +} + +func (c *FakeManagementV3) GoogleOAuthProviders() v3.GoogleOAuthProviderInterface { + return &FakeGoogleOAuthProviders{c} +} + +func (c *FakeManagementV3) Groups() v3.GroupInterface { + return &FakeGroups{c} +} + +func (c *FakeManagementV3) GroupMembers() v3.GroupMemberInterface { + return &FakeGroupMembers{c} +} + +func (c *FakeManagementV3) KontainerDrivers() v3.KontainerDriverInterface { + return &FakeKontainerDrivers{c} +} + +func (c *FakeManagementV3) LocalProviders() v3.LocalProviderInterface { + return &FakeLocalProviders{c} +} + +func (c *FakeManagementV3) ManagedCharts(namespace string) v3.ManagedChartInterface { + return &FakeManagedCharts{c, namespace} +} + +func (c *FakeManagementV3) MonitorMetrics(namespace string) v3.MonitorMetricInterface { + return &FakeMonitorMetrics{c, namespace} +} + +func (c *FakeManagementV3) MultiClusterApps(namespace string) v3.MultiClusterAppInterface { + return &FakeMultiClusterApps{c, namespace} +} + +func (c *FakeManagementV3) MultiClusterAppRevisions(namespace string) v3.MultiClusterAppRevisionInterface { + return &FakeMultiClusterAppRevisions{c, namespace} +} + +func (c *FakeManagementV3) Nodes(namespace string) v3.NodeInterface { + return &FakeNodes{c, namespace} +} + +func (c *FakeManagementV3) NodeDrivers() v3.NodeDriverInterface { + return &FakeNodeDrivers{c} +} + +func (c *FakeManagementV3) NodePools(namespace string) v3.NodePoolInterface { + return &FakeNodePools{c, namespace} +} + +func (c *FakeManagementV3) NodeTemplates(namespace string) v3.NodeTemplateInterface { + return &FakeNodeTemplates{c, namespace} +} + +func (c *FakeManagementV3) Notifiers(namespace string) v3.NotifierInterface { + return &FakeNotifiers{c, namespace} +} + +func (c *FakeManagementV3) OIDCProviders() v3.OIDCProviderInterface { + return &FakeOIDCProviders{c} +} + +func (c *FakeManagementV3) OpenLdapProviders() v3.OpenLdapProviderInterface { + return &FakeOpenLdapProviders{c} +} + +func (c *FakeManagementV3) PodSecurityPolicyTemplates() v3.PodSecurityPolicyTemplateInterface { + return &FakePodSecurityPolicyTemplates{c} +} + +func (c *FakeManagementV3) PodSecurityPolicyTemplateProjectBindings(namespace string) v3.PodSecurityPolicyTemplateProjectBindingInterface { + return &FakePodSecurityPolicyTemplateProjectBindings{c, namespace} +} + +func (c *FakeManagementV3) Preferences(namespace string) v3.PreferenceInterface { + return &FakePreferences{c, namespace} +} + +func (c *FakeManagementV3) Principals() v3.PrincipalInterface { + return &FakePrincipals{c} +} + +func (c *FakeManagementV3) Projects(namespace string) v3.ProjectInterface { + return &FakeProjects{c, namespace} +} + +func (c *FakeManagementV3) ProjectAlerts(namespace string) v3.ProjectAlertInterface { + return &FakeProjectAlerts{c, namespace} +} + +func (c *FakeManagementV3) ProjectAlertGroups(namespace string) v3.ProjectAlertGroupInterface { + return &FakeProjectAlertGroups{c, namespace} +} + +func (c *FakeManagementV3) ProjectAlertRules(namespace string) v3.ProjectAlertRuleInterface { + return &FakeProjectAlertRules{c, namespace} +} + +func (c *FakeManagementV3) ProjectCatalogs(namespace string) v3.ProjectCatalogInterface { + return &FakeProjectCatalogs{c, namespace} +} + +func (c *FakeManagementV3) ProjectLoggings(namespace string) v3.ProjectLoggingInterface { + return &FakeProjectLoggings{c, namespace} +} + +func (c *FakeManagementV3) ProjectMonitorGraphs(namespace string) v3.ProjectMonitorGraphInterface { + return &FakeProjectMonitorGraphs{c, namespace} +} + +func (c *FakeManagementV3) ProjectNetworkPolicies(namespace string) v3.ProjectNetworkPolicyInterface { + return &FakeProjectNetworkPolicies{c, namespace} +} + +func (c *FakeManagementV3) ProjectRoleTemplateBindings(namespace string) v3.ProjectRoleTemplateBindingInterface { + return &FakeProjectRoleTemplateBindings{c, namespace} +} + +func (c *FakeManagementV3) RancherUserNotifications() v3.RancherUserNotificationInterface { + return &FakeRancherUserNotifications{c} +} + +func (c *FakeManagementV3) RkeAddons(namespace string) v3.RkeAddonInterface { + return &FakeRkeAddons{c, namespace} +} + +func (c *FakeManagementV3) RkeK8sServiceOptions(namespace string) v3.RkeK8sServiceOptionInterface { + return &FakeRkeK8sServiceOptions{c, namespace} +} + +func (c *FakeManagementV3) RkeK8sSystemImages(namespace string) v3.RkeK8sSystemImageInterface { + return &FakeRkeK8sSystemImages{c, namespace} +} + +func (c *FakeManagementV3) RoleTemplates() v3.RoleTemplateInterface { + return &FakeRoleTemplates{c} +} + +func (c *FakeManagementV3) SamlProviders() v3.SamlProviderInterface { + return &FakeSamlProviders{c} +} + +func (c *FakeManagementV3) SamlTokens() v3.SamlTokenInterface { + return &FakeSamlTokens{c} +} + +func (c *FakeManagementV3) Settings() v3.SettingInterface { + return &FakeSettings{c} +} + +func (c *FakeManagementV3) Templates() v3.TemplateInterface { + return &FakeTemplates{c} +} + +func (c *FakeManagementV3) TemplateContents() v3.TemplateContentInterface { + return &FakeTemplateContents{c} +} + +func (c *FakeManagementV3) TemplateVersions() v3.TemplateVersionInterface { + return &FakeTemplateVersions{c} +} + +func (c *FakeManagementV3) Tokens() v3.TokenInterface { + return &FakeTokens{c} +} + +func (c *FakeManagementV3) Users() v3.UserInterface { + return &FakeUsers{c} +} + +func (c *FakeManagementV3) UserAttributes() v3.UserAttributeInterface { + return &FakeUserAttributes{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeManagementV3) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_monitormetric.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_monitormetric.go new file mode 100644 index 00000000..e06eafc5 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_monitormetric.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeMonitorMetrics implements MonitorMetricInterface +type FakeMonitorMetrics struct { + Fake *FakeManagementV3 + ns string +} + +var monitormetricsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "monitormetrics"} + +var monitormetricsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "MonitorMetric"} + +// Get takes name of the monitorMetric, and returns the corresponding monitorMetric object, and an error if there is any. +func (c *FakeMonitorMetrics) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.MonitorMetric, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(monitormetricsResource, c.ns, name), &v3.MonitorMetric{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MonitorMetric), err +} + +// List takes label and field selectors, and returns the list of MonitorMetrics that match those selectors. +func (c *FakeMonitorMetrics) List(ctx context.Context, opts v1.ListOptions) (result *v3.MonitorMetricList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(monitormetricsResource, monitormetricsKind, c.ns, opts), &v3.MonitorMetricList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.MonitorMetricList{ListMeta: obj.(*v3.MonitorMetricList).ListMeta} + for _, item := range obj.(*v3.MonitorMetricList).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 monitorMetrics. +func (c *FakeMonitorMetrics) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(monitormetricsResource, c.ns, opts)) + +} + +// Create takes the representation of a monitorMetric and creates it. Returns the server's representation of the monitorMetric, and an error, if there is any. +func (c *FakeMonitorMetrics) Create(ctx context.Context, monitorMetric *v3.MonitorMetric, opts v1.CreateOptions) (result *v3.MonitorMetric, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(monitormetricsResource, c.ns, monitorMetric), &v3.MonitorMetric{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MonitorMetric), err +} + +// Update takes the representation of a monitorMetric and updates it. Returns the server's representation of the monitorMetric, and an error, if there is any. +func (c *FakeMonitorMetrics) Update(ctx context.Context, monitorMetric *v3.MonitorMetric, opts v1.UpdateOptions) (result *v3.MonitorMetric, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(monitormetricsResource, c.ns, monitorMetric), &v3.MonitorMetric{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MonitorMetric), err +} + +// Delete takes name of the monitorMetric and deletes it. Returns an error if one occurs. +func (c *FakeMonitorMetrics) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(monitormetricsResource, c.ns, name, opts), &v3.MonitorMetric{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMonitorMetrics) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(monitormetricsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.MonitorMetricList{}) + return err +} + +// Patch applies the patch and returns the patched monitorMetric. +func (c *FakeMonitorMetrics) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.MonitorMetric, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(monitormetricsResource, c.ns, name, pt, data, subresources...), &v3.MonitorMetric{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MonitorMetric), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_multiclusterapp.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_multiclusterapp.go new file mode 100644 index 00000000..6126f9db --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_multiclusterapp.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeMultiClusterApps implements MultiClusterAppInterface +type FakeMultiClusterApps struct { + Fake *FakeManagementV3 + ns string +} + +var multiclusterappsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "multiclusterapps"} + +var multiclusterappsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "MultiClusterApp"} + +// Get takes name of the multiClusterApp, and returns the corresponding multiClusterApp object, and an error if there is any. +func (c *FakeMultiClusterApps) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.MultiClusterApp, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(multiclusterappsResource, c.ns, name), &v3.MultiClusterApp{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MultiClusterApp), err +} + +// List takes label and field selectors, and returns the list of MultiClusterApps that match those selectors. +func (c *FakeMultiClusterApps) List(ctx context.Context, opts v1.ListOptions) (result *v3.MultiClusterAppList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(multiclusterappsResource, multiclusterappsKind, c.ns, opts), &v3.MultiClusterAppList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.MultiClusterAppList{ListMeta: obj.(*v3.MultiClusterAppList).ListMeta} + for _, item := range obj.(*v3.MultiClusterAppList).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 multiClusterApps. +func (c *FakeMultiClusterApps) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(multiclusterappsResource, c.ns, opts)) + +} + +// Create takes the representation of a multiClusterApp and creates it. Returns the server's representation of the multiClusterApp, and an error, if there is any. +func (c *FakeMultiClusterApps) Create(ctx context.Context, multiClusterApp *v3.MultiClusterApp, opts v1.CreateOptions) (result *v3.MultiClusterApp, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(multiclusterappsResource, c.ns, multiClusterApp), &v3.MultiClusterApp{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MultiClusterApp), err +} + +// Update takes the representation of a multiClusterApp and updates it. Returns the server's representation of the multiClusterApp, and an error, if there is any. +func (c *FakeMultiClusterApps) Update(ctx context.Context, multiClusterApp *v3.MultiClusterApp, opts v1.UpdateOptions) (result *v3.MultiClusterApp, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(multiclusterappsResource, c.ns, multiClusterApp), &v3.MultiClusterApp{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MultiClusterApp), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeMultiClusterApps) UpdateStatus(ctx context.Context, multiClusterApp *v3.MultiClusterApp, opts v1.UpdateOptions) (*v3.MultiClusterApp, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(multiclusterappsResource, "status", c.ns, multiClusterApp), &v3.MultiClusterApp{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MultiClusterApp), err +} + +// Delete takes name of the multiClusterApp and deletes it. Returns an error if one occurs. +func (c *FakeMultiClusterApps) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(multiclusterappsResource, c.ns, name, opts), &v3.MultiClusterApp{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMultiClusterApps) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(multiclusterappsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.MultiClusterAppList{}) + return err +} + +// Patch applies the patch and returns the patched multiClusterApp. +func (c *FakeMultiClusterApps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.MultiClusterApp, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(multiclusterappsResource, c.ns, name, pt, data, subresources...), &v3.MultiClusterApp{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MultiClusterApp), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_multiclusterapprevision.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_multiclusterapprevision.go new file mode 100644 index 00000000..0e1bc754 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_multiclusterapprevision.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeMultiClusterAppRevisions implements MultiClusterAppRevisionInterface +type FakeMultiClusterAppRevisions struct { + Fake *FakeManagementV3 + ns string +} + +var multiclusterapprevisionsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "multiclusterapprevisions"} + +var multiclusterapprevisionsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "MultiClusterAppRevision"} + +// Get takes name of the multiClusterAppRevision, and returns the corresponding multiClusterAppRevision object, and an error if there is any. +func (c *FakeMultiClusterAppRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.MultiClusterAppRevision, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(multiclusterapprevisionsResource, c.ns, name), &v3.MultiClusterAppRevision{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MultiClusterAppRevision), err +} + +// List takes label and field selectors, and returns the list of MultiClusterAppRevisions that match those selectors. +func (c *FakeMultiClusterAppRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v3.MultiClusterAppRevisionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(multiclusterapprevisionsResource, multiclusterapprevisionsKind, c.ns, opts), &v3.MultiClusterAppRevisionList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.MultiClusterAppRevisionList{ListMeta: obj.(*v3.MultiClusterAppRevisionList).ListMeta} + for _, item := range obj.(*v3.MultiClusterAppRevisionList).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 multiClusterAppRevisions. +func (c *FakeMultiClusterAppRevisions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(multiclusterapprevisionsResource, c.ns, opts)) + +} + +// Create takes the representation of a multiClusterAppRevision and creates it. Returns the server's representation of the multiClusterAppRevision, and an error, if there is any. +func (c *FakeMultiClusterAppRevisions) Create(ctx context.Context, multiClusterAppRevision *v3.MultiClusterAppRevision, opts v1.CreateOptions) (result *v3.MultiClusterAppRevision, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(multiclusterapprevisionsResource, c.ns, multiClusterAppRevision), &v3.MultiClusterAppRevision{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MultiClusterAppRevision), err +} + +// Update takes the representation of a multiClusterAppRevision and updates it. Returns the server's representation of the multiClusterAppRevision, and an error, if there is any. +func (c *FakeMultiClusterAppRevisions) Update(ctx context.Context, multiClusterAppRevision *v3.MultiClusterAppRevision, opts v1.UpdateOptions) (result *v3.MultiClusterAppRevision, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(multiclusterapprevisionsResource, c.ns, multiClusterAppRevision), &v3.MultiClusterAppRevision{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MultiClusterAppRevision), err +} + +// Delete takes name of the multiClusterAppRevision and deletes it. Returns an error if one occurs. +func (c *FakeMultiClusterAppRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(multiclusterapprevisionsResource, c.ns, name, opts), &v3.MultiClusterAppRevision{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeMultiClusterAppRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(multiclusterapprevisionsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.MultiClusterAppRevisionList{}) + return err +} + +// Patch applies the patch and returns the patched multiClusterAppRevision. +func (c *FakeMultiClusterAppRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.MultiClusterAppRevision, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(multiclusterapprevisionsResource, c.ns, name, pt, data, subresources...), &v3.MultiClusterAppRevision{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.MultiClusterAppRevision), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_node.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_node.go new file mode 100644 index 00000000..1d2ebbc8 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_node.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNodes implements NodeInterface +type FakeNodes struct { + Fake *FakeManagementV3 + ns string +} + +var nodesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "nodes"} + +var nodesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Node"} + +// Get takes name of the node, and returns the corresponding node object, and an error if there is any. +func (c *FakeNodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(nodesResource, c.ns, name), &v3.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Node), err +} + +// List takes label and field selectors, and returns the list of Nodes that match those selectors. +func (c *FakeNodes) List(ctx context.Context, opts v1.ListOptions) (result *v3.NodeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(nodesResource, nodesKind, c.ns, opts), &v3.NodeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.NodeList{ListMeta: obj.(*v3.NodeList).ListMeta} + for _, item := range obj.(*v3.NodeList).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 nodes. +func (c *FakeNodes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(nodesResource, c.ns, opts)) + +} + +// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. +func (c *FakeNodes) Create(ctx context.Context, node *v3.Node, opts v1.CreateOptions) (result *v3.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(nodesResource, c.ns, node), &v3.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Node), err +} + +// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. +func (c *FakeNodes) Update(ctx context.Context, node *v3.Node, opts v1.UpdateOptions) (result *v3.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(nodesResource, c.ns, node), &v3.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Node), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNodes) UpdateStatus(ctx context.Context, node *v3.Node, opts v1.UpdateOptions) (*v3.Node, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(nodesResource, "status", c.ns, node), &v3.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Node), err +} + +// Delete takes name of the node and deletes it. Returns an error if one occurs. +func (c *FakeNodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(nodesResource, c.ns, name, opts), &v3.Node{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(nodesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.NodeList{}) + return err +} + +// Patch applies the patch and returns the patched node. +func (c *FakeNodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Node, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(nodesResource, c.ns, name, pt, data, subresources...), &v3.Node{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Node), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_nodedriver.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_nodedriver.go new file mode 100644 index 00000000..08d9625d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_nodedriver.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNodeDrivers implements NodeDriverInterface +type FakeNodeDrivers struct { + Fake *FakeManagementV3 +} + +var nodedriversResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "nodedrivers"} + +var nodedriversKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "NodeDriver"} + +// Get takes name of the nodeDriver, and returns the corresponding nodeDriver object, and an error if there is any. +func (c *FakeNodeDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.NodeDriver, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(nodedriversResource, name), &v3.NodeDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.NodeDriver), err +} + +// List takes label and field selectors, and returns the list of NodeDrivers that match those selectors. +func (c *FakeNodeDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v3.NodeDriverList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(nodedriversResource, nodedriversKind, opts), &v3.NodeDriverList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.NodeDriverList{ListMeta: obj.(*v3.NodeDriverList).ListMeta} + for _, item := range obj.(*v3.NodeDriverList).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 nodeDrivers. +func (c *FakeNodeDrivers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(nodedriversResource, opts)) +} + +// Create takes the representation of a nodeDriver and creates it. Returns the server's representation of the nodeDriver, and an error, if there is any. +func (c *FakeNodeDrivers) Create(ctx context.Context, nodeDriver *v3.NodeDriver, opts v1.CreateOptions) (result *v3.NodeDriver, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(nodedriversResource, nodeDriver), &v3.NodeDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.NodeDriver), err +} + +// Update takes the representation of a nodeDriver and updates it. Returns the server's representation of the nodeDriver, and an error, if there is any. +func (c *FakeNodeDrivers) Update(ctx context.Context, nodeDriver *v3.NodeDriver, opts v1.UpdateOptions) (result *v3.NodeDriver, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(nodedriversResource, nodeDriver), &v3.NodeDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.NodeDriver), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNodeDrivers) UpdateStatus(ctx context.Context, nodeDriver *v3.NodeDriver, opts v1.UpdateOptions) (*v3.NodeDriver, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(nodedriversResource, "status", nodeDriver), &v3.NodeDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.NodeDriver), err +} + +// Delete takes name of the nodeDriver and deletes it. Returns an error if one occurs. +func (c *FakeNodeDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(nodedriversResource, name, opts), &v3.NodeDriver{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodeDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(nodedriversResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.NodeDriverList{}) + return err +} + +// Patch applies the patch and returns the patched nodeDriver. +func (c *FakeNodeDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.NodeDriver, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(nodedriversResource, name, pt, data, subresources...), &v3.NodeDriver{}) + if obj == nil { + return nil, err + } + return obj.(*v3.NodeDriver), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_nodepool.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_nodepool.go new file mode 100644 index 00000000..4cc848db --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_nodepool.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNodePools implements NodePoolInterface +type FakeNodePools struct { + Fake *FakeManagementV3 + ns string +} + +var nodepoolsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "nodepools"} + +var nodepoolsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "NodePool"} + +// Get takes name of the nodePool, and returns the corresponding nodePool object, and an error if there is any. +func (c *FakeNodePools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.NodePool, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(nodepoolsResource, c.ns, name), &v3.NodePool{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodePool), err +} + +// List takes label and field selectors, and returns the list of NodePools that match those selectors. +func (c *FakeNodePools) List(ctx context.Context, opts v1.ListOptions) (result *v3.NodePoolList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(nodepoolsResource, nodepoolsKind, c.ns, opts), &v3.NodePoolList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.NodePoolList{ListMeta: obj.(*v3.NodePoolList).ListMeta} + for _, item := range obj.(*v3.NodePoolList).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 nodePools. +func (c *FakeNodePools) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(nodepoolsResource, c.ns, opts)) + +} + +// Create takes the representation of a nodePool and creates it. Returns the server's representation of the nodePool, and an error, if there is any. +func (c *FakeNodePools) Create(ctx context.Context, nodePool *v3.NodePool, opts v1.CreateOptions) (result *v3.NodePool, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(nodepoolsResource, c.ns, nodePool), &v3.NodePool{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodePool), err +} + +// Update takes the representation of a nodePool and updates it. Returns the server's representation of the nodePool, and an error, if there is any. +func (c *FakeNodePools) Update(ctx context.Context, nodePool *v3.NodePool, opts v1.UpdateOptions) (result *v3.NodePool, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(nodepoolsResource, c.ns, nodePool), &v3.NodePool{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodePool), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNodePools) UpdateStatus(ctx context.Context, nodePool *v3.NodePool, opts v1.UpdateOptions) (*v3.NodePool, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(nodepoolsResource, "status", c.ns, nodePool), &v3.NodePool{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodePool), err +} + +// Delete takes name of the nodePool and deletes it. Returns an error if one occurs. +func (c *FakeNodePools) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(nodepoolsResource, c.ns, name, opts), &v3.NodePool{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodePools) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(nodepoolsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.NodePoolList{}) + return err +} + +// Patch applies the patch and returns the patched nodePool. +func (c *FakeNodePools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.NodePool, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(nodepoolsResource, c.ns, name, pt, data, subresources...), &v3.NodePool{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodePool), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_nodetemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_nodetemplate.go new file mode 100644 index 00000000..126b9d53 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_nodetemplate.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNodeTemplates implements NodeTemplateInterface +type FakeNodeTemplates struct { + Fake *FakeManagementV3 + ns string +} + +var nodetemplatesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "nodetemplates"} + +var nodetemplatesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "NodeTemplate"} + +// Get takes name of the nodeTemplate, and returns the corresponding nodeTemplate object, and an error if there is any. +func (c *FakeNodeTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.NodeTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(nodetemplatesResource, c.ns, name), &v3.NodeTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodeTemplate), err +} + +// List takes label and field selectors, and returns the list of NodeTemplates that match those selectors. +func (c *FakeNodeTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.NodeTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(nodetemplatesResource, nodetemplatesKind, c.ns, opts), &v3.NodeTemplateList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.NodeTemplateList{ListMeta: obj.(*v3.NodeTemplateList).ListMeta} + for _, item := range obj.(*v3.NodeTemplateList).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 nodeTemplates. +func (c *FakeNodeTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(nodetemplatesResource, c.ns, opts)) + +} + +// Create takes the representation of a nodeTemplate and creates it. Returns the server's representation of the nodeTemplate, and an error, if there is any. +func (c *FakeNodeTemplates) Create(ctx context.Context, nodeTemplate *v3.NodeTemplate, opts v1.CreateOptions) (result *v3.NodeTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(nodetemplatesResource, c.ns, nodeTemplate), &v3.NodeTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodeTemplate), err +} + +// Update takes the representation of a nodeTemplate and updates it. Returns the server's representation of the nodeTemplate, and an error, if there is any. +func (c *FakeNodeTemplates) Update(ctx context.Context, nodeTemplate *v3.NodeTemplate, opts v1.UpdateOptions) (result *v3.NodeTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(nodetemplatesResource, c.ns, nodeTemplate), &v3.NodeTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodeTemplate), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNodeTemplates) UpdateStatus(ctx context.Context, nodeTemplate *v3.NodeTemplate, opts v1.UpdateOptions) (*v3.NodeTemplate, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(nodetemplatesResource, "status", c.ns, nodeTemplate), &v3.NodeTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodeTemplate), err +} + +// Delete takes name of the nodeTemplate and deletes it. Returns an error if one occurs. +func (c *FakeNodeTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(nodetemplatesResource, c.ns, name, opts), &v3.NodeTemplate{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNodeTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(nodetemplatesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.NodeTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched nodeTemplate. +func (c *FakeNodeTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.NodeTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(nodetemplatesResource, c.ns, name, pt, data, subresources...), &v3.NodeTemplate{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.NodeTemplate), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_notifier.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_notifier.go new file mode 100644 index 00000000..e887534c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_notifier.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNotifiers implements NotifierInterface +type FakeNotifiers struct { + Fake *FakeManagementV3 + ns string +} + +var notifiersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "notifiers"} + +var notifiersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Notifier"} + +// Get takes name of the notifier, and returns the corresponding notifier object, and an error if there is any. +func (c *FakeNotifiers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Notifier, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(notifiersResource, c.ns, name), &v3.Notifier{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Notifier), err +} + +// List takes label and field selectors, and returns the list of Notifiers that match those selectors. +func (c *FakeNotifiers) List(ctx context.Context, opts v1.ListOptions) (result *v3.NotifierList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(notifiersResource, notifiersKind, c.ns, opts), &v3.NotifierList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.NotifierList{ListMeta: obj.(*v3.NotifierList).ListMeta} + for _, item := range obj.(*v3.NotifierList).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 notifiers. +func (c *FakeNotifiers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(notifiersResource, c.ns, opts)) + +} + +// Create takes the representation of a notifier and creates it. Returns the server's representation of the notifier, and an error, if there is any. +func (c *FakeNotifiers) Create(ctx context.Context, notifier *v3.Notifier, opts v1.CreateOptions) (result *v3.Notifier, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(notifiersResource, c.ns, notifier), &v3.Notifier{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Notifier), err +} + +// Update takes the representation of a notifier and updates it. Returns the server's representation of the notifier, and an error, if there is any. +func (c *FakeNotifiers) Update(ctx context.Context, notifier *v3.Notifier, opts v1.UpdateOptions) (result *v3.Notifier, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(notifiersResource, c.ns, notifier), &v3.Notifier{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Notifier), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNotifiers) UpdateStatus(ctx context.Context, notifier *v3.Notifier, opts v1.UpdateOptions) (*v3.Notifier, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(notifiersResource, "status", c.ns, notifier), &v3.Notifier{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Notifier), err +} + +// Delete takes name of the notifier and deletes it. Returns an error if one occurs. +func (c *FakeNotifiers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(notifiersResource, c.ns, name, opts), &v3.Notifier{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNotifiers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(notifiersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.NotifierList{}) + return err +} + +// Patch applies the patch and returns the patched notifier. +func (c *FakeNotifiers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Notifier, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(notifiersResource, c.ns, name, pt, data, subresources...), &v3.Notifier{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Notifier), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_oidcprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_oidcprovider.go new file mode 100644 index 00000000..3ea5293b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_oidcprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeOIDCProviders implements OIDCProviderInterface +type FakeOIDCProviders struct { + Fake *FakeManagementV3 +} + +var oidcprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "oidcproviders"} + +var oidcprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "OIDCProvider"} + +// Get takes name of the oIDCProvider, and returns the corresponding oIDCProvider object, and an error if there is any. +func (c *FakeOIDCProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.OIDCProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(oidcprovidersResource, name), &v3.OIDCProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.OIDCProvider), err +} + +// List takes label and field selectors, and returns the list of OIDCProviders that match those selectors. +func (c *FakeOIDCProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.OIDCProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(oidcprovidersResource, oidcprovidersKind, opts), &v3.OIDCProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.OIDCProviderList{ListMeta: obj.(*v3.OIDCProviderList).ListMeta} + for _, item := range obj.(*v3.OIDCProviderList).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 oIDCProviders. +func (c *FakeOIDCProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(oidcprovidersResource, opts)) +} + +// Create takes the representation of a oIDCProvider and creates it. Returns the server's representation of the oIDCProvider, and an error, if there is any. +func (c *FakeOIDCProviders) Create(ctx context.Context, oIDCProvider *v3.OIDCProvider, opts v1.CreateOptions) (result *v3.OIDCProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(oidcprovidersResource, oIDCProvider), &v3.OIDCProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.OIDCProvider), err +} + +// Update takes the representation of a oIDCProvider and updates it. Returns the server's representation of the oIDCProvider, and an error, if there is any. +func (c *FakeOIDCProviders) Update(ctx context.Context, oIDCProvider *v3.OIDCProvider, opts v1.UpdateOptions) (result *v3.OIDCProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(oidcprovidersResource, oIDCProvider), &v3.OIDCProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.OIDCProvider), err +} + +// Delete takes name of the oIDCProvider and deletes it. Returns an error if one occurs. +func (c *FakeOIDCProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(oidcprovidersResource, name, opts), &v3.OIDCProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOIDCProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(oidcprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.OIDCProviderList{}) + return err +} + +// Patch applies the patch and returns the patched oIDCProvider. +func (c *FakeOIDCProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.OIDCProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(oidcprovidersResource, name, pt, data, subresources...), &v3.OIDCProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.OIDCProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_openldapprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_openldapprovider.go new file mode 100644 index 00000000..12f7fe6f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_openldapprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeOpenLdapProviders implements OpenLdapProviderInterface +type FakeOpenLdapProviders struct { + Fake *FakeManagementV3 +} + +var openldapprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "openldapproviders"} + +var openldapprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "OpenLdapProvider"} + +// Get takes name of the openLdapProvider, and returns the corresponding openLdapProvider object, and an error if there is any. +func (c *FakeOpenLdapProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.OpenLdapProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(openldapprovidersResource, name), &v3.OpenLdapProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.OpenLdapProvider), err +} + +// List takes label and field selectors, and returns the list of OpenLdapProviders that match those selectors. +func (c *FakeOpenLdapProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.OpenLdapProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(openldapprovidersResource, openldapprovidersKind, opts), &v3.OpenLdapProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.OpenLdapProviderList{ListMeta: obj.(*v3.OpenLdapProviderList).ListMeta} + for _, item := range obj.(*v3.OpenLdapProviderList).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 openLdapProviders. +func (c *FakeOpenLdapProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(openldapprovidersResource, opts)) +} + +// Create takes the representation of a openLdapProvider and creates it. Returns the server's representation of the openLdapProvider, and an error, if there is any. +func (c *FakeOpenLdapProviders) Create(ctx context.Context, openLdapProvider *v3.OpenLdapProvider, opts v1.CreateOptions) (result *v3.OpenLdapProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(openldapprovidersResource, openLdapProvider), &v3.OpenLdapProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.OpenLdapProvider), err +} + +// Update takes the representation of a openLdapProvider and updates it. Returns the server's representation of the openLdapProvider, and an error, if there is any. +func (c *FakeOpenLdapProviders) Update(ctx context.Context, openLdapProvider *v3.OpenLdapProvider, opts v1.UpdateOptions) (result *v3.OpenLdapProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(openldapprovidersResource, openLdapProvider), &v3.OpenLdapProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.OpenLdapProvider), err +} + +// Delete takes name of the openLdapProvider and deletes it. Returns an error if one occurs. +func (c *FakeOpenLdapProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(openldapprovidersResource, name, opts), &v3.OpenLdapProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeOpenLdapProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(openldapprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.OpenLdapProviderList{}) + return err +} + +// Patch applies the patch and returns the patched openLdapProvider. +func (c *FakeOpenLdapProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.OpenLdapProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(openldapprovidersResource, name, pt, data, subresources...), &v3.OpenLdapProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.OpenLdapProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_podsecuritypolicytemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_podsecuritypolicytemplate.go new file mode 100644 index 00000000..a258d14e --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_podsecuritypolicytemplate.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePodSecurityPolicyTemplates implements PodSecurityPolicyTemplateInterface +type FakePodSecurityPolicyTemplates struct { + Fake *FakeManagementV3 +} + +var podsecuritypolicytemplatesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "podsecuritypolicytemplates"} + +var podsecuritypolicytemplatesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "PodSecurityPolicyTemplate"} + +// Get takes name of the podSecurityPolicyTemplate, and returns the corresponding podSecurityPolicyTemplate object, and an error if there is any. +func (c *FakePodSecurityPolicyTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.PodSecurityPolicyTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(podsecuritypolicytemplatesResource, name), &v3.PodSecurityPolicyTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*v3.PodSecurityPolicyTemplate), err +} + +// List takes label and field selectors, and returns the list of PodSecurityPolicyTemplates that match those selectors. +func (c *FakePodSecurityPolicyTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.PodSecurityPolicyTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(podsecuritypolicytemplatesResource, podsecuritypolicytemplatesKind, opts), &v3.PodSecurityPolicyTemplateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.PodSecurityPolicyTemplateList{ListMeta: obj.(*v3.PodSecurityPolicyTemplateList).ListMeta} + for _, item := range obj.(*v3.PodSecurityPolicyTemplateList).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 podSecurityPolicyTemplates. +func (c *FakePodSecurityPolicyTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(podsecuritypolicytemplatesResource, opts)) +} + +// Create takes the representation of a podSecurityPolicyTemplate and creates it. Returns the server's representation of the podSecurityPolicyTemplate, and an error, if there is any. +func (c *FakePodSecurityPolicyTemplates) Create(ctx context.Context, podSecurityPolicyTemplate *v3.PodSecurityPolicyTemplate, opts v1.CreateOptions) (result *v3.PodSecurityPolicyTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(podsecuritypolicytemplatesResource, podSecurityPolicyTemplate), &v3.PodSecurityPolicyTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*v3.PodSecurityPolicyTemplate), err +} + +// Update takes the representation of a podSecurityPolicyTemplate and updates it. Returns the server's representation of the podSecurityPolicyTemplate, and an error, if there is any. +func (c *FakePodSecurityPolicyTemplates) Update(ctx context.Context, podSecurityPolicyTemplate *v3.PodSecurityPolicyTemplate, opts v1.UpdateOptions) (result *v3.PodSecurityPolicyTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(podsecuritypolicytemplatesResource, podSecurityPolicyTemplate), &v3.PodSecurityPolicyTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*v3.PodSecurityPolicyTemplate), err +} + +// Delete takes name of the podSecurityPolicyTemplate and deletes it. Returns an error if one occurs. +func (c *FakePodSecurityPolicyTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(podsecuritypolicytemplatesResource, name, opts), &v3.PodSecurityPolicyTemplate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePodSecurityPolicyTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(podsecuritypolicytemplatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.PodSecurityPolicyTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched podSecurityPolicyTemplate. +func (c *FakePodSecurityPolicyTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.PodSecurityPolicyTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(podsecuritypolicytemplatesResource, name, pt, data, subresources...), &v3.PodSecurityPolicyTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*v3.PodSecurityPolicyTemplate), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_podsecuritypolicytemplateprojectbinding.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_podsecuritypolicytemplateprojectbinding.go new file mode 100644 index 00000000..accd3675 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_podsecuritypolicytemplateprojectbinding.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePodSecurityPolicyTemplateProjectBindings implements PodSecurityPolicyTemplateProjectBindingInterface +type FakePodSecurityPolicyTemplateProjectBindings struct { + Fake *FakeManagementV3 + ns string +} + +var podsecuritypolicytemplateprojectbindingsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "podsecuritypolicytemplateprojectbindings"} + +var podsecuritypolicytemplateprojectbindingsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "PodSecurityPolicyTemplateProjectBinding"} + +// Get takes name of the podSecurityPolicyTemplateProjectBinding, and returns the corresponding podSecurityPolicyTemplateProjectBinding object, and an error if there is any. +func (c *FakePodSecurityPolicyTemplateProjectBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.PodSecurityPolicyTemplateProjectBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(podsecuritypolicytemplateprojectbindingsResource, c.ns, name), &v3.PodSecurityPolicyTemplateProjectBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.PodSecurityPolicyTemplateProjectBinding), err +} + +// List takes label and field selectors, and returns the list of PodSecurityPolicyTemplateProjectBindings that match those selectors. +func (c *FakePodSecurityPolicyTemplateProjectBindings) List(ctx context.Context, opts v1.ListOptions) (result *v3.PodSecurityPolicyTemplateProjectBindingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(podsecuritypolicytemplateprojectbindingsResource, podsecuritypolicytemplateprojectbindingsKind, c.ns, opts), &v3.PodSecurityPolicyTemplateProjectBindingList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.PodSecurityPolicyTemplateProjectBindingList{ListMeta: obj.(*v3.PodSecurityPolicyTemplateProjectBindingList).ListMeta} + for _, item := range obj.(*v3.PodSecurityPolicyTemplateProjectBindingList).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 podSecurityPolicyTemplateProjectBindings. +func (c *FakePodSecurityPolicyTemplateProjectBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(podsecuritypolicytemplateprojectbindingsResource, c.ns, opts)) + +} + +// Create takes the representation of a podSecurityPolicyTemplateProjectBinding and creates it. Returns the server's representation of the podSecurityPolicyTemplateProjectBinding, and an error, if there is any. +func (c *FakePodSecurityPolicyTemplateProjectBindings) Create(ctx context.Context, podSecurityPolicyTemplateProjectBinding *v3.PodSecurityPolicyTemplateProjectBinding, opts v1.CreateOptions) (result *v3.PodSecurityPolicyTemplateProjectBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(podsecuritypolicytemplateprojectbindingsResource, c.ns, podSecurityPolicyTemplateProjectBinding), &v3.PodSecurityPolicyTemplateProjectBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.PodSecurityPolicyTemplateProjectBinding), err +} + +// Update takes the representation of a podSecurityPolicyTemplateProjectBinding and updates it. Returns the server's representation of the podSecurityPolicyTemplateProjectBinding, and an error, if there is any. +func (c *FakePodSecurityPolicyTemplateProjectBindings) Update(ctx context.Context, podSecurityPolicyTemplateProjectBinding *v3.PodSecurityPolicyTemplateProjectBinding, opts v1.UpdateOptions) (result *v3.PodSecurityPolicyTemplateProjectBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(podsecuritypolicytemplateprojectbindingsResource, c.ns, podSecurityPolicyTemplateProjectBinding), &v3.PodSecurityPolicyTemplateProjectBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.PodSecurityPolicyTemplateProjectBinding), err +} + +// Delete takes name of the podSecurityPolicyTemplateProjectBinding and deletes it. Returns an error if one occurs. +func (c *FakePodSecurityPolicyTemplateProjectBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(podsecuritypolicytemplateprojectbindingsResource, c.ns, name, opts), &v3.PodSecurityPolicyTemplateProjectBinding{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePodSecurityPolicyTemplateProjectBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(podsecuritypolicytemplateprojectbindingsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.PodSecurityPolicyTemplateProjectBindingList{}) + return err +} + +// Patch applies the patch and returns the patched podSecurityPolicyTemplateProjectBinding. +func (c *FakePodSecurityPolicyTemplateProjectBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.PodSecurityPolicyTemplateProjectBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(podsecuritypolicytemplateprojectbindingsResource, c.ns, name, pt, data, subresources...), &v3.PodSecurityPolicyTemplateProjectBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.PodSecurityPolicyTemplateProjectBinding), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_preference.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_preference.go new file mode 100644 index 00000000..929eacba --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_preference.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePreferences implements PreferenceInterface +type FakePreferences struct { + Fake *FakeManagementV3 + ns string +} + +var preferencesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "preferences"} + +var preferencesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Preference"} + +// Get takes name of the preference, and returns the corresponding preference object, and an error if there is any. +func (c *FakePreferences) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Preference, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(preferencesResource, c.ns, name), &v3.Preference{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Preference), err +} + +// List takes label and field selectors, and returns the list of Preferences that match those selectors. +func (c *FakePreferences) List(ctx context.Context, opts v1.ListOptions) (result *v3.PreferenceList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(preferencesResource, preferencesKind, c.ns, opts), &v3.PreferenceList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.PreferenceList{ListMeta: obj.(*v3.PreferenceList).ListMeta} + for _, item := range obj.(*v3.PreferenceList).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 preferences. +func (c *FakePreferences) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(preferencesResource, c.ns, opts)) + +} + +// Create takes the representation of a preference and creates it. Returns the server's representation of the preference, and an error, if there is any. +func (c *FakePreferences) Create(ctx context.Context, preference *v3.Preference, opts v1.CreateOptions) (result *v3.Preference, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(preferencesResource, c.ns, preference), &v3.Preference{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Preference), err +} + +// Update takes the representation of a preference and updates it. Returns the server's representation of the preference, and an error, if there is any. +func (c *FakePreferences) Update(ctx context.Context, preference *v3.Preference, opts v1.UpdateOptions) (result *v3.Preference, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(preferencesResource, c.ns, preference), &v3.Preference{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Preference), err +} + +// Delete takes name of the preference and deletes it. Returns an error if one occurs. +func (c *FakePreferences) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(preferencesResource, c.ns, name, opts), &v3.Preference{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePreferences) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(preferencesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.PreferenceList{}) + return err +} + +// Patch applies the patch and returns the patched preference. +func (c *FakePreferences) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Preference, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(preferencesResource, c.ns, name, pt, data, subresources...), &v3.Preference{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Preference), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_principal.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_principal.go new file mode 100644 index 00000000..93146517 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_principal.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePrincipals implements PrincipalInterface +type FakePrincipals struct { + Fake *FakeManagementV3 +} + +var principalsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "principals"} + +var principalsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Principal"} + +// Get takes name of the principal, and returns the corresponding principal object, and an error if there is any. +func (c *FakePrincipals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Principal, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(principalsResource, name), &v3.Principal{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Principal), err +} + +// List takes label and field selectors, and returns the list of Principals that match those selectors. +func (c *FakePrincipals) List(ctx context.Context, opts v1.ListOptions) (result *v3.PrincipalList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(principalsResource, principalsKind, opts), &v3.PrincipalList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.PrincipalList{ListMeta: obj.(*v3.PrincipalList).ListMeta} + for _, item := range obj.(*v3.PrincipalList).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 principals. +func (c *FakePrincipals) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(principalsResource, opts)) +} + +// Create takes the representation of a principal and creates it. Returns the server's representation of the principal, and an error, if there is any. +func (c *FakePrincipals) Create(ctx context.Context, principal *v3.Principal, opts v1.CreateOptions) (result *v3.Principal, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(principalsResource, principal), &v3.Principal{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Principal), err +} + +// Update takes the representation of a principal and updates it. Returns the server's representation of the principal, and an error, if there is any. +func (c *FakePrincipals) Update(ctx context.Context, principal *v3.Principal, opts v1.UpdateOptions) (result *v3.Principal, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(principalsResource, principal), &v3.Principal{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Principal), err +} + +// Delete takes name of the principal and deletes it. Returns an error if one occurs. +func (c *FakePrincipals) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(principalsResource, name, opts), &v3.Principal{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePrincipals) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(principalsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.PrincipalList{}) + return err +} + +// Patch applies the patch and returns the patched principal. +func (c *FakePrincipals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Principal, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(principalsResource, name, pt, data, subresources...), &v3.Principal{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Principal), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_project.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_project.go new file mode 100644 index 00000000..95f4ae85 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_project.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjects implements ProjectInterface +type FakeProjects struct { + Fake *FakeManagementV3 + ns string +} + +var projectsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "projects"} + +var projectsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Project"} + +// Get takes name of the project, and returns the corresponding project object, and an error if there is any. +func (c *FakeProjects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(projectsResource, c.ns, name), &v3.Project{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Project), err +} + +// List takes label and field selectors, and returns the list of Projects that match those selectors. +func (c *FakeProjects) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(projectsResource, projectsKind, c.ns, opts), &v3.ProjectList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ProjectList{ListMeta: obj.(*v3.ProjectList).ListMeta} + for _, item := range obj.(*v3.ProjectList).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 projects. +func (c *FakeProjects) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(projectsResource, c.ns, opts)) + +} + +// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. +func (c *FakeProjects) Create(ctx context.Context, project *v3.Project, opts v1.CreateOptions) (result *v3.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(projectsResource, c.ns, project), &v3.Project{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Project), err +} + +// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. +func (c *FakeProjects) Update(ctx context.Context, project *v3.Project, opts v1.UpdateOptions) (result *v3.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(projectsResource, c.ns, project), &v3.Project{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Project), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeProjects) UpdateStatus(ctx context.Context, project *v3.Project, opts v1.UpdateOptions) (*v3.Project, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(projectsResource, "status", c.ns, project), &v3.Project{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Project), err +} + +// Delete takes name of the project and deletes it. Returns an error if one occurs. +func (c *FakeProjects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(projectsResource, c.ns, name, opts), &v3.Project{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(projectsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ProjectList{}) + return err +} + +// Patch applies the patch and returns the patched project. +func (c *FakeProjects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Project, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(projectsResource, c.ns, name, pt, data, subresources...), &v3.Project{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.Project), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectalert.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectalert.go new file mode 100644 index 00000000..589fdfb4 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectalert.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjectAlerts implements ProjectAlertInterface +type FakeProjectAlerts struct { + Fake *FakeManagementV3 + ns string +} + +var projectalertsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "projectalerts"} + +var projectalertsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectAlert"} + +// Get takes name of the projectAlert, and returns the corresponding projectAlert object, and an error if there is any. +func (c *FakeProjectAlerts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectAlert, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(projectalertsResource, c.ns, name), &v3.ProjectAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlert), err +} + +// List takes label and field selectors, and returns the list of ProjectAlerts that match those selectors. +func (c *FakeProjectAlerts) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectAlertList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(projectalertsResource, projectalertsKind, c.ns, opts), &v3.ProjectAlertList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ProjectAlertList{ListMeta: obj.(*v3.ProjectAlertList).ListMeta} + for _, item := range obj.(*v3.ProjectAlertList).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 projectAlerts. +func (c *FakeProjectAlerts) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(projectalertsResource, c.ns, opts)) + +} + +// Create takes the representation of a projectAlert and creates it. Returns the server's representation of the projectAlert, and an error, if there is any. +func (c *FakeProjectAlerts) Create(ctx context.Context, projectAlert *v3.ProjectAlert, opts v1.CreateOptions) (result *v3.ProjectAlert, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(projectalertsResource, c.ns, projectAlert), &v3.ProjectAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlert), err +} + +// Update takes the representation of a projectAlert and updates it. Returns the server's representation of the projectAlert, and an error, if there is any. +func (c *FakeProjectAlerts) Update(ctx context.Context, projectAlert *v3.ProjectAlert, opts v1.UpdateOptions) (result *v3.ProjectAlert, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(projectalertsResource, c.ns, projectAlert), &v3.ProjectAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlert), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeProjectAlerts) UpdateStatus(ctx context.Context, projectAlert *v3.ProjectAlert, opts v1.UpdateOptions) (*v3.ProjectAlert, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(projectalertsResource, "status", c.ns, projectAlert), &v3.ProjectAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlert), err +} + +// Delete takes name of the projectAlert and deletes it. Returns an error if one occurs. +func (c *FakeProjectAlerts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(projectalertsResource, c.ns, name, opts), &v3.ProjectAlert{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectAlerts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(projectalertsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ProjectAlertList{}) + return err +} + +// Patch applies the patch and returns the patched projectAlert. +func (c *FakeProjectAlerts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectAlert, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(projectalertsResource, c.ns, name, pt, data, subresources...), &v3.ProjectAlert{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlert), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectalertgroup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectalertgroup.go new file mode 100644 index 00000000..f5fa3680 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectalertgroup.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjectAlertGroups implements ProjectAlertGroupInterface +type FakeProjectAlertGroups struct { + Fake *FakeManagementV3 + ns string +} + +var projectalertgroupsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "projectalertgroups"} + +var projectalertgroupsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectAlertGroup"} + +// Get takes name of the projectAlertGroup, and returns the corresponding projectAlertGroup object, and an error if there is any. +func (c *FakeProjectAlertGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectAlertGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(projectalertgroupsResource, c.ns, name), &v3.ProjectAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertGroup), err +} + +// List takes label and field selectors, and returns the list of ProjectAlertGroups that match those selectors. +func (c *FakeProjectAlertGroups) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectAlertGroupList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(projectalertgroupsResource, projectalertgroupsKind, c.ns, opts), &v3.ProjectAlertGroupList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ProjectAlertGroupList{ListMeta: obj.(*v3.ProjectAlertGroupList).ListMeta} + for _, item := range obj.(*v3.ProjectAlertGroupList).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 projectAlertGroups. +func (c *FakeProjectAlertGroups) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(projectalertgroupsResource, c.ns, opts)) + +} + +// Create takes the representation of a projectAlertGroup and creates it. Returns the server's representation of the projectAlertGroup, and an error, if there is any. +func (c *FakeProjectAlertGroups) Create(ctx context.Context, projectAlertGroup *v3.ProjectAlertGroup, opts v1.CreateOptions) (result *v3.ProjectAlertGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(projectalertgroupsResource, c.ns, projectAlertGroup), &v3.ProjectAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertGroup), err +} + +// Update takes the representation of a projectAlertGroup and updates it. Returns the server's representation of the projectAlertGroup, and an error, if there is any. +func (c *FakeProjectAlertGroups) Update(ctx context.Context, projectAlertGroup *v3.ProjectAlertGroup, opts v1.UpdateOptions) (result *v3.ProjectAlertGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(projectalertgroupsResource, c.ns, projectAlertGroup), &v3.ProjectAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertGroup), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeProjectAlertGroups) UpdateStatus(ctx context.Context, projectAlertGroup *v3.ProjectAlertGroup, opts v1.UpdateOptions) (*v3.ProjectAlertGroup, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(projectalertgroupsResource, "status", c.ns, projectAlertGroup), &v3.ProjectAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertGroup), err +} + +// Delete takes name of the projectAlertGroup and deletes it. Returns an error if one occurs. +func (c *FakeProjectAlertGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(projectalertgroupsResource, c.ns, name, opts), &v3.ProjectAlertGroup{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectAlertGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(projectalertgroupsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ProjectAlertGroupList{}) + return err +} + +// Patch applies the patch and returns the patched projectAlertGroup. +func (c *FakeProjectAlertGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectAlertGroup, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(projectalertgroupsResource, c.ns, name, pt, data, subresources...), &v3.ProjectAlertGroup{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertGroup), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectalertrule.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectalertrule.go new file mode 100644 index 00000000..1ed2ce54 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectalertrule.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjectAlertRules implements ProjectAlertRuleInterface +type FakeProjectAlertRules struct { + Fake *FakeManagementV3 + ns string +} + +var projectalertrulesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "projectalertrules"} + +var projectalertrulesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectAlertRule"} + +// Get takes name of the projectAlertRule, and returns the corresponding projectAlertRule object, and an error if there is any. +func (c *FakeProjectAlertRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectAlertRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(projectalertrulesResource, c.ns, name), &v3.ProjectAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertRule), err +} + +// List takes label and field selectors, and returns the list of ProjectAlertRules that match those selectors. +func (c *FakeProjectAlertRules) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectAlertRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(projectalertrulesResource, projectalertrulesKind, c.ns, opts), &v3.ProjectAlertRuleList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ProjectAlertRuleList{ListMeta: obj.(*v3.ProjectAlertRuleList).ListMeta} + for _, item := range obj.(*v3.ProjectAlertRuleList).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 projectAlertRules. +func (c *FakeProjectAlertRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(projectalertrulesResource, c.ns, opts)) + +} + +// Create takes the representation of a projectAlertRule and creates it. Returns the server's representation of the projectAlertRule, and an error, if there is any. +func (c *FakeProjectAlertRules) Create(ctx context.Context, projectAlertRule *v3.ProjectAlertRule, opts v1.CreateOptions) (result *v3.ProjectAlertRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(projectalertrulesResource, c.ns, projectAlertRule), &v3.ProjectAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertRule), err +} + +// Update takes the representation of a projectAlertRule and updates it. Returns the server's representation of the projectAlertRule, and an error, if there is any. +func (c *FakeProjectAlertRules) Update(ctx context.Context, projectAlertRule *v3.ProjectAlertRule, opts v1.UpdateOptions) (result *v3.ProjectAlertRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(projectalertrulesResource, c.ns, projectAlertRule), &v3.ProjectAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertRule), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeProjectAlertRules) UpdateStatus(ctx context.Context, projectAlertRule *v3.ProjectAlertRule, opts v1.UpdateOptions) (*v3.ProjectAlertRule, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(projectalertrulesResource, "status", c.ns, projectAlertRule), &v3.ProjectAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertRule), err +} + +// Delete takes name of the projectAlertRule and deletes it. Returns an error if one occurs. +func (c *FakeProjectAlertRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(projectalertrulesResource, c.ns, name, opts), &v3.ProjectAlertRule{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectAlertRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(projectalertrulesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ProjectAlertRuleList{}) + return err +} + +// Patch applies the patch and returns the patched projectAlertRule. +func (c *FakeProjectAlertRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectAlertRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(projectalertrulesResource, c.ns, name, pt, data, subresources...), &v3.ProjectAlertRule{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectAlertRule), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectcatalog.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectcatalog.go new file mode 100644 index 00000000..9699d46e --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectcatalog.go @@ -0,0 +1,118 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjectCatalogs implements ProjectCatalogInterface +type FakeProjectCatalogs struct { + Fake *FakeManagementV3 + ns string +} + +var projectcatalogsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "projectcatalogs"} + +var projectcatalogsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectCatalog"} + +// Get takes name of the projectCatalog, and returns the corresponding projectCatalog object, and an error if there is any. +func (c *FakeProjectCatalogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectCatalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(projectcatalogsResource, c.ns, name), &v3.ProjectCatalog{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectCatalog), err +} + +// List takes label and field selectors, and returns the list of ProjectCatalogs that match those selectors. +func (c *FakeProjectCatalogs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectCatalogList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(projectcatalogsResource, projectcatalogsKind, c.ns, opts), &v3.ProjectCatalogList{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectCatalogList), err +} + +// Watch returns a watch.Interface that watches the requested projectCatalogs. +func (c *FakeProjectCatalogs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(projectcatalogsResource, c.ns, opts)) + +} + +// Create takes the representation of a projectCatalog and creates it. Returns the server's representation of the projectCatalog, and an error, if there is any. +func (c *FakeProjectCatalogs) Create(ctx context.Context, projectCatalog *v3.ProjectCatalog, opts v1.CreateOptions) (result *v3.ProjectCatalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(projectcatalogsResource, c.ns, projectCatalog), &v3.ProjectCatalog{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectCatalog), err +} + +// Update takes the representation of a projectCatalog and updates it. Returns the server's representation of the projectCatalog, and an error, if there is any. +func (c *FakeProjectCatalogs) Update(ctx context.Context, projectCatalog *v3.ProjectCatalog, opts v1.UpdateOptions) (result *v3.ProjectCatalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(projectcatalogsResource, c.ns, projectCatalog), &v3.ProjectCatalog{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectCatalog), err +} + +// Delete takes name of the projectCatalog and deletes it. Returns an error if one occurs. +func (c *FakeProjectCatalogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(projectcatalogsResource, c.ns, name, opts), &v3.ProjectCatalog{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectCatalogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(projectcatalogsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ProjectCatalogList{}) + return err +} + +// Patch applies the patch and returns the patched projectCatalog. +func (c *FakeProjectCatalogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectCatalog, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(projectcatalogsResource, c.ns, name, pt, data, subresources...), &v3.ProjectCatalog{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectCatalog), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectlogging.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectlogging.go new file mode 100644 index 00000000..aaff2704 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectlogging.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjectLoggings implements ProjectLoggingInterface +type FakeProjectLoggings struct { + Fake *FakeManagementV3 + ns string +} + +var projectloggingsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "projectloggings"} + +var projectloggingsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectLogging"} + +// Get takes name of the projectLogging, and returns the corresponding projectLogging object, and an error if there is any. +func (c *FakeProjectLoggings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectLogging, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(projectloggingsResource, c.ns, name), &v3.ProjectLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectLogging), err +} + +// List takes label and field selectors, and returns the list of ProjectLoggings that match those selectors. +func (c *FakeProjectLoggings) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectLoggingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(projectloggingsResource, projectloggingsKind, c.ns, opts), &v3.ProjectLoggingList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ProjectLoggingList{ListMeta: obj.(*v3.ProjectLoggingList).ListMeta} + for _, item := range obj.(*v3.ProjectLoggingList).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 projectLoggings. +func (c *FakeProjectLoggings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(projectloggingsResource, c.ns, opts)) + +} + +// Create takes the representation of a projectLogging and creates it. Returns the server's representation of the projectLogging, and an error, if there is any. +func (c *FakeProjectLoggings) Create(ctx context.Context, projectLogging *v3.ProjectLogging, opts v1.CreateOptions) (result *v3.ProjectLogging, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(projectloggingsResource, c.ns, projectLogging), &v3.ProjectLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectLogging), err +} + +// Update takes the representation of a projectLogging and updates it. Returns the server's representation of the projectLogging, and an error, if there is any. +func (c *FakeProjectLoggings) Update(ctx context.Context, projectLogging *v3.ProjectLogging, opts v1.UpdateOptions) (result *v3.ProjectLogging, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(projectloggingsResource, c.ns, projectLogging), &v3.ProjectLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectLogging), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeProjectLoggings) UpdateStatus(ctx context.Context, projectLogging *v3.ProjectLogging, opts v1.UpdateOptions) (*v3.ProjectLogging, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(projectloggingsResource, "status", c.ns, projectLogging), &v3.ProjectLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectLogging), err +} + +// Delete takes name of the projectLogging and deletes it. Returns an error if one occurs. +func (c *FakeProjectLoggings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(projectloggingsResource, c.ns, name, opts), &v3.ProjectLogging{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectLoggings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(projectloggingsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ProjectLoggingList{}) + return err +} + +// Patch applies the patch and returns the patched projectLogging. +func (c *FakeProjectLoggings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectLogging, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(projectloggingsResource, c.ns, name, pt, data, subresources...), &v3.ProjectLogging{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectLogging), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectmonitorgraph.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectmonitorgraph.go new file mode 100644 index 00000000..daf05274 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectmonitorgraph.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjectMonitorGraphs implements ProjectMonitorGraphInterface +type FakeProjectMonitorGraphs struct { + Fake *FakeManagementV3 + ns string +} + +var projectmonitorgraphsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "projectmonitorgraphs"} + +var projectmonitorgraphsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectMonitorGraph"} + +// Get takes name of the projectMonitorGraph, and returns the corresponding projectMonitorGraph object, and an error if there is any. +func (c *FakeProjectMonitorGraphs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectMonitorGraph, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(projectmonitorgraphsResource, c.ns, name), &v3.ProjectMonitorGraph{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectMonitorGraph), err +} + +// List takes label and field selectors, and returns the list of ProjectMonitorGraphs that match those selectors. +func (c *FakeProjectMonitorGraphs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectMonitorGraphList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(projectmonitorgraphsResource, projectmonitorgraphsKind, c.ns, opts), &v3.ProjectMonitorGraphList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ProjectMonitorGraphList{ListMeta: obj.(*v3.ProjectMonitorGraphList).ListMeta} + for _, item := range obj.(*v3.ProjectMonitorGraphList).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 projectMonitorGraphs. +func (c *FakeProjectMonitorGraphs) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(projectmonitorgraphsResource, c.ns, opts)) + +} + +// Create takes the representation of a projectMonitorGraph and creates it. Returns the server's representation of the projectMonitorGraph, and an error, if there is any. +func (c *FakeProjectMonitorGraphs) Create(ctx context.Context, projectMonitorGraph *v3.ProjectMonitorGraph, opts v1.CreateOptions) (result *v3.ProjectMonitorGraph, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(projectmonitorgraphsResource, c.ns, projectMonitorGraph), &v3.ProjectMonitorGraph{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectMonitorGraph), err +} + +// Update takes the representation of a projectMonitorGraph and updates it. Returns the server's representation of the projectMonitorGraph, and an error, if there is any. +func (c *FakeProjectMonitorGraphs) Update(ctx context.Context, projectMonitorGraph *v3.ProjectMonitorGraph, opts v1.UpdateOptions) (result *v3.ProjectMonitorGraph, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(projectmonitorgraphsResource, c.ns, projectMonitorGraph), &v3.ProjectMonitorGraph{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectMonitorGraph), err +} + +// Delete takes name of the projectMonitorGraph and deletes it. Returns an error if one occurs. +func (c *FakeProjectMonitorGraphs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(projectmonitorgraphsResource, c.ns, name, opts), &v3.ProjectMonitorGraph{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectMonitorGraphs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(projectmonitorgraphsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ProjectMonitorGraphList{}) + return err +} + +// Patch applies the patch and returns the patched projectMonitorGraph. +func (c *FakeProjectMonitorGraphs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectMonitorGraph, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(projectmonitorgraphsResource, c.ns, name, pt, data, subresources...), &v3.ProjectMonitorGraph{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectMonitorGraph), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectnetworkpolicy.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectnetworkpolicy.go new file mode 100644 index 00000000..2a60d955 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectnetworkpolicy.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjectNetworkPolicies implements ProjectNetworkPolicyInterface +type FakeProjectNetworkPolicies struct { + Fake *FakeManagementV3 + ns string +} + +var projectnetworkpoliciesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "projectnetworkpolicies"} + +var projectnetworkpoliciesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectNetworkPolicy"} + +// Get takes name of the projectNetworkPolicy, and returns the corresponding projectNetworkPolicy object, and an error if there is any. +func (c *FakeProjectNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectNetworkPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(projectnetworkpoliciesResource, c.ns, name), &v3.ProjectNetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectNetworkPolicy), err +} + +// List takes label and field selectors, and returns the list of ProjectNetworkPolicies that match those selectors. +func (c *FakeProjectNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectNetworkPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(projectnetworkpoliciesResource, projectnetworkpoliciesKind, c.ns, opts), &v3.ProjectNetworkPolicyList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ProjectNetworkPolicyList{ListMeta: obj.(*v3.ProjectNetworkPolicyList).ListMeta} + for _, item := range obj.(*v3.ProjectNetworkPolicyList).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 projectNetworkPolicies. +func (c *FakeProjectNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(projectnetworkpoliciesResource, c.ns, opts)) + +} + +// Create takes the representation of a projectNetworkPolicy and creates it. Returns the server's representation of the projectNetworkPolicy, and an error, if there is any. +func (c *FakeProjectNetworkPolicies) Create(ctx context.Context, projectNetworkPolicy *v3.ProjectNetworkPolicy, opts v1.CreateOptions) (result *v3.ProjectNetworkPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(projectnetworkpoliciesResource, c.ns, projectNetworkPolicy), &v3.ProjectNetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectNetworkPolicy), err +} + +// Update takes the representation of a projectNetworkPolicy and updates it. Returns the server's representation of the projectNetworkPolicy, and an error, if there is any. +func (c *FakeProjectNetworkPolicies) Update(ctx context.Context, projectNetworkPolicy *v3.ProjectNetworkPolicy, opts v1.UpdateOptions) (result *v3.ProjectNetworkPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(projectnetworkpoliciesResource, c.ns, projectNetworkPolicy), &v3.ProjectNetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectNetworkPolicy), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeProjectNetworkPolicies) UpdateStatus(ctx context.Context, projectNetworkPolicy *v3.ProjectNetworkPolicy, opts v1.UpdateOptions) (*v3.ProjectNetworkPolicy, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(projectnetworkpoliciesResource, "status", c.ns, projectNetworkPolicy), &v3.ProjectNetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectNetworkPolicy), err +} + +// Delete takes name of the projectNetworkPolicy and deletes it. Returns an error if one occurs. +func (c *FakeProjectNetworkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(projectnetworkpoliciesResource, c.ns, name, opts), &v3.ProjectNetworkPolicy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(projectnetworkpoliciesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ProjectNetworkPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched projectNetworkPolicy. +func (c *FakeProjectNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectNetworkPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(projectnetworkpoliciesResource, c.ns, name, pt, data, subresources...), &v3.ProjectNetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectNetworkPolicy), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectroletemplatebinding.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectroletemplatebinding.go new file mode 100644 index 00000000..6f8d332b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_projectroletemplatebinding.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProjectRoleTemplateBindings implements ProjectRoleTemplateBindingInterface +type FakeProjectRoleTemplateBindings struct { + Fake *FakeManagementV3 + ns string +} + +var projectroletemplatebindingsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "projectroletemplatebindings"} + +var projectroletemplatebindingsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "ProjectRoleTemplateBinding"} + +// Get takes name of the projectRoleTemplateBinding, and returns the corresponding projectRoleTemplateBinding object, and an error if there is any. +func (c *FakeProjectRoleTemplateBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectRoleTemplateBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(projectroletemplatebindingsResource, c.ns, name), &v3.ProjectRoleTemplateBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectRoleTemplateBinding), err +} + +// List takes label and field selectors, and returns the list of ProjectRoleTemplateBindings that match those selectors. +func (c *FakeProjectRoleTemplateBindings) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectRoleTemplateBindingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(projectroletemplatebindingsResource, projectroletemplatebindingsKind, c.ns, opts), &v3.ProjectRoleTemplateBindingList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.ProjectRoleTemplateBindingList{ListMeta: obj.(*v3.ProjectRoleTemplateBindingList).ListMeta} + for _, item := range obj.(*v3.ProjectRoleTemplateBindingList).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 projectRoleTemplateBindings. +func (c *FakeProjectRoleTemplateBindings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(projectroletemplatebindingsResource, c.ns, opts)) + +} + +// Create takes the representation of a projectRoleTemplateBinding and creates it. Returns the server's representation of the projectRoleTemplateBinding, and an error, if there is any. +func (c *FakeProjectRoleTemplateBindings) Create(ctx context.Context, projectRoleTemplateBinding *v3.ProjectRoleTemplateBinding, opts v1.CreateOptions) (result *v3.ProjectRoleTemplateBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(projectroletemplatebindingsResource, c.ns, projectRoleTemplateBinding), &v3.ProjectRoleTemplateBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectRoleTemplateBinding), err +} + +// Update takes the representation of a projectRoleTemplateBinding and updates it. Returns the server's representation of the projectRoleTemplateBinding, and an error, if there is any. +func (c *FakeProjectRoleTemplateBindings) Update(ctx context.Context, projectRoleTemplateBinding *v3.ProjectRoleTemplateBinding, opts v1.UpdateOptions) (result *v3.ProjectRoleTemplateBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(projectroletemplatebindingsResource, c.ns, projectRoleTemplateBinding), &v3.ProjectRoleTemplateBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectRoleTemplateBinding), err +} + +// Delete takes name of the projectRoleTemplateBinding and deletes it. Returns an error if one occurs. +func (c *FakeProjectRoleTemplateBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(projectroletemplatebindingsResource, c.ns, name, opts), &v3.ProjectRoleTemplateBinding{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProjectRoleTemplateBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(projectroletemplatebindingsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.ProjectRoleTemplateBindingList{}) + return err +} + +// Patch applies the patch and returns the patched projectRoleTemplateBinding. +func (c *FakeProjectRoleTemplateBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectRoleTemplateBinding, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(projectroletemplatebindingsResource, c.ns, name, pt, data, subresources...), &v3.ProjectRoleTemplateBinding{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.ProjectRoleTemplateBinding), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rancherusernotification.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rancherusernotification.go new file mode 100644 index 00000000..79741706 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rancherusernotification.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRancherUserNotifications implements RancherUserNotificationInterface +type FakeRancherUserNotifications struct { + Fake *FakeManagementV3 +} + +var rancherusernotificationsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "rancherusernotifications"} + +var rancherusernotificationsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "RancherUserNotification"} + +// Get takes name of the rancherUserNotification, and returns the corresponding rancherUserNotification object, and an error if there is any. +func (c *FakeRancherUserNotifications) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RancherUserNotification, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(rancherusernotificationsResource, name), &v3.RancherUserNotification{}) + if obj == nil { + return nil, err + } + return obj.(*v3.RancherUserNotification), err +} + +// List takes label and field selectors, and returns the list of RancherUserNotifications that match those selectors. +func (c *FakeRancherUserNotifications) List(ctx context.Context, opts v1.ListOptions) (result *v3.RancherUserNotificationList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(rancherusernotificationsResource, rancherusernotificationsKind, opts), &v3.RancherUserNotificationList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.RancherUserNotificationList{ListMeta: obj.(*v3.RancherUserNotificationList).ListMeta} + for _, item := range obj.(*v3.RancherUserNotificationList).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 rancherUserNotifications. +func (c *FakeRancherUserNotifications) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(rancherusernotificationsResource, opts)) +} + +// Create takes the representation of a rancherUserNotification and creates it. Returns the server's representation of the rancherUserNotification, and an error, if there is any. +func (c *FakeRancherUserNotifications) Create(ctx context.Context, rancherUserNotification *v3.RancherUserNotification, opts v1.CreateOptions) (result *v3.RancherUserNotification, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(rancherusernotificationsResource, rancherUserNotification), &v3.RancherUserNotification{}) + if obj == nil { + return nil, err + } + return obj.(*v3.RancherUserNotification), err +} + +// Update takes the representation of a rancherUserNotification and updates it. Returns the server's representation of the rancherUserNotification, and an error, if there is any. +func (c *FakeRancherUserNotifications) Update(ctx context.Context, rancherUserNotification *v3.RancherUserNotification, opts v1.UpdateOptions) (result *v3.RancherUserNotification, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(rancherusernotificationsResource, rancherUserNotification), &v3.RancherUserNotification{}) + if obj == nil { + return nil, err + } + return obj.(*v3.RancherUserNotification), err +} + +// Delete takes name of the rancherUserNotification and deletes it. Returns an error if one occurs. +func (c *FakeRancherUserNotifications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(rancherusernotificationsResource, name, opts), &v3.RancherUserNotification{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRancherUserNotifications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(rancherusernotificationsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.RancherUserNotificationList{}) + return err +} + +// Patch applies the patch and returns the patched rancherUserNotification. +func (c *FakeRancherUserNotifications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RancherUserNotification, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(rancherusernotificationsResource, name, pt, data, subresources...), &v3.RancherUserNotification{}) + if obj == nil { + return nil, err + } + return obj.(*v3.RancherUserNotification), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rkeaddon.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rkeaddon.go new file mode 100644 index 00000000..56ed08ad --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rkeaddon.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRkeAddons implements RkeAddonInterface +type FakeRkeAddons struct { + Fake *FakeManagementV3 + ns string +} + +var rkeaddonsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "rkeaddons"} + +var rkeaddonsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "RkeAddon"} + +// Get takes name of the rkeAddon, and returns the corresponding rkeAddon object, and an error if there is any. +func (c *FakeRkeAddons) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RkeAddon, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(rkeaddonsResource, c.ns, name), &v3.RkeAddon{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeAddon), err +} + +// List takes label and field selectors, and returns the list of RkeAddons that match those selectors. +func (c *FakeRkeAddons) List(ctx context.Context, opts v1.ListOptions) (result *v3.RkeAddonList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(rkeaddonsResource, rkeaddonsKind, c.ns, opts), &v3.RkeAddonList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.RkeAddonList{ListMeta: obj.(*v3.RkeAddonList).ListMeta} + for _, item := range obj.(*v3.RkeAddonList).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 rkeAddons. +func (c *FakeRkeAddons) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(rkeaddonsResource, c.ns, opts)) + +} + +// Create takes the representation of a rkeAddon and creates it. Returns the server's representation of the rkeAddon, and an error, if there is any. +func (c *FakeRkeAddons) Create(ctx context.Context, rkeAddon *v3.RkeAddon, opts v1.CreateOptions) (result *v3.RkeAddon, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(rkeaddonsResource, c.ns, rkeAddon), &v3.RkeAddon{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeAddon), err +} + +// Update takes the representation of a rkeAddon and updates it. Returns the server's representation of the rkeAddon, and an error, if there is any. +func (c *FakeRkeAddons) Update(ctx context.Context, rkeAddon *v3.RkeAddon, opts v1.UpdateOptions) (result *v3.RkeAddon, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(rkeaddonsResource, c.ns, rkeAddon), &v3.RkeAddon{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeAddon), err +} + +// Delete takes name of the rkeAddon and deletes it. Returns an error if one occurs. +func (c *FakeRkeAddons) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(rkeaddonsResource, c.ns, name, opts), &v3.RkeAddon{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRkeAddons) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(rkeaddonsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.RkeAddonList{}) + return err +} + +// Patch applies the patch and returns the patched rkeAddon. +func (c *FakeRkeAddons) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RkeAddon, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(rkeaddonsResource, c.ns, name, pt, data, subresources...), &v3.RkeAddon{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeAddon), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rkek8sserviceoption.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rkek8sserviceoption.go new file mode 100644 index 00000000..8b7eab06 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rkek8sserviceoption.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRkeK8sServiceOptions implements RkeK8sServiceOptionInterface +type FakeRkeK8sServiceOptions struct { + Fake *FakeManagementV3 + ns string +} + +var rkek8sserviceoptionsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "rkek8sserviceoptions"} + +var rkek8sserviceoptionsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "RkeK8sServiceOption"} + +// Get takes name of the rkeK8sServiceOption, and returns the corresponding rkeK8sServiceOption object, and an error if there is any. +func (c *FakeRkeK8sServiceOptions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RkeK8sServiceOption, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(rkek8sserviceoptionsResource, c.ns, name), &v3.RkeK8sServiceOption{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeK8sServiceOption), err +} + +// List takes label and field selectors, and returns the list of RkeK8sServiceOptions that match those selectors. +func (c *FakeRkeK8sServiceOptions) List(ctx context.Context, opts v1.ListOptions) (result *v3.RkeK8sServiceOptionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(rkek8sserviceoptionsResource, rkek8sserviceoptionsKind, c.ns, opts), &v3.RkeK8sServiceOptionList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.RkeK8sServiceOptionList{ListMeta: obj.(*v3.RkeK8sServiceOptionList).ListMeta} + for _, item := range obj.(*v3.RkeK8sServiceOptionList).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 rkeK8sServiceOptions. +func (c *FakeRkeK8sServiceOptions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(rkek8sserviceoptionsResource, c.ns, opts)) + +} + +// Create takes the representation of a rkeK8sServiceOption and creates it. Returns the server's representation of the rkeK8sServiceOption, and an error, if there is any. +func (c *FakeRkeK8sServiceOptions) Create(ctx context.Context, rkeK8sServiceOption *v3.RkeK8sServiceOption, opts v1.CreateOptions) (result *v3.RkeK8sServiceOption, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(rkek8sserviceoptionsResource, c.ns, rkeK8sServiceOption), &v3.RkeK8sServiceOption{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeK8sServiceOption), err +} + +// Update takes the representation of a rkeK8sServiceOption and updates it. Returns the server's representation of the rkeK8sServiceOption, and an error, if there is any. +func (c *FakeRkeK8sServiceOptions) Update(ctx context.Context, rkeK8sServiceOption *v3.RkeK8sServiceOption, opts v1.UpdateOptions) (result *v3.RkeK8sServiceOption, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(rkek8sserviceoptionsResource, c.ns, rkeK8sServiceOption), &v3.RkeK8sServiceOption{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeK8sServiceOption), err +} + +// Delete takes name of the rkeK8sServiceOption and deletes it. Returns an error if one occurs. +func (c *FakeRkeK8sServiceOptions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(rkek8sserviceoptionsResource, c.ns, name, opts), &v3.RkeK8sServiceOption{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRkeK8sServiceOptions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(rkek8sserviceoptionsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.RkeK8sServiceOptionList{}) + return err +} + +// Patch applies the patch and returns the patched rkeK8sServiceOption. +func (c *FakeRkeK8sServiceOptions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RkeK8sServiceOption, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(rkek8sserviceoptionsResource, c.ns, name, pt, data, subresources...), &v3.RkeK8sServiceOption{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeK8sServiceOption), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rkek8ssystemimage.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rkek8ssystemimage.go new file mode 100644 index 00000000..e1dd1d10 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_rkek8ssystemimage.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRkeK8sSystemImages implements RkeK8sSystemImageInterface +type FakeRkeK8sSystemImages struct { + Fake *FakeManagementV3 + ns string +} + +var rkek8ssystemimagesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "rkek8ssystemimages"} + +var rkek8ssystemimagesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "RkeK8sSystemImage"} + +// Get takes name of the rkeK8sSystemImage, and returns the corresponding rkeK8sSystemImage object, and an error if there is any. +func (c *FakeRkeK8sSystemImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RkeK8sSystemImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(rkek8ssystemimagesResource, c.ns, name), &v3.RkeK8sSystemImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeK8sSystemImage), err +} + +// List takes label and field selectors, and returns the list of RkeK8sSystemImages that match those selectors. +func (c *FakeRkeK8sSystemImages) List(ctx context.Context, opts v1.ListOptions) (result *v3.RkeK8sSystemImageList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(rkek8ssystemimagesResource, rkek8ssystemimagesKind, c.ns, opts), &v3.RkeK8sSystemImageList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.RkeK8sSystemImageList{ListMeta: obj.(*v3.RkeK8sSystemImageList).ListMeta} + for _, item := range obj.(*v3.RkeK8sSystemImageList).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 rkeK8sSystemImages. +func (c *FakeRkeK8sSystemImages) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(rkek8ssystemimagesResource, c.ns, opts)) + +} + +// Create takes the representation of a rkeK8sSystemImage and creates it. Returns the server's representation of the rkeK8sSystemImage, and an error, if there is any. +func (c *FakeRkeK8sSystemImages) Create(ctx context.Context, rkeK8sSystemImage *v3.RkeK8sSystemImage, opts v1.CreateOptions) (result *v3.RkeK8sSystemImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(rkek8ssystemimagesResource, c.ns, rkeK8sSystemImage), &v3.RkeK8sSystemImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeK8sSystemImage), err +} + +// Update takes the representation of a rkeK8sSystemImage and updates it. Returns the server's representation of the rkeK8sSystemImage, and an error, if there is any. +func (c *FakeRkeK8sSystemImages) Update(ctx context.Context, rkeK8sSystemImage *v3.RkeK8sSystemImage, opts v1.UpdateOptions) (result *v3.RkeK8sSystemImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(rkek8ssystemimagesResource, c.ns, rkeK8sSystemImage), &v3.RkeK8sSystemImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeK8sSystemImage), err +} + +// Delete takes name of the rkeK8sSystemImage and deletes it. Returns an error if one occurs. +func (c *FakeRkeK8sSystemImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(rkek8ssystemimagesResource, c.ns, name, opts), &v3.RkeK8sSystemImage{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRkeK8sSystemImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(rkek8ssystemimagesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v3.RkeK8sSystemImageList{}) + return err +} + +// Patch applies the patch and returns the patched rkeK8sSystemImage. +func (c *FakeRkeK8sSystemImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RkeK8sSystemImage, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(rkek8ssystemimagesResource, c.ns, name, pt, data, subresources...), &v3.RkeK8sSystemImage{}) + + if obj == nil { + return nil, err + } + return obj.(*v3.RkeK8sSystemImage), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_roletemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_roletemplate.go new file mode 100644 index 00000000..4f96f859 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_roletemplate.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeRoleTemplates implements RoleTemplateInterface +type FakeRoleTemplates struct { + Fake *FakeManagementV3 +} + +var roletemplatesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "roletemplates"} + +var roletemplatesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "RoleTemplate"} + +// Get takes name of the roleTemplate, and returns the corresponding roleTemplate object, and an error if there is any. +func (c *FakeRoleTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RoleTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(roletemplatesResource, name), &v3.RoleTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*v3.RoleTemplate), err +} + +// List takes label and field selectors, and returns the list of RoleTemplates that match those selectors. +func (c *FakeRoleTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.RoleTemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(roletemplatesResource, roletemplatesKind, opts), &v3.RoleTemplateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.RoleTemplateList{ListMeta: obj.(*v3.RoleTemplateList).ListMeta} + for _, item := range obj.(*v3.RoleTemplateList).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 roleTemplates. +func (c *FakeRoleTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(roletemplatesResource, opts)) +} + +// Create takes the representation of a roleTemplate and creates it. Returns the server's representation of the roleTemplate, and an error, if there is any. +func (c *FakeRoleTemplates) Create(ctx context.Context, roleTemplate *v3.RoleTemplate, opts v1.CreateOptions) (result *v3.RoleTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(roletemplatesResource, roleTemplate), &v3.RoleTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*v3.RoleTemplate), err +} + +// Update takes the representation of a roleTemplate and updates it. Returns the server's representation of the roleTemplate, and an error, if there is any. +func (c *FakeRoleTemplates) Update(ctx context.Context, roleTemplate *v3.RoleTemplate, opts v1.UpdateOptions) (result *v3.RoleTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(roletemplatesResource, roleTemplate), &v3.RoleTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*v3.RoleTemplate), err +} + +// Delete takes name of the roleTemplate and deletes it. Returns an error if one occurs. +func (c *FakeRoleTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(roletemplatesResource, name, opts), &v3.RoleTemplate{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeRoleTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(roletemplatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.RoleTemplateList{}) + return err +} + +// Patch applies the patch and returns the patched roleTemplate. +func (c *FakeRoleTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RoleTemplate, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(roletemplatesResource, name, pt, data, subresources...), &v3.RoleTemplate{}) + if obj == nil { + return nil, err + } + return obj.(*v3.RoleTemplate), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_samlprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_samlprovider.go new file mode 100644 index 00000000..8836e1f0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_samlprovider.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSamlProviders implements SamlProviderInterface +type FakeSamlProviders struct { + Fake *FakeManagementV3 +} + +var samlprovidersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "samlproviders"} + +var samlprovidersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "SamlProvider"} + +// Get takes name of the samlProvider, and returns the corresponding samlProvider object, and an error if there is any. +func (c *FakeSamlProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.SamlProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(samlprovidersResource, name), &v3.SamlProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.SamlProvider), err +} + +// List takes label and field selectors, and returns the list of SamlProviders that match those selectors. +func (c *FakeSamlProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.SamlProviderList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(samlprovidersResource, samlprovidersKind, opts), &v3.SamlProviderList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.SamlProviderList{ListMeta: obj.(*v3.SamlProviderList).ListMeta} + for _, item := range obj.(*v3.SamlProviderList).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 samlProviders. +func (c *FakeSamlProviders) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(samlprovidersResource, opts)) +} + +// Create takes the representation of a samlProvider and creates it. Returns the server's representation of the samlProvider, and an error, if there is any. +func (c *FakeSamlProviders) Create(ctx context.Context, samlProvider *v3.SamlProvider, opts v1.CreateOptions) (result *v3.SamlProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(samlprovidersResource, samlProvider), &v3.SamlProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.SamlProvider), err +} + +// Update takes the representation of a samlProvider and updates it. Returns the server's representation of the samlProvider, and an error, if there is any. +func (c *FakeSamlProviders) Update(ctx context.Context, samlProvider *v3.SamlProvider, opts v1.UpdateOptions) (result *v3.SamlProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(samlprovidersResource, samlProvider), &v3.SamlProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.SamlProvider), err +} + +// Delete takes name of the samlProvider and deletes it. Returns an error if one occurs. +func (c *FakeSamlProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(samlprovidersResource, name, opts), &v3.SamlProvider{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSamlProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(samlprovidersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.SamlProviderList{}) + return err +} + +// Patch applies the patch and returns the patched samlProvider. +func (c *FakeSamlProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.SamlProvider, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(samlprovidersResource, name, pt, data, subresources...), &v3.SamlProvider{}) + if obj == nil { + return nil, err + } + return obj.(*v3.SamlProvider), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_samltoken.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_samltoken.go new file mode 100644 index 00000000..873df372 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_samltoken.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSamlTokens implements SamlTokenInterface +type FakeSamlTokens struct { + Fake *FakeManagementV3 +} + +var samltokensResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "samltokens"} + +var samltokensKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "SamlToken"} + +// Get takes name of the samlToken, and returns the corresponding samlToken object, and an error if there is any. +func (c *FakeSamlTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.SamlToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(samltokensResource, name), &v3.SamlToken{}) + if obj == nil { + return nil, err + } + return obj.(*v3.SamlToken), err +} + +// List takes label and field selectors, and returns the list of SamlTokens that match those selectors. +func (c *FakeSamlTokens) List(ctx context.Context, opts v1.ListOptions) (result *v3.SamlTokenList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(samltokensResource, samltokensKind, opts), &v3.SamlTokenList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.SamlTokenList{ListMeta: obj.(*v3.SamlTokenList).ListMeta} + for _, item := range obj.(*v3.SamlTokenList).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 samlTokens. +func (c *FakeSamlTokens) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(samltokensResource, opts)) +} + +// Create takes the representation of a samlToken and creates it. Returns the server's representation of the samlToken, and an error, if there is any. +func (c *FakeSamlTokens) Create(ctx context.Context, samlToken *v3.SamlToken, opts v1.CreateOptions) (result *v3.SamlToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(samltokensResource, samlToken), &v3.SamlToken{}) + if obj == nil { + return nil, err + } + return obj.(*v3.SamlToken), err +} + +// Update takes the representation of a samlToken and updates it. Returns the server's representation of the samlToken, and an error, if there is any. +func (c *FakeSamlTokens) Update(ctx context.Context, samlToken *v3.SamlToken, opts v1.UpdateOptions) (result *v3.SamlToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(samltokensResource, samlToken), &v3.SamlToken{}) + if obj == nil { + return nil, err + } + return obj.(*v3.SamlToken), err +} + +// Delete takes name of the samlToken and deletes it. Returns an error if one occurs. +func (c *FakeSamlTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(samltokensResource, name, opts), &v3.SamlToken{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSamlTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(samltokensResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.SamlTokenList{}) + return err +} + +// Patch applies the patch and returns the patched samlToken. +func (c *FakeSamlTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.SamlToken, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(samltokensResource, name, pt, data, subresources...), &v3.SamlToken{}) + if obj == nil { + return nil, err + } + return obj.(*v3.SamlToken), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_setting.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_setting.go new file mode 100644 index 00000000..ca4c12d5 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_setting.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeSettings implements SettingInterface +type FakeSettings struct { + Fake *FakeManagementV3 +} + +var settingsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "settings"} + +var settingsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Setting"} + +// Get takes name of the setting, and returns the corresponding setting object, and an error if there is any. +func (c *FakeSettings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(settingsResource, name), &v3.Setting{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Setting), err +} + +// List takes label and field selectors, and returns the list of Settings that match those selectors. +func (c *FakeSettings) List(ctx context.Context, opts v1.ListOptions) (result *v3.SettingList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(settingsResource, settingsKind, opts), &v3.SettingList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.SettingList{ListMeta: obj.(*v3.SettingList).ListMeta} + for _, item := range obj.(*v3.SettingList).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 settings. +func (c *FakeSettings) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(settingsResource, opts)) +} + +// Create takes the representation of a setting and creates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *FakeSettings) Create(ctx context.Context, setting *v3.Setting, opts v1.CreateOptions) (result *v3.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(settingsResource, setting), &v3.Setting{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Setting), err +} + +// Update takes the representation of a setting and updates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *FakeSettings) Update(ctx context.Context, setting *v3.Setting, opts v1.UpdateOptions) (result *v3.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(settingsResource, setting), &v3.Setting{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Setting), err +} + +// Delete takes name of the setting and deletes it. Returns an error if one occurs. +func (c *FakeSettings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(settingsResource, name, opts), &v3.Setting{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeSettings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(settingsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.SettingList{}) + return err +} + +// Patch applies the patch and returns the patched setting. +func (c *FakeSettings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Setting, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(settingsResource, name, pt, data, subresources...), &v3.Setting{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Setting), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_template.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_template.go new file mode 100644 index 00000000..98ec5750 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_template.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeTemplates implements TemplateInterface +type FakeTemplates struct { + Fake *FakeManagementV3 +} + +var templatesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "templates"} + +var templatesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Template"} + +// Get takes name of the template, and returns the corresponding template object, and an error if there is any. +func (c *FakeTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Template, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(templatesResource, name), &v3.Template{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Template), err +} + +// List takes label and field selectors, and returns the list of Templates that match those selectors. +func (c *FakeTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.TemplateList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(templatesResource, templatesKind, opts), &v3.TemplateList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.TemplateList{ListMeta: obj.(*v3.TemplateList).ListMeta} + for _, item := range obj.(*v3.TemplateList).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 templates. +func (c *FakeTemplates) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(templatesResource, opts)) +} + +// Create takes the representation of a template and creates it. Returns the server's representation of the template, and an error, if there is any. +func (c *FakeTemplates) Create(ctx context.Context, template *v3.Template, opts v1.CreateOptions) (result *v3.Template, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(templatesResource, template), &v3.Template{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Template), err +} + +// Update takes the representation of a template and updates it. Returns the server's representation of the template, and an error, if there is any. +func (c *FakeTemplates) Update(ctx context.Context, template *v3.Template, opts v1.UpdateOptions) (result *v3.Template, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(templatesResource, template), &v3.Template{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Template), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTemplates) UpdateStatus(ctx context.Context, template *v3.Template, opts v1.UpdateOptions) (*v3.Template, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(templatesResource, "status", template), &v3.Template{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Template), err +} + +// Delete takes name of the template and deletes it. Returns an error if one occurs. +func (c *FakeTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(templatesResource, name, opts), &v3.Template{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(templatesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.TemplateList{}) + return err +} + +// Patch applies the patch and returns the patched template. +func (c *FakeTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Template, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(templatesResource, name, pt, data, subresources...), &v3.Template{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Template), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_templatecontent.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_templatecontent.go new file mode 100644 index 00000000..d3449c64 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_templatecontent.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeTemplateContents implements TemplateContentInterface +type FakeTemplateContents struct { + Fake *FakeManagementV3 +} + +var templatecontentsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "templatecontents"} + +var templatecontentsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "TemplateContent"} + +// Get takes name of the templateContent, and returns the corresponding templateContent object, and an error if there is any. +func (c *FakeTemplateContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.TemplateContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(templatecontentsResource, name), &v3.TemplateContent{}) + if obj == nil { + return nil, err + } + return obj.(*v3.TemplateContent), err +} + +// List takes label and field selectors, and returns the list of TemplateContents that match those selectors. +func (c *FakeTemplateContents) List(ctx context.Context, opts v1.ListOptions) (result *v3.TemplateContentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(templatecontentsResource, templatecontentsKind, opts), &v3.TemplateContentList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.TemplateContentList{ListMeta: obj.(*v3.TemplateContentList).ListMeta} + for _, item := range obj.(*v3.TemplateContentList).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 templateContents. +func (c *FakeTemplateContents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(templatecontentsResource, opts)) +} + +// Create takes the representation of a templateContent and creates it. Returns the server's representation of the templateContent, and an error, if there is any. +func (c *FakeTemplateContents) Create(ctx context.Context, templateContent *v3.TemplateContent, opts v1.CreateOptions) (result *v3.TemplateContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(templatecontentsResource, templateContent), &v3.TemplateContent{}) + if obj == nil { + return nil, err + } + return obj.(*v3.TemplateContent), err +} + +// Update takes the representation of a templateContent and updates it. Returns the server's representation of the templateContent, and an error, if there is any. +func (c *FakeTemplateContents) Update(ctx context.Context, templateContent *v3.TemplateContent, opts v1.UpdateOptions) (result *v3.TemplateContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(templatecontentsResource, templateContent), &v3.TemplateContent{}) + if obj == nil { + return nil, err + } + return obj.(*v3.TemplateContent), err +} + +// Delete takes name of the templateContent and deletes it. Returns an error if one occurs. +func (c *FakeTemplateContents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(templatecontentsResource, name, opts), &v3.TemplateContent{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTemplateContents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(templatecontentsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.TemplateContentList{}) + return err +} + +// Patch applies the patch and returns the patched templateContent. +func (c *FakeTemplateContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.TemplateContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(templatecontentsResource, name, pt, data, subresources...), &v3.TemplateContent{}) + if obj == nil { + return nil, err + } + return obj.(*v3.TemplateContent), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_templateversion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_templateversion.go new file mode 100644 index 00000000..25f3da1a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_templateversion.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeTemplateVersions implements TemplateVersionInterface +type FakeTemplateVersions struct { + Fake *FakeManagementV3 +} + +var templateversionsResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "templateversions"} + +var templateversionsKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "TemplateVersion"} + +// Get takes name of the templateVersion, and returns the corresponding templateVersion object, and an error if there is any. +func (c *FakeTemplateVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.TemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(templateversionsResource, name), &v3.TemplateVersion{}) + if obj == nil { + return nil, err + } + return obj.(*v3.TemplateVersion), err +} + +// List takes label and field selectors, and returns the list of TemplateVersions that match those selectors. +func (c *FakeTemplateVersions) List(ctx context.Context, opts v1.ListOptions) (result *v3.TemplateVersionList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(templateversionsResource, templateversionsKind, opts), &v3.TemplateVersionList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.TemplateVersionList{ListMeta: obj.(*v3.TemplateVersionList).ListMeta} + for _, item := range obj.(*v3.TemplateVersionList).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 templateVersions. +func (c *FakeTemplateVersions) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(templateversionsResource, opts)) +} + +// Create takes the representation of a templateVersion and creates it. Returns the server's representation of the templateVersion, and an error, if there is any. +func (c *FakeTemplateVersions) Create(ctx context.Context, templateVersion *v3.TemplateVersion, opts v1.CreateOptions) (result *v3.TemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(templateversionsResource, templateVersion), &v3.TemplateVersion{}) + if obj == nil { + return nil, err + } + return obj.(*v3.TemplateVersion), err +} + +// Update takes the representation of a templateVersion and updates it. Returns the server's representation of the templateVersion, and an error, if there is any. +func (c *FakeTemplateVersions) Update(ctx context.Context, templateVersion *v3.TemplateVersion, opts v1.UpdateOptions) (result *v3.TemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(templateversionsResource, templateVersion), &v3.TemplateVersion{}) + if obj == nil { + return nil, err + } + return obj.(*v3.TemplateVersion), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeTemplateVersions) UpdateStatus(ctx context.Context, templateVersion *v3.TemplateVersion, opts v1.UpdateOptions) (*v3.TemplateVersion, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(templateversionsResource, "status", templateVersion), &v3.TemplateVersion{}) + if obj == nil { + return nil, err + } + return obj.(*v3.TemplateVersion), err +} + +// Delete takes name of the templateVersion and deletes it. Returns an error if one occurs. +func (c *FakeTemplateVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(templateversionsResource, name, opts), &v3.TemplateVersion{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTemplateVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(templateversionsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.TemplateVersionList{}) + return err +} + +// Patch applies the patch and returns the patched templateVersion. +func (c *FakeTemplateVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.TemplateVersion, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(templateversionsResource, name, pt, data, subresources...), &v3.TemplateVersion{}) + if obj == nil { + return nil, err + } + return obj.(*v3.TemplateVersion), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_token.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_token.go new file mode 100644 index 00000000..ce565263 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_token.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeTokens implements TokenInterface +type FakeTokens struct { + Fake *FakeManagementV3 +} + +var tokensResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "tokens"} + +var tokensKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "Token"} + +// Get takes name of the token, and returns the corresponding token object, and an error if there is any. +func (c *FakeTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Token, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(tokensResource, name), &v3.Token{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Token), err +} + +// List takes label and field selectors, and returns the list of Tokens that match those selectors. +func (c *FakeTokens) List(ctx context.Context, opts v1.ListOptions) (result *v3.TokenList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(tokensResource, tokensKind, opts), &v3.TokenList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.TokenList{ListMeta: obj.(*v3.TokenList).ListMeta} + for _, item := range obj.(*v3.TokenList).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 tokens. +func (c *FakeTokens) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(tokensResource, opts)) +} + +// Create takes the representation of a token and creates it. Returns the server's representation of the token, and an error, if there is any. +func (c *FakeTokens) Create(ctx context.Context, token *v3.Token, opts v1.CreateOptions) (result *v3.Token, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(tokensResource, token), &v3.Token{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Token), err +} + +// Update takes the representation of a token and updates it. Returns the server's representation of the token, and an error, if there is any. +func (c *FakeTokens) Update(ctx context.Context, token *v3.Token, opts v1.UpdateOptions) (result *v3.Token, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(tokensResource, token), &v3.Token{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Token), err +} + +// Delete takes name of the token and deletes it. Returns an error if one occurs. +func (c *FakeTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(tokensResource, name, opts), &v3.Token{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(tokensResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.TokenList{}) + return err +} + +// Patch applies the patch and returns the patched token. +func (c *FakeTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Token, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(tokensResource, name, pt, data, subresources...), &v3.Token{}) + if obj == nil { + return nil, err + } + return obj.(*v3.Token), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_user.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_user.go new file mode 100644 index 00000000..2caeff63 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_user.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeUsers implements UserInterface +type FakeUsers struct { + Fake *FakeManagementV3 +} + +var usersResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "users"} + +var usersKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "User"} + +// Get takes name of the user, and returns the corresponding user object, and an error if there is any. +func (c *FakeUsers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(usersResource, name), &v3.User{}) + if obj == nil { + return nil, err + } + return obj.(*v3.User), err +} + +// List takes label and field selectors, and returns the list of Users that match those selectors. +func (c *FakeUsers) List(ctx context.Context, opts v1.ListOptions) (result *v3.UserList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(usersResource, usersKind, opts), &v3.UserList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.UserList{ListMeta: obj.(*v3.UserList).ListMeta} + for _, item := range obj.(*v3.UserList).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 users. +func (c *FakeUsers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(usersResource, opts)) +} + +// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. +func (c *FakeUsers) Create(ctx context.Context, user *v3.User, opts v1.CreateOptions) (result *v3.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(usersResource, user), &v3.User{}) + if obj == nil { + return nil, err + } + return obj.(*v3.User), err +} + +// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. +func (c *FakeUsers) Update(ctx context.Context, user *v3.User, opts v1.UpdateOptions) (result *v3.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(usersResource, user), &v3.User{}) + if obj == nil { + return nil, err + } + return obj.(*v3.User), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeUsers) UpdateStatus(ctx context.Context, user *v3.User, opts v1.UpdateOptions) (*v3.User, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(usersResource, "status", user), &v3.User{}) + if obj == nil { + return nil, err + } + return obj.(*v3.User), err +} + +// Delete takes name of the user and deletes it. Returns an error if one occurs. +func (c *FakeUsers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(usersResource, name, opts), &v3.User{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUsers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(usersResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.UserList{}) + return err +} + +// Patch applies the patch and returns the patched user. +func (c *FakeUsers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.User, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(usersResource, name, pt, data, subresources...), &v3.User{}) + if obj == nil { + return nil, err + } + return obj.(*v3.User), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_userattribute.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_userattribute.go new file mode 100644 index 00000000..d04b2ac8 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fake/fake_userattribute.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeUserAttributes implements UserAttributeInterface +type FakeUserAttributes struct { + Fake *FakeManagementV3 +} + +var userattributesResource = schema.GroupVersionResource{Group: "management.cattle.io", Version: "v3", Resource: "userattributes"} + +var userattributesKind = schema.GroupVersionKind{Group: "management.cattle.io", Version: "v3", Kind: "UserAttribute"} + +// Get takes name of the userAttribute, and returns the corresponding userAttribute object, and an error if there is any. +func (c *FakeUserAttributes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.UserAttribute, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(userattributesResource, name), &v3.UserAttribute{}) + if obj == nil { + return nil, err + } + return obj.(*v3.UserAttribute), err +} + +// List takes label and field selectors, and returns the list of UserAttributes that match those selectors. +func (c *FakeUserAttributes) List(ctx context.Context, opts v1.ListOptions) (result *v3.UserAttributeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(userattributesResource, userattributesKind, opts), &v3.UserAttributeList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v3.UserAttributeList{ListMeta: obj.(*v3.UserAttributeList).ListMeta} + for _, item := range obj.(*v3.UserAttributeList).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 userAttributes. +func (c *FakeUserAttributes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(userattributesResource, opts)) +} + +// Create takes the representation of a userAttribute and creates it. Returns the server's representation of the userAttribute, and an error, if there is any. +func (c *FakeUserAttributes) Create(ctx context.Context, userAttribute *v3.UserAttribute, opts v1.CreateOptions) (result *v3.UserAttribute, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(userattributesResource, userAttribute), &v3.UserAttribute{}) + if obj == nil { + return nil, err + } + return obj.(*v3.UserAttribute), err +} + +// Update takes the representation of a userAttribute and updates it. Returns the server's representation of the userAttribute, and an error, if there is any. +func (c *FakeUserAttributes) Update(ctx context.Context, userAttribute *v3.UserAttribute, opts v1.UpdateOptions) (result *v3.UserAttribute, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(userattributesResource, userAttribute), &v3.UserAttribute{}) + if obj == nil { + return nil, err + } + return obj.(*v3.UserAttribute), err +} + +// Delete takes name of the userAttribute and deletes it. Returns an error if one occurs. +func (c *FakeUserAttributes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(userattributesResource, name, opts), &v3.UserAttribute{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeUserAttributes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(userattributesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v3.UserAttributeList{}) + return err +} + +// Patch applies the patch and returns the patched userAttribute. +func (c *FakeUserAttributes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.UserAttribute, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(userattributesResource, name, pt, data, subresources...), &v3.UserAttribute{}) + if obj == nil { + return nil, err + } + return obj.(*v3.UserAttribute), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/feature.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/feature.go new file mode 100644 index 00000000..fbd76b3c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/feature.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// FeaturesGetter has a method to return a FeatureInterface. +// A group's client should implement this interface. +type FeaturesGetter interface { + Features() FeatureInterface +} + +// FeatureInterface has methods to work with Feature resources. +type FeatureInterface interface { + Create(ctx context.Context, feature *v3.Feature, opts v1.CreateOptions) (*v3.Feature, error) + Update(ctx context.Context, feature *v3.Feature, opts v1.UpdateOptions) (*v3.Feature, error) + UpdateStatus(ctx context.Context, feature *v3.Feature, opts v1.UpdateOptions) (*v3.Feature, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Feature, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.FeatureList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Feature, err error) + FeatureExpansion +} + +// features implements FeatureInterface +type features struct { + client rest.Interface +} + +// newFeatures returns a Features +func newFeatures(c *ManagementV3Client) *features { + return &features{ + client: c.RESTClient(), + } +} + +// Get takes name of the feature, and returns the corresponding feature object, and an error if there is any. +func (c *features) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Feature, err error) { + result = &v3.Feature{} + err = c.client.Get(). + Resource("features"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Features that match those selectors. +func (c *features) List(ctx context.Context, opts v1.ListOptions) (result *v3.FeatureList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.FeatureList{} + err = c.client.Get(). + Resource("features"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested features. +func (c *features) Watch(ctx context.Context, 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(). + Resource("features"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a feature and creates it. Returns the server's representation of the feature, and an error, if there is any. +func (c *features) Create(ctx context.Context, feature *v3.Feature, opts v1.CreateOptions) (result *v3.Feature, err error) { + result = &v3.Feature{} + err = c.client.Post(). + Resource("features"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(feature). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a feature and updates it. Returns the server's representation of the feature, and an error, if there is any. +func (c *features) Update(ctx context.Context, feature *v3.Feature, opts v1.UpdateOptions) (result *v3.Feature, err error) { + result = &v3.Feature{} + err = c.client.Put(). + Resource("features"). + Name(feature.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(feature). + Do(ctx). + 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 *features) UpdateStatus(ctx context.Context, feature *v3.Feature, opts v1.UpdateOptions) (result *v3.Feature, err error) { + result = &v3.Feature{} + err = c.client.Put(). + Resource("features"). + Name(feature.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(feature). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the feature and deletes it. Returns an error if one occurs. +func (c *features) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("features"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *features) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("features"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched feature. +func (c *features) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Feature, err error) { + result = &v3.Feature{} + err = c.client.Patch(pt). + Resource("features"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fleetworkspace.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fleetworkspace.go new file mode 100644 index 00000000..9767028c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/fleetworkspace.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// FleetWorkspacesGetter has a method to return a FleetWorkspaceInterface. +// A group's client should implement this interface. +type FleetWorkspacesGetter interface { + FleetWorkspaces() FleetWorkspaceInterface +} + +// FleetWorkspaceInterface has methods to work with FleetWorkspace resources. +type FleetWorkspaceInterface interface { + Create(ctx context.Context, fleetWorkspace *v3.FleetWorkspace, opts v1.CreateOptions) (*v3.FleetWorkspace, error) + Update(ctx context.Context, fleetWorkspace *v3.FleetWorkspace, opts v1.UpdateOptions) (*v3.FleetWorkspace, error) + UpdateStatus(ctx context.Context, fleetWorkspace *v3.FleetWorkspace, opts v1.UpdateOptions) (*v3.FleetWorkspace, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.FleetWorkspace, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.FleetWorkspaceList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.FleetWorkspace, err error) + FleetWorkspaceExpansion +} + +// fleetWorkspaces implements FleetWorkspaceInterface +type fleetWorkspaces struct { + client rest.Interface +} + +// newFleetWorkspaces returns a FleetWorkspaces +func newFleetWorkspaces(c *ManagementV3Client) *fleetWorkspaces { + return &fleetWorkspaces{ + client: c.RESTClient(), + } +} + +// Get takes name of the fleetWorkspace, and returns the corresponding fleetWorkspace object, and an error if there is any. +func (c *fleetWorkspaces) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.FleetWorkspace, err error) { + result = &v3.FleetWorkspace{} + err = c.client.Get(). + Resource("fleetworkspaces"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of FleetWorkspaces that match those selectors. +func (c *fleetWorkspaces) List(ctx context.Context, opts v1.ListOptions) (result *v3.FleetWorkspaceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.FleetWorkspaceList{} + err = c.client.Get(). + Resource("fleetworkspaces"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested fleetWorkspaces. +func (c *fleetWorkspaces) Watch(ctx context.Context, 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(). + Resource("fleetworkspaces"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a fleetWorkspace and creates it. Returns the server's representation of the fleetWorkspace, and an error, if there is any. +func (c *fleetWorkspaces) Create(ctx context.Context, fleetWorkspace *v3.FleetWorkspace, opts v1.CreateOptions) (result *v3.FleetWorkspace, err error) { + result = &v3.FleetWorkspace{} + err = c.client.Post(). + Resource("fleetworkspaces"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(fleetWorkspace). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a fleetWorkspace and updates it. Returns the server's representation of the fleetWorkspace, and an error, if there is any. +func (c *fleetWorkspaces) Update(ctx context.Context, fleetWorkspace *v3.FleetWorkspace, opts v1.UpdateOptions) (result *v3.FleetWorkspace, err error) { + result = &v3.FleetWorkspace{} + err = c.client.Put(). + Resource("fleetworkspaces"). + Name(fleetWorkspace.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(fleetWorkspace). + Do(ctx). + 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 *fleetWorkspaces) UpdateStatus(ctx context.Context, fleetWorkspace *v3.FleetWorkspace, opts v1.UpdateOptions) (result *v3.FleetWorkspace, err error) { + result = &v3.FleetWorkspace{} + err = c.client.Put(). + Resource("fleetworkspaces"). + Name(fleetWorkspace.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(fleetWorkspace). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the fleetWorkspace and deletes it. Returns an error if one occurs. +func (c *fleetWorkspaces) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("fleetworkspaces"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *fleetWorkspaces) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("fleetworkspaces"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched fleetWorkspace. +func (c *fleetWorkspaces) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.FleetWorkspace, err error) { + result = &v3.FleetWorkspace{} + err = c.client.Patch(pt). + Resource("fleetworkspaces"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/freeipaprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/freeipaprovider.go new file mode 100644 index 00000000..e965b4f0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/freeipaprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// FreeIpaProvidersGetter has a method to return a FreeIpaProviderInterface. +// A group's client should implement this interface. +type FreeIpaProvidersGetter interface { + FreeIpaProviders() FreeIpaProviderInterface +} + +// FreeIpaProviderInterface has methods to work with FreeIpaProvider resources. +type FreeIpaProviderInterface interface { + Create(ctx context.Context, freeIpaProvider *v3.FreeIpaProvider, opts v1.CreateOptions) (*v3.FreeIpaProvider, error) + Update(ctx context.Context, freeIpaProvider *v3.FreeIpaProvider, opts v1.UpdateOptions) (*v3.FreeIpaProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.FreeIpaProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.FreeIpaProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.FreeIpaProvider, err error) + FreeIpaProviderExpansion +} + +// freeIpaProviders implements FreeIpaProviderInterface +type freeIpaProviders struct { + client rest.Interface +} + +// newFreeIpaProviders returns a FreeIpaProviders +func newFreeIpaProviders(c *ManagementV3Client) *freeIpaProviders { + return &freeIpaProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the freeIpaProvider, and returns the corresponding freeIpaProvider object, and an error if there is any. +func (c *freeIpaProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.FreeIpaProvider, err error) { + result = &v3.FreeIpaProvider{} + err = c.client.Get(). + Resource("freeipaproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of FreeIpaProviders that match those selectors. +func (c *freeIpaProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.FreeIpaProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.FreeIpaProviderList{} + err = c.client.Get(). + Resource("freeipaproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested freeIpaProviders. +func (c *freeIpaProviders) Watch(ctx context.Context, 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(). + Resource("freeipaproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a freeIpaProvider and creates it. Returns the server's representation of the freeIpaProvider, and an error, if there is any. +func (c *freeIpaProviders) Create(ctx context.Context, freeIpaProvider *v3.FreeIpaProvider, opts v1.CreateOptions) (result *v3.FreeIpaProvider, err error) { + result = &v3.FreeIpaProvider{} + err = c.client.Post(). + Resource("freeipaproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(freeIpaProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a freeIpaProvider and updates it. Returns the server's representation of the freeIpaProvider, and an error, if there is any. +func (c *freeIpaProviders) Update(ctx context.Context, freeIpaProvider *v3.FreeIpaProvider, opts v1.UpdateOptions) (result *v3.FreeIpaProvider, err error) { + result = &v3.FreeIpaProvider{} + err = c.client.Put(). + Resource("freeipaproviders"). + Name(freeIpaProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(freeIpaProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the freeIpaProvider and deletes it. Returns an error if one occurs. +func (c *freeIpaProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("freeipaproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *freeIpaProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("freeipaproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched freeIpaProvider. +func (c *freeIpaProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.FreeIpaProvider, err error) { + result = &v3.FreeIpaProvider{} + err = c.client.Patch(pt). + Resource("freeipaproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/generated_expansion.go new file mode 100644 index 00000000..b4f4e616 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/generated_expansion.go @@ -0,0 +1,177 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +type APIServiceExpansion interface{} + +type ActiveDirectoryProviderExpansion interface{} + +type AuthConfigExpansion interface{} + +type AuthProviderExpansion interface{} + +type AuthTokenExpansion interface{} + +type AzureADProviderExpansion interface{} + +type CatalogExpansion interface{} + +type CatalogTemplateExpansion interface{} + +type CatalogTemplateVersionExpansion interface{} + +type CisBenchmarkVersionExpansion interface{} + +type CisConfigExpansion interface{} + +type CloudCredentialExpansion interface{} + +type ClusterExpansion interface{} + +type ClusterAlertExpansion interface{} + +type ClusterAlertGroupExpansion interface{} + +type ClusterAlertRuleExpansion interface{} + +type ClusterCatalogExpansion interface{} + +type ClusterLoggingExpansion interface{} + +type ClusterMonitorGraphExpansion interface{} + +type ClusterRegistrationTokenExpansion interface{} + +type ClusterRoleTemplateBindingExpansion interface{} + +type ClusterScanExpansion interface{} + +type ClusterTemplateExpansion interface{} + +type ClusterTemplateRevisionExpansion interface{} + +type ComposeConfigExpansion interface{} + +type DynamicSchemaExpansion interface{} + +type EtcdBackupExpansion interface{} + +type FeatureExpansion interface{} + +type FleetWorkspaceExpansion interface{} + +type FreeIpaProviderExpansion interface{} + +type GithubConfigExpansion interface{} + +type GithubProviderExpansion interface{} + +type GlobalDnsExpansion interface{} + +type GlobalDnsProviderExpansion interface{} + +type GlobalRoleExpansion interface{} + +type GlobalRoleBindingExpansion interface{} + +type GoogleOAuthProviderExpansion interface{} + +type GroupExpansion interface{} + +type GroupMemberExpansion interface{} + +type KontainerDriverExpansion interface{} + +type LocalProviderExpansion interface{} + +type ManagedChartExpansion interface{} + +type MonitorMetricExpansion interface{} + +type MultiClusterAppExpansion interface{} + +type MultiClusterAppRevisionExpansion interface{} + +type NodeExpansion interface{} + +type NodeDriverExpansion interface{} + +type NodePoolExpansion interface{} + +type NodeTemplateExpansion interface{} + +type NotifierExpansion interface{} + +type OIDCProviderExpansion interface{} + +type OpenLdapProviderExpansion interface{} + +type PodSecurityPolicyTemplateExpansion interface{} + +type PodSecurityPolicyTemplateProjectBindingExpansion interface{} + +type PreferenceExpansion interface{} + +type PrincipalExpansion interface{} + +type ProjectExpansion interface{} + +type ProjectAlertExpansion interface{} + +type ProjectAlertGroupExpansion interface{} + +type ProjectAlertRuleExpansion interface{} + +type ProjectCatalogExpansion interface{} + +type ProjectLoggingExpansion interface{} + +type ProjectMonitorGraphExpansion interface{} + +type ProjectNetworkPolicyExpansion interface{} + +type ProjectRoleTemplateBindingExpansion interface{} + +type RancherUserNotificationExpansion interface{} + +type RkeAddonExpansion interface{} + +type RkeK8sServiceOptionExpansion interface{} + +type RkeK8sSystemImageExpansion interface{} + +type RoleTemplateExpansion interface{} + +type SamlProviderExpansion interface{} + +type SamlTokenExpansion interface{} + +type SettingExpansion interface{} + +type TemplateExpansion interface{} + +type TemplateContentExpansion interface{} + +type TemplateVersionExpansion interface{} + +type TokenExpansion interface{} + +type UserExpansion interface{} + +type UserAttributeExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/githubconfig.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/githubconfig.go new file mode 100644 index 00000000..1f8e44ff --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/githubconfig.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// GithubConfigsGetter has a method to return a GithubConfigInterface. +// A group's client should implement this interface. +type GithubConfigsGetter interface { + GithubConfigs() GithubConfigInterface +} + +// GithubConfigInterface has methods to work with GithubConfig resources. +type GithubConfigInterface interface { + Create(ctx context.Context, githubConfig *v3.GithubConfig, opts v1.CreateOptions) (*v3.GithubConfig, error) + Update(ctx context.Context, githubConfig *v3.GithubConfig, opts v1.UpdateOptions) (*v3.GithubConfig, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.GithubConfig, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.GithubConfigList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GithubConfig, err error) + GithubConfigExpansion +} + +// githubConfigs implements GithubConfigInterface +type githubConfigs struct { + client rest.Interface +} + +// newGithubConfigs returns a GithubConfigs +func newGithubConfigs(c *ManagementV3Client) *githubConfigs { + return &githubConfigs{ + client: c.RESTClient(), + } +} + +// Get takes name of the githubConfig, and returns the corresponding githubConfig object, and an error if there is any. +func (c *githubConfigs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GithubConfig, err error) { + result = &v3.GithubConfig{} + err = c.client.Get(). + Resource("githubconfigs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GithubConfigs that match those selectors. +func (c *githubConfigs) List(ctx context.Context, opts v1.ListOptions) (result *v3.GithubConfigList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.GithubConfigList{} + err = c.client.Get(). + Resource("githubconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested githubConfigs. +func (c *githubConfigs) Watch(ctx context.Context, 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(). + Resource("githubconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a githubConfig and creates it. Returns the server's representation of the githubConfig, and an error, if there is any. +func (c *githubConfigs) Create(ctx context.Context, githubConfig *v3.GithubConfig, opts v1.CreateOptions) (result *v3.GithubConfig, err error) { + result = &v3.GithubConfig{} + err = c.client.Post(). + Resource("githubconfigs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(githubConfig). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a githubConfig and updates it. Returns the server's representation of the githubConfig, and an error, if there is any. +func (c *githubConfigs) Update(ctx context.Context, githubConfig *v3.GithubConfig, opts v1.UpdateOptions) (result *v3.GithubConfig, err error) { + result = &v3.GithubConfig{} + err = c.client.Put(). + Resource("githubconfigs"). + Name(githubConfig.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(githubConfig). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the githubConfig and deletes it. Returns an error if one occurs. +func (c *githubConfigs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("githubconfigs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *githubConfigs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("githubconfigs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched githubConfig. +func (c *githubConfigs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GithubConfig, err error) { + result = &v3.GithubConfig{} + err = c.client.Patch(pt). + Resource("githubconfigs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/githubprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/githubprovider.go new file mode 100644 index 00000000..1278b4cc --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/githubprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// GithubProvidersGetter has a method to return a GithubProviderInterface. +// A group's client should implement this interface. +type GithubProvidersGetter interface { + GithubProviders() GithubProviderInterface +} + +// GithubProviderInterface has methods to work with GithubProvider resources. +type GithubProviderInterface interface { + Create(ctx context.Context, githubProvider *v3.GithubProvider, opts v1.CreateOptions) (*v3.GithubProvider, error) + Update(ctx context.Context, githubProvider *v3.GithubProvider, opts v1.UpdateOptions) (*v3.GithubProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.GithubProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.GithubProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GithubProvider, err error) + GithubProviderExpansion +} + +// githubProviders implements GithubProviderInterface +type githubProviders struct { + client rest.Interface +} + +// newGithubProviders returns a GithubProviders +func newGithubProviders(c *ManagementV3Client) *githubProviders { + return &githubProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the githubProvider, and returns the corresponding githubProvider object, and an error if there is any. +func (c *githubProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GithubProvider, err error) { + result = &v3.GithubProvider{} + err = c.client.Get(). + Resource("githubproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GithubProviders that match those selectors. +func (c *githubProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.GithubProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.GithubProviderList{} + err = c.client.Get(). + Resource("githubproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested githubProviders. +func (c *githubProviders) Watch(ctx context.Context, 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(). + Resource("githubproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a githubProvider and creates it. Returns the server's representation of the githubProvider, and an error, if there is any. +func (c *githubProviders) Create(ctx context.Context, githubProvider *v3.GithubProvider, opts v1.CreateOptions) (result *v3.GithubProvider, err error) { + result = &v3.GithubProvider{} + err = c.client.Post(). + Resource("githubproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(githubProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a githubProvider and updates it. Returns the server's representation of the githubProvider, and an error, if there is any. +func (c *githubProviders) Update(ctx context.Context, githubProvider *v3.GithubProvider, opts v1.UpdateOptions) (result *v3.GithubProvider, err error) { + result = &v3.GithubProvider{} + err = c.client.Put(). + Resource("githubproviders"). + Name(githubProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(githubProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the githubProvider and deletes it. Returns an error if one occurs. +func (c *githubProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("githubproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *githubProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("githubproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched githubProvider. +func (c *githubProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GithubProvider, err error) { + result = &v3.GithubProvider{} + err = c.client.Patch(pt). + Resource("githubproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globaldns.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globaldns.go new file mode 100644 index 00000000..f0678ef7 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globaldns.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// GlobalDnsesGetter has a method to return a GlobalDnsInterface. +// A group's client should implement this interface. +type GlobalDnsesGetter interface { + GlobalDnses(namespace string) GlobalDnsInterface +} + +// GlobalDnsInterface has methods to work with GlobalDns resources. +type GlobalDnsInterface interface { + Create(ctx context.Context, globalDns *v3.GlobalDns, opts v1.CreateOptions) (*v3.GlobalDns, error) + Update(ctx context.Context, globalDns *v3.GlobalDns, opts v1.UpdateOptions) (*v3.GlobalDns, error) + UpdateStatus(ctx context.Context, globalDns *v3.GlobalDns, opts v1.UpdateOptions) (*v3.GlobalDns, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.GlobalDns, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.GlobalDnsList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalDns, err error) + GlobalDnsExpansion +} + +// globalDnses implements GlobalDnsInterface +type globalDnses struct { + client rest.Interface + ns string +} + +// newGlobalDnses returns a GlobalDnses +func newGlobalDnses(c *ManagementV3Client, namespace string) *globalDnses { + return &globalDnses{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the globalDns, and returns the corresponding globalDns object, and an error if there is any. +func (c *globalDnses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GlobalDns, err error) { + result = &v3.GlobalDns{} + err = c.client.Get(). + Namespace(c.ns). + Resource("globaldnses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GlobalDnses that match those selectors. +func (c *globalDnses) List(ctx context.Context, opts v1.ListOptions) (result *v3.GlobalDnsList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.GlobalDnsList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("globaldnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested globalDnses. +func (c *globalDnses) Watch(ctx context.Context, 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("globaldnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a globalDns and creates it. Returns the server's representation of the globalDns, and an error, if there is any. +func (c *globalDnses) Create(ctx context.Context, globalDns *v3.GlobalDns, opts v1.CreateOptions) (result *v3.GlobalDns, err error) { + result = &v3.GlobalDns{} + err = c.client.Post(). + Namespace(c.ns). + Resource("globaldnses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalDns). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a globalDns and updates it. Returns the server's representation of the globalDns, and an error, if there is any. +func (c *globalDnses) Update(ctx context.Context, globalDns *v3.GlobalDns, opts v1.UpdateOptions) (result *v3.GlobalDns, err error) { + result = &v3.GlobalDns{} + err = c.client.Put(). + Namespace(c.ns). + Resource("globaldnses"). + Name(globalDns.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalDns). + Do(ctx). + 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 *globalDnses) UpdateStatus(ctx context.Context, globalDns *v3.GlobalDns, opts v1.UpdateOptions) (result *v3.GlobalDns, err error) { + result = &v3.GlobalDns{} + err = c.client.Put(). + Namespace(c.ns). + Resource("globaldnses"). + Name(globalDns.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalDns). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the globalDns and deletes it. Returns an error if one occurs. +func (c *globalDnses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("globaldnses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *globalDnses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("globaldnses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched globalDns. +func (c *globalDnses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalDns, err error) { + result = &v3.GlobalDns{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("globaldnses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globaldnsprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globaldnsprovider.go new file mode 100644 index 00000000..cb1d8b74 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globaldnsprovider.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// GlobalDnsProvidersGetter has a method to return a GlobalDnsProviderInterface. +// A group's client should implement this interface. +type GlobalDnsProvidersGetter interface { + GlobalDnsProviders(namespace string) GlobalDnsProviderInterface +} + +// GlobalDnsProviderInterface has methods to work with GlobalDnsProvider resources. +type GlobalDnsProviderInterface interface { + Create(ctx context.Context, globalDnsProvider *v3.GlobalDnsProvider, opts v1.CreateOptions) (*v3.GlobalDnsProvider, error) + Update(ctx context.Context, globalDnsProvider *v3.GlobalDnsProvider, opts v1.UpdateOptions) (*v3.GlobalDnsProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.GlobalDnsProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.GlobalDnsProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalDnsProvider, err error) + GlobalDnsProviderExpansion +} + +// globalDnsProviders implements GlobalDnsProviderInterface +type globalDnsProviders struct { + client rest.Interface + ns string +} + +// newGlobalDnsProviders returns a GlobalDnsProviders +func newGlobalDnsProviders(c *ManagementV3Client, namespace string) *globalDnsProviders { + return &globalDnsProviders{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the globalDnsProvider, and returns the corresponding globalDnsProvider object, and an error if there is any. +func (c *globalDnsProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GlobalDnsProvider, err error) { + result = &v3.GlobalDnsProvider{} + err = c.client.Get(). + Namespace(c.ns). + Resource("globaldnsproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GlobalDnsProviders that match those selectors. +func (c *globalDnsProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.GlobalDnsProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.GlobalDnsProviderList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("globaldnsproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested globalDnsProviders. +func (c *globalDnsProviders) Watch(ctx context.Context, 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("globaldnsproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a globalDnsProvider and creates it. Returns the server's representation of the globalDnsProvider, and an error, if there is any. +func (c *globalDnsProviders) Create(ctx context.Context, globalDnsProvider *v3.GlobalDnsProvider, opts v1.CreateOptions) (result *v3.GlobalDnsProvider, err error) { + result = &v3.GlobalDnsProvider{} + err = c.client.Post(). + Namespace(c.ns). + Resource("globaldnsproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalDnsProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a globalDnsProvider and updates it. Returns the server's representation of the globalDnsProvider, and an error, if there is any. +func (c *globalDnsProviders) Update(ctx context.Context, globalDnsProvider *v3.GlobalDnsProvider, opts v1.UpdateOptions) (result *v3.GlobalDnsProvider, err error) { + result = &v3.GlobalDnsProvider{} + err = c.client.Put(). + Namespace(c.ns). + Resource("globaldnsproviders"). + Name(globalDnsProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalDnsProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the globalDnsProvider and deletes it. Returns an error if one occurs. +func (c *globalDnsProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("globaldnsproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *globalDnsProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("globaldnsproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched globalDnsProvider. +func (c *globalDnsProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalDnsProvider, err error) { + result = &v3.GlobalDnsProvider{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("globaldnsproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globalrole.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globalrole.go new file mode 100644 index 00000000..c7cfb62a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globalrole.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// GlobalRolesGetter has a method to return a GlobalRoleInterface. +// A group's client should implement this interface. +type GlobalRolesGetter interface { + GlobalRoles() GlobalRoleInterface +} + +// GlobalRoleInterface has methods to work with GlobalRole resources. +type GlobalRoleInterface interface { + Create(ctx context.Context, globalRole *v3.GlobalRole, opts v1.CreateOptions) (*v3.GlobalRole, error) + Update(ctx context.Context, globalRole *v3.GlobalRole, opts v1.UpdateOptions) (*v3.GlobalRole, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.GlobalRole, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.GlobalRoleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalRole, err error) + GlobalRoleExpansion +} + +// globalRoles implements GlobalRoleInterface +type globalRoles struct { + client rest.Interface +} + +// newGlobalRoles returns a GlobalRoles +func newGlobalRoles(c *ManagementV3Client) *globalRoles { + return &globalRoles{ + client: c.RESTClient(), + } +} + +// Get takes name of the globalRole, and returns the corresponding globalRole object, and an error if there is any. +func (c *globalRoles) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GlobalRole, err error) { + result = &v3.GlobalRole{} + err = c.client.Get(). + Resource("globalroles"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GlobalRoles that match those selectors. +func (c *globalRoles) List(ctx context.Context, opts v1.ListOptions) (result *v3.GlobalRoleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.GlobalRoleList{} + err = c.client.Get(). + Resource("globalroles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested globalRoles. +func (c *globalRoles) Watch(ctx context.Context, 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(). + Resource("globalroles"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a globalRole and creates it. Returns the server's representation of the globalRole, and an error, if there is any. +func (c *globalRoles) Create(ctx context.Context, globalRole *v3.GlobalRole, opts v1.CreateOptions) (result *v3.GlobalRole, err error) { + result = &v3.GlobalRole{} + err = c.client.Post(). + Resource("globalroles"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalRole). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a globalRole and updates it. Returns the server's representation of the globalRole, and an error, if there is any. +func (c *globalRoles) Update(ctx context.Context, globalRole *v3.GlobalRole, opts v1.UpdateOptions) (result *v3.GlobalRole, err error) { + result = &v3.GlobalRole{} + err = c.client.Put(). + Resource("globalroles"). + Name(globalRole.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalRole). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the globalRole and deletes it. Returns an error if one occurs. +func (c *globalRoles) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("globalroles"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *globalRoles) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("globalroles"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched globalRole. +func (c *globalRoles) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalRole, err error) { + result = &v3.GlobalRole{} + err = c.client.Patch(pt). + Resource("globalroles"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globalrolebinding.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globalrolebinding.go new file mode 100644 index 00000000..f16deaeb --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/globalrolebinding.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// GlobalRoleBindingsGetter has a method to return a GlobalRoleBindingInterface. +// A group's client should implement this interface. +type GlobalRoleBindingsGetter interface { + GlobalRoleBindings() GlobalRoleBindingInterface +} + +// GlobalRoleBindingInterface has methods to work with GlobalRoleBinding resources. +type GlobalRoleBindingInterface interface { + Create(ctx context.Context, globalRoleBinding *v3.GlobalRoleBinding, opts v1.CreateOptions) (*v3.GlobalRoleBinding, error) + Update(ctx context.Context, globalRoleBinding *v3.GlobalRoleBinding, opts v1.UpdateOptions) (*v3.GlobalRoleBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.GlobalRoleBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.GlobalRoleBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalRoleBinding, err error) + GlobalRoleBindingExpansion +} + +// globalRoleBindings implements GlobalRoleBindingInterface +type globalRoleBindings struct { + client rest.Interface +} + +// newGlobalRoleBindings returns a GlobalRoleBindings +func newGlobalRoleBindings(c *ManagementV3Client) *globalRoleBindings { + return &globalRoleBindings{ + client: c.RESTClient(), + } +} + +// Get takes name of the globalRoleBinding, and returns the corresponding globalRoleBinding object, and an error if there is any. +func (c *globalRoleBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GlobalRoleBinding, err error) { + result = &v3.GlobalRoleBinding{} + err = c.client.Get(). + Resource("globalrolebindings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GlobalRoleBindings that match those selectors. +func (c *globalRoleBindings) List(ctx context.Context, opts v1.ListOptions) (result *v3.GlobalRoleBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.GlobalRoleBindingList{} + err = c.client.Get(). + Resource("globalrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested globalRoleBindings. +func (c *globalRoleBindings) Watch(ctx context.Context, 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(). + Resource("globalrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a globalRoleBinding and creates it. Returns the server's representation of the globalRoleBinding, and an error, if there is any. +func (c *globalRoleBindings) Create(ctx context.Context, globalRoleBinding *v3.GlobalRoleBinding, opts v1.CreateOptions) (result *v3.GlobalRoleBinding, err error) { + result = &v3.GlobalRoleBinding{} + err = c.client.Post(). + Resource("globalrolebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalRoleBinding). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a globalRoleBinding and updates it. Returns the server's representation of the globalRoleBinding, and an error, if there is any. +func (c *globalRoleBindings) Update(ctx context.Context, globalRoleBinding *v3.GlobalRoleBinding, opts v1.UpdateOptions) (result *v3.GlobalRoleBinding, err error) { + result = &v3.GlobalRoleBinding{} + err = c.client.Put(). + Resource("globalrolebindings"). + Name(globalRoleBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(globalRoleBinding). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the globalRoleBinding and deletes it. Returns an error if one occurs. +func (c *globalRoleBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("globalrolebindings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *globalRoleBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("globalrolebindings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched globalRoleBinding. +func (c *globalRoleBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GlobalRoleBinding, err error) { + result = &v3.GlobalRoleBinding{} + err = c.client.Patch(pt). + Resource("globalrolebindings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/googleoauthprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/googleoauthprovider.go new file mode 100644 index 00000000..df580ddc --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/googleoauthprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// GoogleOAuthProvidersGetter has a method to return a GoogleOAuthProviderInterface. +// A group's client should implement this interface. +type GoogleOAuthProvidersGetter interface { + GoogleOAuthProviders() GoogleOAuthProviderInterface +} + +// GoogleOAuthProviderInterface has methods to work with GoogleOAuthProvider resources. +type GoogleOAuthProviderInterface interface { + Create(ctx context.Context, googleOAuthProvider *v3.GoogleOAuthProvider, opts v1.CreateOptions) (*v3.GoogleOAuthProvider, error) + Update(ctx context.Context, googleOAuthProvider *v3.GoogleOAuthProvider, opts v1.UpdateOptions) (*v3.GoogleOAuthProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.GoogleOAuthProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.GoogleOAuthProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GoogleOAuthProvider, err error) + GoogleOAuthProviderExpansion +} + +// googleOAuthProviders implements GoogleOAuthProviderInterface +type googleOAuthProviders struct { + client rest.Interface +} + +// newGoogleOAuthProviders returns a GoogleOAuthProviders +func newGoogleOAuthProviders(c *ManagementV3Client) *googleOAuthProviders { + return &googleOAuthProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the googleOAuthProvider, and returns the corresponding googleOAuthProvider object, and an error if there is any. +func (c *googleOAuthProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GoogleOAuthProvider, err error) { + result = &v3.GoogleOAuthProvider{} + err = c.client.Get(). + Resource("googleoauthproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GoogleOAuthProviders that match those selectors. +func (c *googleOAuthProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.GoogleOAuthProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.GoogleOAuthProviderList{} + err = c.client.Get(). + Resource("googleoauthproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested googleOAuthProviders. +func (c *googleOAuthProviders) Watch(ctx context.Context, 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(). + Resource("googleoauthproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a googleOAuthProvider and creates it. Returns the server's representation of the googleOAuthProvider, and an error, if there is any. +func (c *googleOAuthProviders) Create(ctx context.Context, googleOAuthProvider *v3.GoogleOAuthProvider, opts v1.CreateOptions) (result *v3.GoogleOAuthProvider, err error) { + result = &v3.GoogleOAuthProvider{} + err = c.client.Post(). + Resource("googleoauthproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(googleOAuthProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a googleOAuthProvider and updates it. Returns the server's representation of the googleOAuthProvider, and an error, if there is any. +func (c *googleOAuthProviders) Update(ctx context.Context, googleOAuthProvider *v3.GoogleOAuthProvider, opts v1.UpdateOptions) (result *v3.GoogleOAuthProvider, err error) { + result = &v3.GoogleOAuthProvider{} + err = c.client.Put(). + Resource("googleoauthproviders"). + Name(googleOAuthProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(googleOAuthProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the googleOAuthProvider and deletes it. Returns an error if one occurs. +func (c *googleOAuthProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("googleoauthproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *googleOAuthProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("googleoauthproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched googleOAuthProvider. +func (c *googleOAuthProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GoogleOAuthProvider, err error) { + result = &v3.GoogleOAuthProvider{} + err = c.client.Patch(pt). + Resource("googleoauthproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/group.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/group.go new file mode 100644 index 00000000..a680ab28 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/group.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// GroupsGetter has a method to return a GroupInterface. +// A group's client should implement this interface. +type GroupsGetter interface { + Groups() GroupInterface +} + +// GroupInterface has methods to work with Group resources. +type GroupInterface interface { + Create(ctx context.Context, group *v3.Group, opts v1.CreateOptions) (*v3.Group, error) + Update(ctx context.Context, group *v3.Group, opts v1.UpdateOptions) (*v3.Group, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Group, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.GroupList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Group, err error) + GroupExpansion +} + +// groups implements GroupInterface +type groups struct { + client rest.Interface +} + +// newGroups returns a Groups +func newGroups(c *ManagementV3Client) *groups { + return &groups{ + client: c.RESTClient(), + } +} + +// Get takes name of the group, and returns the corresponding group object, and an error if there is any. +func (c *groups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Group, err error) { + result = &v3.Group{} + err = c.client.Get(). + Resource("groups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Groups that match those selectors. +func (c *groups) List(ctx context.Context, opts v1.ListOptions) (result *v3.GroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.GroupList{} + err = c.client.Get(). + Resource("groups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested groups. +func (c *groups) Watch(ctx context.Context, 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(). + Resource("groups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a group and creates it. Returns the server's representation of the group, and an error, if there is any. +func (c *groups) Create(ctx context.Context, group *v3.Group, opts v1.CreateOptions) (result *v3.Group, err error) { + result = &v3.Group{} + err = c.client.Post(). + Resource("groups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(group). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a group and updates it. Returns the server's representation of the group, and an error, if there is any. +func (c *groups) Update(ctx context.Context, group *v3.Group, opts v1.UpdateOptions) (result *v3.Group, err error) { + result = &v3.Group{} + err = c.client.Put(). + Resource("groups"). + Name(group.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(group). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the group and deletes it. Returns an error if one occurs. +func (c *groups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("groups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *groups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("groups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched group. +func (c *groups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Group, err error) { + result = &v3.Group{} + err = c.client.Patch(pt). + Resource("groups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/groupmember.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/groupmember.go new file mode 100644 index 00000000..f1df9e83 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/groupmember.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// GroupMembersGetter has a method to return a GroupMemberInterface. +// A group's client should implement this interface. +type GroupMembersGetter interface { + GroupMembers() GroupMemberInterface +} + +// GroupMemberInterface has methods to work with GroupMember resources. +type GroupMemberInterface interface { + Create(ctx context.Context, groupMember *v3.GroupMember, opts v1.CreateOptions) (*v3.GroupMember, error) + Update(ctx context.Context, groupMember *v3.GroupMember, opts v1.UpdateOptions) (*v3.GroupMember, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.GroupMember, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.GroupMemberList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GroupMember, err error) + GroupMemberExpansion +} + +// groupMembers implements GroupMemberInterface +type groupMembers struct { + client rest.Interface +} + +// newGroupMembers returns a GroupMembers +func newGroupMembers(c *ManagementV3Client) *groupMembers { + return &groupMembers{ + client: c.RESTClient(), + } +} + +// Get takes name of the groupMember, and returns the corresponding groupMember object, and an error if there is any. +func (c *groupMembers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.GroupMember, err error) { + result = &v3.GroupMember{} + err = c.client.Get(). + Resource("groupmembers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of GroupMembers that match those selectors. +func (c *groupMembers) List(ctx context.Context, opts v1.ListOptions) (result *v3.GroupMemberList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.GroupMemberList{} + err = c.client.Get(). + Resource("groupmembers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested groupMembers. +func (c *groupMembers) Watch(ctx context.Context, 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(). + Resource("groupmembers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a groupMember and creates it. Returns the server's representation of the groupMember, and an error, if there is any. +func (c *groupMembers) Create(ctx context.Context, groupMember *v3.GroupMember, opts v1.CreateOptions) (result *v3.GroupMember, err error) { + result = &v3.GroupMember{} + err = c.client.Post(). + Resource("groupmembers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(groupMember). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a groupMember and updates it. Returns the server's representation of the groupMember, and an error, if there is any. +func (c *groupMembers) Update(ctx context.Context, groupMember *v3.GroupMember, opts v1.UpdateOptions) (result *v3.GroupMember, err error) { + result = &v3.GroupMember{} + err = c.client.Put(). + Resource("groupmembers"). + Name(groupMember.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(groupMember). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the groupMember and deletes it. Returns an error if one occurs. +func (c *groupMembers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("groupmembers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *groupMembers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("groupmembers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched groupMember. +func (c *groupMembers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.GroupMember, err error) { + result = &v3.GroupMember{} + err = c.client.Patch(pt). + Resource("groupmembers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/kontainerdriver.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/kontainerdriver.go new file mode 100644 index 00000000..4cb701c8 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/kontainerdriver.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// KontainerDriversGetter has a method to return a KontainerDriverInterface. +// A group's client should implement this interface. +type KontainerDriversGetter interface { + KontainerDrivers() KontainerDriverInterface +} + +// KontainerDriverInterface has methods to work with KontainerDriver resources. +type KontainerDriverInterface interface { + Create(ctx context.Context, kontainerDriver *v3.KontainerDriver, opts v1.CreateOptions) (*v3.KontainerDriver, error) + Update(ctx context.Context, kontainerDriver *v3.KontainerDriver, opts v1.UpdateOptions) (*v3.KontainerDriver, error) + UpdateStatus(ctx context.Context, kontainerDriver *v3.KontainerDriver, opts v1.UpdateOptions) (*v3.KontainerDriver, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.KontainerDriver, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.KontainerDriverList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.KontainerDriver, err error) + KontainerDriverExpansion +} + +// kontainerDrivers implements KontainerDriverInterface +type kontainerDrivers struct { + client rest.Interface +} + +// newKontainerDrivers returns a KontainerDrivers +func newKontainerDrivers(c *ManagementV3Client) *kontainerDrivers { + return &kontainerDrivers{ + client: c.RESTClient(), + } +} + +// Get takes name of the kontainerDriver, and returns the corresponding kontainerDriver object, and an error if there is any. +func (c *kontainerDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.KontainerDriver, err error) { + result = &v3.KontainerDriver{} + err = c.client.Get(). + Resource("kontainerdrivers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of KontainerDrivers that match those selectors. +func (c *kontainerDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v3.KontainerDriverList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.KontainerDriverList{} + err = c.client.Get(). + Resource("kontainerdrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested kontainerDrivers. +func (c *kontainerDrivers) Watch(ctx context.Context, 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(). + Resource("kontainerdrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a kontainerDriver and creates it. Returns the server's representation of the kontainerDriver, and an error, if there is any. +func (c *kontainerDrivers) Create(ctx context.Context, kontainerDriver *v3.KontainerDriver, opts v1.CreateOptions) (result *v3.KontainerDriver, err error) { + result = &v3.KontainerDriver{} + err = c.client.Post(). + Resource("kontainerdrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(kontainerDriver). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a kontainerDriver and updates it. Returns the server's representation of the kontainerDriver, and an error, if there is any. +func (c *kontainerDrivers) Update(ctx context.Context, kontainerDriver *v3.KontainerDriver, opts v1.UpdateOptions) (result *v3.KontainerDriver, err error) { + result = &v3.KontainerDriver{} + err = c.client.Put(). + Resource("kontainerdrivers"). + Name(kontainerDriver.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(kontainerDriver). + Do(ctx). + 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 *kontainerDrivers) UpdateStatus(ctx context.Context, kontainerDriver *v3.KontainerDriver, opts v1.UpdateOptions) (result *v3.KontainerDriver, err error) { + result = &v3.KontainerDriver{} + err = c.client.Put(). + Resource("kontainerdrivers"). + Name(kontainerDriver.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(kontainerDriver). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the kontainerDriver and deletes it. Returns an error if one occurs. +func (c *kontainerDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("kontainerdrivers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *kontainerDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("kontainerdrivers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched kontainerDriver. +func (c *kontainerDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.KontainerDriver, err error) { + result = &v3.KontainerDriver{} + err = c.client.Patch(pt). + Resource("kontainerdrivers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/localprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/localprovider.go new file mode 100644 index 00000000..8b1b317c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/localprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// LocalProvidersGetter has a method to return a LocalProviderInterface. +// A group's client should implement this interface. +type LocalProvidersGetter interface { + LocalProviders() LocalProviderInterface +} + +// LocalProviderInterface has methods to work with LocalProvider resources. +type LocalProviderInterface interface { + Create(ctx context.Context, localProvider *v3.LocalProvider, opts v1.CreateOptions) (*v3.LocalProvider, error) + Update(ctx context.Context, localProvider *v3.LocalProvider, opts v1.UpdateOptions) (*v3.LocalProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.LocalProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.LocalProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.LocalProvider, err error) + LocalProviderExpansion +} + +// localProviders implements LocalProviderInterface +type localProviders struct { + client rest.Interface +} + +// newLocalProviders returns a LocalProviders +func newLocalProviders(c *ManagementV3Client) *localProviders { + return &localProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the localProvider, and returns the corresponding localProvider object, and an error if there is any. +func (c *localProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.LocalProvider, err error) { + result = &v3.LocalProvider{} + err = c.client.Get(). + Resource("localproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of LocalProviders that match those selectors. +func (c *localProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.LocalProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.LocalProviderList{} + err = c.client.Get(). + Resource("localproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested localProviders. +func (c *localProviders) Watch(ctx context.Context, 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(). + Resource("localproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a localProvider and creates it. Returns the server's representation of the localProvider, and an error, if there is any. +func (c *localProviders) Create(ctx context.Context, localProvider *v3.LocalProvider, opts v1.CreateOptions) (result *v3.LocalProvider, err error) { + result = &v3.LocalProvider{} + err = c.client.Post(). + Resource("localproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a localProvider and updates it. Returns the server's representation of the localProvider, and an error, if there is any. +func (c *localProviders) Update(ctx context.Context, localProvider *v3.LocalProvider, opts v1.UpdateOptions) (result *v3.LocalProvider, err error) { + result = &v3.LocalProvider{} + err = c.client.Put(). + Resource("localproviders"). + Name(localProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(localProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the localProvider and deletes it. Returns an error if one occurs. +func (c *localProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("localproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *localProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("localproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched localProvider. +func (c *localProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.LocalProvider, err error) { + result = &v3.LocalProvider{} + err = c.client.Patch(pt). + Resource("localproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/managedchart.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/managedchart.go new file mode 100644 index 00000000..57eef6f1 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/managedchart.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ManagedChartsGetter has a method to return a ManagedChartInterface. +// A group's client should implement this interface. +type ManagedChartsGetter interface { + ManagedCharts(namespace string) ManagedChartInterface +} + +// ManagedChartInterface has methods to work with ManagedChart resources. +type ManagedChartInterface interface { + Create(ctx context.Context, managedChart *v3.ManagedChart, opts v1.CreateOptions) (*v3.ManagedChart, error) + Update(ctx context.Context, managedChart *v3.ManagedChart, opts v1.UpdateOptions) (*v3.ManagedChart, error) + UpdateStatus(ctx context.Context, managedChart *v3.ManagedChart, opts v1.UpdateOptions) (*v3.ManagedChart, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ManagedChart, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ManagedChartList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ManagedChart, err error) + ManagedChartExpansion +} + +// managedCharts implements ManagedChartInterface +type managedCharts struct { + client rest.Interface + ns string +} + +// newManagedCharts returns a ManagedCharts +func newManagedCharts(c *ManagementV3Client, namespace string) *managedCharts { + return &managedCharts{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the managedChart, and returns the corresponding managedChart object, and an error if there is any. +func (c *managedCharts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ManagedChart, err error) { + result = &v3.ManagedChart{} + err = c.client.Get(). + Namespace(c.ns). + Resource("managedcharts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ManagedCharts that match those selectors. +func (c *managedCharts) List(ctx context.Context, opts v1.ListOptions) (result *v3.ManagedChartList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ManagedChartList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("managedcharts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested managedCharts. +func (c *managedCharts) Watch(ctx context.Context, 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("managedcharts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a managedChart and creates it. Returns the server's representation of the managedChart, and an error, if there is any. +func (c *managedCharts) Create(ctx context.Context, managedChart *v3.ManagedChart, opts v1.CreateOptions) (result *v3.ManagedChart, err error) { + result = &v3.ManagedChart{} + err = c.client.Post(). + Namespace(c.ns). + Resource("managedcharts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(managedChart). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a managedChart and updates it. Returns the server's representation of the managedChart, and an error, if there is any. +func (c *managedCharts) Update(ctx context.Context, managedChart *v3.ManagedChart, opts v1.UpdateOptions) (result *v3.ManagedChart, err error) { + result = &v3.ManagedChart{} + err = c.client.Put(). + Namespace(c.ns). + Resource("managedcharts"). + Name(managedChart.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(managedChart). + Do(ctx). + 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 *managedCharts) UpdateStatus(ctx context.Context, managedChart *v3.ManagedChart, opts v1.UpdateOptions) (result *v3.ManagedChart, err error) { + result = &v3.ManagedChart{} + err = c.client.Put(). + Namespace(c.ns). + Resource("managedcharts"). + Name(managedChart.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(managedChart). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the managedChart and deletes it. Returns an error if one occurs. +func (c *managedCharts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("managedcharts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *managedCharts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("managedcharts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched managedChart. +func (c *managedCharts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ManagedChart, err error) { + result = &v3.ManagedChart{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("managedcharts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/management.cattle.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/management.cattle.io_client.go new file mode 100644 index 00000000..d9b7188f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/management.cattle.io_client.go @@ -0,0 +1,497 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "net/http" + + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + rest "k8s.io/client-go/rest" +) + +type ManagementV3Interface interface { + RESTClient() rest.Interface + APIServicesGetter + ActiveDirectoryProvidersGetter + AuthConfigsGetter + AuthProvidersGetter + AuthTokensGetter + AzureADProvidersGetter + CatalogsGetter + CatalogTemplatesGetter + CatalogTemplateVersionsGetter + CisBenchmarkVersionsGetter + CisConfigsGetter + CloudCredentialsGetter + ClustersGetter + ClusterAlertsGetter + ClusterAlertGroupsGetter + ClusterAlertRulesGetter + ClusterCatalogsGetter + ClusterLoggingsGetter + ClusterMonitorGraphsGetter + ClusterRegistrationTokensGetter + ClusterRoleTemplateBindingsGetter + ClusterScansGetter + ClusterTemplatesGetter + ClusterTemplateRevisionsGetter + ComposeConfigsGetter + DynamicSchemasGetter + EtcdBackupsGetter + FeaturesGetter + FleetWorkspacesGetter + FreeIpaProvidersGetter + GithubConfigsGetter + GithubProvidersGetter + GlobalDnsesGetter + GlobalDnsProvidersGetter + GlobalRolesGetter + GlobalRoleBindingsGetter + GoogleOAuthProvidersGetter + GroupsGetter + GroupMembersGetter + KontainerDriversGetter + LocalProvidersGetter + ManagedChartsGetter + MonitorMetricsGetter + MultiClusterAppsGetter + MultiClusterAppRevisionsGetter + NodesGetter + NodeDriversGetter + NodePoolsGetter + NodeTemplatesGetter + NotifiersGetter + OIDCProvidersGetter + OpenLdapProvidersGetter + PodSecurityPolicyTemplatesGetter + PodSecurityPolicyTemplateProjectBindingsGetter + PreferencesGetter + PrincipalsGetter + ProjectsGetter + ProjectAlertsGetter + ProjectAlertGroupsGetter + ProjectAlertRulesGetter + ProjectCatalogsGetter + ProjectLoggingsGetter + ProjectMonitorGraphsGetter + ProjectNetworkPoliciesGetter + ProjectRoleTemplateBindingsGetter + RancherUserNotificationsGetter + RkeAddonsGetter + RkeK8sServiceOptionsGetter + RkeK8sSystemImagesGetter + RoleTemplatesGetter + SamlProvidersGetter + SamlTokensGetter + SettingsGetter + TemplatesGetter + TemplateContentsGetter + TemplateVersionsGetter + TokensGetter + UsersGetter + UserAttributesGetter +} + +// ManagementV3Client is used to interact with features provided by the management.cattle.io group. +type ManagementV3Client struct { + restClient rest.Interface +} + +func (c *ManagementV3Client) APIServices() APIServiceInterface { + return newAPIServices(c) +} + +func (c *ManagementV3Client) ActiveDirectoryProviders() ActiveDirectoryProviderInterface { + return newActiveDirectoryProviders(c) +} + +func (c *ManagementV3Client) AuthConfigs() AuthConfigInterface { + return newAuthConfigs(c) +} + +func (c *ManagementV3Client) AuthProviders() AuthProviderInterface { + return newAuthProviders(c) +} + +func (c *ManagementV3Client) AuthTokens() AuthTokenInterface { + return newAuthTokens(c) +} + +func (c *ManagementV3Client) AzureADProviders() AzureADProviderInterface { + return newAzureADProviders(c) +} + +func (c *ManagementV3Client) Catalogs() CatalogInterface { + return newCatalogs(c) +} + +func (c *ManagementV3Client) CatalogTemplates(namespace string) CatalogTemplateInterface { + return newCatalogTemplates(c, namespace) +} + +func (c *ManagementV3Client) CatalogTemplateVersions(namespace string) CatalogTemplateVersionInterface { + return newCatalogTemplateVersions(c, namespace) +} + +func (c *ManagementV3Client) CisBenchmarkVersions(namespace string) CisBenchmarkVersionInterface { + return newCisBenchmarkVersions(c, namespace) +} + +func (c *ManagementV3Client) CisConfigs(namespace string) CisConfigInterface { + return newCisConfigs(c, namespace) +} + +func (c *ManagementV3Client) CloudCredentials(namespace string) CloudCredentialInterface { + return newCloudCredentials(c, namespace) +} + +func (c *ManagementV3Client) Clusters() ClusterInterface { + return newClusters(c) +} + +func (c *ManagementV3Client) ClusterAlerts(namespace string) ClusterAlertInterface { + return newClusterAlerts(c, namespace) +} + +func (c *ManagementV3Client) ClusterAlertGroups(namespace string) ClusterAlertGroupInterface { + return newClusterAlertGroups(c, namespace) +} + +func (c *ManagementV3Client) ClusterAlertRules(namespace string) ClusterAlertRuleInterface { + return newClusterAlertRules(c, namespace) +} + +func (c *ManagementV3Client) ClusterCatalogs(namespace string) ClusterCatalogInterface { + return newClusterCatalogs(c, namespace) +} + +func (c *ManagementV3Client) ClusterLoggings(namespace string) ClusterLoggingInterface { + return newClusterLoggings(c, namespace) +} + +func (c *ManagementV3Client) ClusterMonitorGraphs(namespace string) ClusterMonitorGraphInterface { + return newClusterMonitorGraphs(c, namespace) +} + +func (c *ManagementV3Client) ClusterRegistrationTokens(namespace string) ClusterRegistrationTokenInterface { + return newClusterRegistrationTokens(c, namespace) +} + +func (c *ManagementV3Client) ClusterRoleTemplateBindings(namespace string) ClusterRoleTemplateBindingInterface { + return newClusterRoleTemplateBindings(c, namespace) +} + +func (c *ManagementV3Client) ClusterScans(namespace string) ClusterScanInterface { + return newClusterScans(c, namespace) +} + +func (c *ManagementV3Client) ClusterTemplates(namespace string) ClusterTemplateInterface { + return newClusterTemplates(c, namespace) +} + +func (c *ManagementV3Client) ClusterTemplateRevisions(namespace string) ClusterTemplateRevisionInterface { + return newClusterTemplateRevisions(c, namespace) +} + +func (c *ManagementV3Client) ComposeConfigs() ComposeConfigInterface { + return newComposeConfigs(c) +} + +func (c *ManagementV3Client) DynamicSchemas() DynamicSchemaInterface { + return newDynamicSchemas(c) +} + +func (c *ManagementV3Client) EtcdBackups(namespace string) EtcdBackupInterface { + return newEtcdBackups(c, namespace) +} + +func (c *ManagementV3Client) Features() FeatureInterface { + return newFeatures(c) +} + +func (c *ManagementV3Client) FleetWorkspaces() FleetWorkspaceInterface { + return newFleetWorkspaces(c) +} + +func (c *ManagementV3Client) FreeIpaProviders() FreeIpaProviderInterface { + return newFreeIpaProviders(c) +} + +func (c *ManagementV3Client) GithubConfigs() GithubConfigInterface { + return newGithubConfigs(c) +} + +func (c *ManagementV3Client) GithubProviders() GithubProviderInterface { + return newGithubProviders(c) +} + +func (c *ManagementV3Client) GlobalDnses(namespace string) GlobalDnsInterface { + return newGlobalDnses(c, namespace) +} + +func (c *ManagementV3Client) GlobalDnsProviders(namespace string) GlobalDnsProviderInterface { + return newGlobalDnsProviders(c, namespace) +} + +func (c *ManagementV3Client) GlobalRoles() GlobalRoleInterface { + return newGlobalRoles(c) +} + +func (c *ManagementV3Client) GlobalRoleBindings() GlobalRoleBindingInterface { + return newGlobalRoleBindings(c) +} + +func (c *ManagementV3Client) GoogleOAuthProviders() GoogleOAuthProviderInterface { + return newGoogleOAuthProviders(c) +} + +func (c *ManagementV3Client) Groups() GroupInterface { + return newGroups(c) +} + +func (c *ManagementV3Client) GroupMembers() GroupMemberInterface { + return newGroupMembers(c) +} + +func (c *ManagementV3Client) KontainerDrivers() KontainerDriverInterface { + return newKontainerDrivers(c) +} + +func (c *ManagementV3Client) LocalProviders() LocalProviderInterface { + return newLocalProviders(c) +} + +func (c *ManagementV3Client) ManagedCharts(namespace string) ManagedChartInterface { + return newManagedCharts(c, namespace) +} + +func (c *ManagementV3Client) MonitorMetrics(namespace string) MonitorMetricInterface { + return newMonitorMetrics(c, namespace) +} + +func (c *ManagementV3Client) MultiClusterApps(namespace string) MultiClusterAppInterface { + return newMultiClusterApps(c, namespace) +} + +func (c *ManagementV3Client) MultiClusterAppRevisions(namespace string) MultiClusterAppRevisionInterface { + return newMultiClusterAppRevisions(c, namespace) +} + +func (c *ManagementV3Client) Nodes(namespace string) NodeInterface { + return newNodes(c, namespace) +} + +func (c *ManagementV3Client) NodeDrivers() NodeDriverInterface { + return newNodeDrivers(c) +} + +func (c *ManagementV3Client) NodePools(namespace string) NodePoolInterface { + return newNodePools(c, namespace) +} + +func (c *ManagementV3Client) NodeTemplates(namespace string) NodeTemplateInterface { + return newNodeTemplates(c, namespace) +} + +func (c *ManagementV3Client) Notifiers(namespace string) NotifierInterface { + return newNotifiers(c, namespace) +} + +func (c *ManagementV3Client) OIDCProviders() OIDCProviderInterface { + return newOIDCProviders(c) +} + +func (c *ManagementV3Client) OpenLdapProviders() OpenLdapProviderInterface { + return newOpenLdapProviders(c) +} + +func (c *ManagementV3Client) PodSecurityPolicyTemplates() PodSecurityPolicyTemplateInterface { + return newPodSecurityPolicyTemplates(c) +} + +func (c *ManagementV3Client) PodSecurityPolicyTemplateProjectBindings(namespace string) PodSecurityPolicyTemplateProjectBindingInterface { + return newPodSecurityPolicyTemplateProjectBindings(c, namespace) +} + +func (c *ManagementV3Client) Preferences(namespace string) PreferenceInterface { + return newPreferences(c, namespace) +} + +func (c *ManagementV3Client) Principals() PrincipalInterface { + return newPrincipals(c) +} + +func (c *ManagementV3Client) Projects(namespace string) ProjectInterface { + return newProjects(c, namespace) +} + +func (c *ManagementV3Client) ProjectAlerts(namespace string) ProjectAlertInterface { + return newProjectAlerts(c, namespace) +} + +func (c *ManagementV3Client) ProjectAlertGroups(namespace string) ProjectAlertGroupInterface { + return newProjectAlertGroups(c, namespace) +} + +func (c *ManagementV3Client) ProjectAlertRules(namespace string) ProjectAlertRuleInterface { + return newProjectAlertRules(c, namespace) +} + +func (c *ManagementV3Client) ProjectCatalogs(namespace string) ProjectCatalogInterface { + return newProjectCatalogs(c, namespace) +} + +func (c *ManagementV3Client) ProjectLoggings(namespace string) ProjectLoggingInterface { + return newProjectLoggings(c, namespace) +} + +func (c *ManagementV3Client) ProjectMonitorGraphs(namespace string) ProjectMonitorGraphInterface { + return newProjectMonitorGraphs(c, namespace) +} + +func (c *ManagementV3Client) ProjectNetworkPolicies(namespace string) ProjectNetworkPolicyInterface { + return newProjectNetworkPolicies(c, namespace) +} + +func (c *ManagementV3Client) ProjectRoleTemplateBindings(namespace string) ProjectRoleTemplateBindingInterface { + return newProjectRoleTemplateBindings(c, namespace) +} + +func (c *ManagementV3Client) RancherUserNotifications() RancherUserNotificationInterface { + return newRancherUserNotifications(c) +} + +func (c *ManagementV3Client) RkeAddons(namespace string) RkeAddonInterface { + return newRkeAddons(c, namespace) +} + +func (c *ManagementV3Client) RkeK8sServiceOptions(namespace string) RkeK8sServiceOptionInterface { + return newRkeK8sServiceOptions(c, namespace) +} + +func (c *ManagementV3Client) RkeK8sSystemImages(namespace string) RkeK8sSystemImageInterface { + return newRkeK8sSystemImages(c, namespace) +} + +func (c *ManagementV3Client) RoleTemplates() RoleTemplateInterface { + return newRoleTemplates(c) +} + +func (c *ManagementV3Client) SamlProviders() SamlProviderInterface { + return newSamlProviders(c) +} + +func (c *ManagementV3Client) SamlTokens() SamlTokenInterface { + return newSamlTokens(c) +} + +func (c *ManagementV3Client) Settings() SettingInterface { + return newSettings(c) +} + +func (c *ManagementV3Client) Templates() TemplateInterface { + return newTemplates(c) +} + +func (c *ManagementV3Client) TemplateContents() TemplateContentInterface { + return newTemplateContents(c) +} + +func (c *ManagementV3Client) TemplateVersions() TemplateVersionInterface { + return newTemplateVersions(c) +} + +func (c *ManagementV3Client) Tokens() TokenInterface { + return newTokens(c) +} + +func (c *ManagementV3Client) Users() UserInterface { + return newUsers(c) +} + +func (c *ManagementV3Client) UserAttributes() UserAttributeInterface { + return newUserAttributes(c) +} + +// NewForConfig creates a new ManagementV3Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*ManagementV3Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new ManagementV3Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ManagementV3Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &ManagementV3Client{client}, nil +} + +// NewForConfigOrDie creates a new ManagementV3Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *ManagementV3Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new ManagementV3Client for the given RESTClient. +func New(c rest.Interface) *ManagementV3Client { + return &ManagementV3Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v3.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 *ManagementV3Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/monitormetric.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/monitormetric.go new file mode 100644 index 00000000..98b8bb85 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/monitormetric.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// MonitorMetricsGetter has a method to return a MonitorMetricInterface. +// A group's client should implement this interface. +type MonitorMetricsGetter interface { + MonitorMetrics(namespace string) MonitorMetricInterface +} + +// MonitorMetricInterface has methods to work with MonitorMetric resources. +type MonitorMetricInterface interface { + Create(ctx context.Context, monitorMetric *v3.MonitorMetric, opts v1.CreateOptions) (*v3.MonitorMetric, error) + Update(ctx context.Context, monitorMetric *v3.MonitorMetric, opts v1.UpdateOptions) (*v3.MonitorMetric, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.MonitorMetric, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.MonitorMetricList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.MonitorMetric, err error) + MonitorMetricExpansion +} + +// monitorMetrics implements MonitorMetricInterface +type monitorMetrics struct { + client rest.Interface + ns string +} + +// newMonitorMetrics returns a MonitorMetrics +func newMonitorMetrics(c *ManagementV3Client, namespace string) *monitorMetrics { + return &monitorMetrics{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the monitorMetric, and returns the corresponding monitorMetric object, and an error if there is any. +func (c *monitorMetrics) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.MonitorMetric, err error) { + result = &v3.MonitorMetric{} + err = c.client.Get(). + Namespace(c.ns). + Resource("monitormetrics"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MonitorMetrics that match those selectors. +func (c *monitorMetrics) List(ctx context.Context, opts v1.ListOptions) (result *v3.MonitorMetricList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.MonitorMetricList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("monitormetrics"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested monitorMetrics. +func (c *monitorMetrics) Watch(ctx context.Context, 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("monitormetrics"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a monitorMetric and creates it. Returns the server's representation of the monitorMetric, and an error, if there is any. +func (c *monitorMetrics) Create(ctx context.Context, monitorMetric *v3.MonitorMetric, opts v1.CreateOptions) (result *v3.MonitorMetric, err error) { + result = &v3.MonitorMetric{} + err = c.client.Post(). + Namespace(c.ns). + Resource("monitormetrics"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(monitorMetric). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a monitorMetric and updates it. Returns the server's representation of the monitorMetric, and an error, if there is any. +func (c *monitorMetrics) Update(ctx context.Context, monitorMetric *v3.MonitorMetric, opts v1.UpdateOptions) (result *v3.MonitorMetric, err error) { + result = &v3.MonitorMetric{} + err = c.client.Put(). + Namespace(c.ns). + Resource("monitormetrics"). + Name(monitorMetric.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(monitorMetric). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the monitorMetric and deletes it. Returns an error if one occurs. +func (c *monitorMetrics) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("monitormetrics"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *monitorMetrics) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("monitormetrics"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched monitorMetric. +func (c *monitorMetrics) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.MonitorMetric, err error) { + result = &v3.MonitorMetric{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("monitormetrics"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/multiclusterapp.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/multiclusterapp.go new file mode 100644 index 00000000..5337c04a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/multiclusterapp.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// MultiClusterAppsGetter has a method to return a MultiClusterAppInterface. +// A group's client should implement this interface. +type MultiClusterAppsGetter interface { + MultiClusterApps(namespace string) MultiClusterAppInterface +} + +// MultiClusterAppInterface has methods to work with MultiClusterApp resources. +type MultiClusterAppInterface interface { + Create(ctx context.Context, multiClusterApp *v3.MultiClusterApp, opts v1.CreateOptions) (*v3.MultiClusterApp, error) + Update(ctx context.Context, multiClusterApp *v3.MultiClusterApp, opts v1.UpdateOptions) (*v3.MultiClusterApp, error) + UpdateStatus(ctx context.Context, multiClusterApp *v3.MultiClusterApp, opts v1.UpdateOptions) (*v3.MultiClusterApp, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.MultiClusterApp, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.MultiClusterAppList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.MultiClusterApp, err error) + MultiClusterAppExpansion +} + +// multiClusterApps implements MultiClusterAppInterface +type multiClusterApps struct { + client rest.Interface + ns string +} + +// newMultiClusterApps returns a MultiClusterApps +func newMultiClusterApps(c *ManagementV3Client, namespace string) *multiClusterApps { + return &multiClusterApps{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the multiClusterApp, and returns the corresponding multiClusterApp object, and an error if there is any. +func (c *multiClusterApps) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.MultiClusterApp, err error) { + result = &v3.MultiClusterApp{} + err = c.client.Get(). + Namespace(c.ns). + Resource("multiclusterapps"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MultiClusterApps that match those selectors. +func (c *multiClusterApps) List(ctx context.Context, opts v1.ListOptions) (result *v3.MultiClusterAppList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.MultiClusterAppList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("multiclusterapps"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested multiClusterApps. +func (c *multiClusterApps) Watch(ctx context.Context, 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("multiclusterapps"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a multiClusterApp and creates it. Returns the server's representation of the multiClusterApp, and an error, if there is any. +func (c *multiClusterApps) Create(ctx context.Context, multiClusterApp *v3.MultiClusterApp, opts v1.CreateOptions) (result *v3.MultiClusterApp, err error) { + result = &v3.MultiClusterApp{} + err = c.client.Post(). + Namespace(c.ns). + Resource("multiclusterapps"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(multiClusterApp). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a multiClusterApp and updates it. Returns the server's representation of the multiClusterApp, and an error, if there is any. +func (c *multiClusterApps) Update(ctx context.Context, multiClusterApp *v3.MultiClusterApp, opts v1.UpdateOptions) (result *v3.MultiClusterApp, err error) { + result = &v3.MultiClusterApp{} + err = c.client.Put(). + Namespace(c.ns). + Resource("multiclusterapps"). + Name(multiClusterApp.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(multiClusterApp). + Do(ctx). + 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 *multiClusterApps) UpdateStatus(ctx context.Context, multiClusterApp *v3.MultiClusterApp, opts v1.UpdateOptions) (result *v3.MultiClusterApp, err error) { + result = &v3.MultiClusterApp{} + err = c.client.Put(). + Namespace(c.ns). + Resource("multiclusterapps"). + Name(multiClusterApp.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(multiClusterApp). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the multiClusterApp and deletes it. Returns an error if one occurs. +func (c *multiClusterApps) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("multiclusterapps"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *multiClusterApps) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("multiclusterapps"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched multiClusterApp. +func (c *multiClusterApps) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.MultiClusterApp, err error) { + result = &v3.MultiClusterApp{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("multiclusterapps"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/multiclusterapprevision.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/multiclusterapprevision.go new file mode 100644 index 00000000..71d7452d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/multiclusterapprevision.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// MultiClusterAppRevisionsGetter has a method to return a MultiClusterAppRevisionInterface. +// A group's client should implement this interface. +type MultiClusterAppRevisionsGetter interface { + MultiClusterAppRevisions(namespace string) MultiClusterAppRevisionInterface +} + +// MultiClusterAppRevisionInterface has methods to work with MultiClusterAppRevision resources. +type MultiClusterAppRevisionInterface interface { + Create(ctx context.Context, multiClusterAppRevision *v3.MultiClusterAppRevision, opts v1.CreateOptions) (*v3.MultiClusterAppRevision, error) + Update(ctx context.Context, multiClusterAppRevision *v3.MultiClusterAppRevision, opts v1.UpdateOptions) (*v3.MultiClusterAppRevision, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.MultiClusterAppRevision, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.MultiClusterAppRevisionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.MultiClusterAppRevision, err error) + MultiClusterAppRevisionExpansion +} + +// multiClusterAppRevisions implements MultiClusterAppRevisionInterface +type multiClusterAppRevisions struct { + client rest.Interface + ns string +} + +// newMultiClusterAppRevisions returns a MultiClusterAppRevisions +func newMultiClusterAppRevisions(c *ManagementV3Client, namespace string) *multiClusterAppRevisions { + return &multiClusterAppRevisions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the multiClusterAppRevision, and returns the corresponding multiClusterAppRevision object, and an error if there is any. +func (c *multiClusterAppRevisions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.MultiClusterAppRevision, err error) { + result = &v3.MultiClusterAppRevision{} + err = c.client.Get(). + Namespace(c.ns). + Resource("multiclusterapprevisions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of MultiClusterAppRevisions that match those selectors. +func (c *multiClusterAppRevisions) List(ctx context.Context, opts v1.ListOptions) (result *v3.MultiClusterAppRevisionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.MultiClusterAppRevisionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("multiclusterapprevisions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested multiClusterAppRevisions. +func (c *multiClusterAppRevisions) Watch(ctx context.Context, 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("multiclusterapprevisions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a multiClusterAppRevision and creates it. Returns the server's representation of the multiClusterAppRevision, and an error, if there is any. +func (c *multiClusterAppRevisions) Create(ctx context.Context, multiClusterAppRevision *v3.MultiClusterAppRevision, opts v1.CreateOptions) (result *v3.MultiClusterAppRevision, err error) { + result = &v3.MultiClusterAppRevision{} + err = c.client.Post(). + Namespace(c.ns). + Resource("multiclusterapprevisions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(multiClusterAppRevision). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a multiClusterAppRevision and updates it. Returns the server's representation of the multiClusterAppRevision, and an error, if there is any. +func (c *multiClusterAppRevisions) Update(ctx context.Context, multiClusterAppRevision *v3.MultiClusterAppRevision, opts v1.UpdateOptions) (result *v3.MultiClusterAppRevision, err error) { + result = &v3.MultiClusterAppRevision{} + err = c.client.Put(). + Namespace(c.ns). + Resource("multiclusterapprevisions"). + Name(multiClusterAppRevision.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(multiClusterAppRevision). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the multiClusterAppRevision and deletes it. Returns an error if one occurs. +func (c *multiClusterAppRevisions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("multiclusterapprevisions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *multiClusterAppRevisions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("multiclusterapprevisions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched multiClusterAppRevision. +func (c *multiClusterAppRevisions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.MultiClusterAppRevision, err error) { + result = &v3.MultiClusterAppRevision{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("multiclusterapprevisions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/node.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/node.go new file mode 100644 index 00000000..0dddcb1d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/node.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// NodesGetter has a method to return a NodeInterface. +// A group's client should implement this interface. +type NodesGetter interface { + Nodes(namespace string) NodeInterface +} + +// NodeInterface has methods to work with Node resources. +type NodeInterface interface { + Create(ctx context.Context, node *v3.Node, opts v1.CreateOptions) (*v3.Node, error) + Update(ctx context.Context, node *v3.Node, opts v1.UpdateOptions) (*v3.Node, error) + UpdateStatus(ctx context.Context, node *v3.Node, opts v1.UpdateOptions) (*v3.Node, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Node, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.NodeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Node, err error) + NodeExpansion +} + +// nodes implements NodeInterface +type nodes struct { + client rest.Interface + ns string +} + +// newNodes returns a Nodes +func newNodes(c *ManagementV3Client, namespace string) *nodes { + return &nodes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the node, and returns the corresponding node object, and an error if there is any. +func (c *nodes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Node, err error) { + result = &v3.Node{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Nodes that match those selectors. +func (c *nodes) List(ctx context.Context, opts v1.ListOptions) (result *v3.NodeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.NodeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodes. +func (c *nodes) Watch(ctx context.Context, 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("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a node and creates it. Returns the server's representation of the node, and an error, if there is any. +func (c *nodes) Create(ctx context.Context, node *v3.Node, opts v1.CreateOptions) (result *v3.Node, err error) { + result = &v3.Node{} + err = c.client.Post(). + Namespace(c.ns). + Resource("nodes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(node). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a node and updates it. Returns the server's representation of the node, and an error, if there is any. +func (c *nodes) Update(ctx context.Context, node *v3.Node, opts v1.UpdateOptions) (result *v3.Node, err error) { + result = &v3.Node{} + err = c.client.Put(). + Namespace(c.ns). + Resource("nodes"). + Name(node.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(node). + Do(ctx). + 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 *nodes) UpdateStatus(ctx context.Context, node *v3.Node, opts v1.UpdateOptions) (result *v3.Node, err error) { + result = &v3.Node{} + err = c.client.Put(). + Namespace(c.ns). + Resource("nodes"). + Name(node.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(node). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the node and deletes it. Returns an error if one occurs. +func (c *nodes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("nodes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("nodes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched node. +func (c *nodes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Node, err error) { + result = &v3.Node{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("nodes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/nodedriver.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/nodedriver.go new file mode 100644 index 00000000..01539293 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/nodedriver.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// NodeDriversGetter has a method to return a NodeDriverInterface. +// A group's client should implement this interface. +type NodeDriversGetter interface { + NodeDrivers() NodeDriverInterface +} + +// NodeDriverInterface has methods to work with NodeDriver resources. +type NodeDriverInterface interface { + Create(ctx context.Context, nodeDriver *v3.NodeDriver, opts v1.CreateOptions) (*v3.NodeDriver, error) + Update(ctx context.Context, nodeDriver *v3.NodeDriver, opts v1.UpdateOptions) (*v3.NodeDriver, error) + UpdateStatus(ctx context.Context, nodeDriver *v3.NodeDriver, opts v1.UpdateOptions) (*v3.NodeDriver, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.NodeDriver, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.NodeDriverList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.NodeDriver, err error) + NodeDriverExpansion +} + +// nodeDrivers implements NodeDriverInterface +type nodeDrivers struct { + client rest.Interface +} + +// newNodeDrivers returns a NodeDrivers +func newNodeDrivers(c *ManagementV3Client) *nodeDrivers { + return &nodeDrivers{ + client: c.RESTClient(), + } +} + +// Get takes name of the nodeDriver, and returns the corresponding nodeDriver object, and an error if there is any. +func (c *nodeDrivers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.NodeDriver, err error) { + result = &v3.NodeDriver{} + err = c.client.Get(). + Resource("nodedrivers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeDrivers that match those selectors. +func (c *nodeDrivers) List(ctx context.Context, opts v1.ListOptions) (result *v3.NodeDriverList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.NodeDriverList{} + err = c.client.Get(). + Resource("nodedrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeDrivers. +func (c *nodeDrivers) Watch(ctx context.Context, 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(). + Resource("nodedrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodeDriver and creates it. Returns the server's representation of the nodeDriver, and an error, if there is any. +func (c *nodeDrivers) Create(ctx context.Context, nodeDriver *v3.NodeDriver, opts v1.CreateOptions) (result *v3.NodeDriver, err error) { + result = &v3.NodeDriver{} + err = c.client.Post(). + Resource("nodedrivers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeDriver). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodeDriver and updates it. Returns the server's representation of the nodeDriver, and an error, if there is any. +func (c *nodeDrivers) Update(ctx context.Context, nodeDriver *v3.NodeDriver, opts v1.UpdateOptions) (result *v3.NodeDriver, err error) { + result = &v3.NodeDriver{} + err = c.client.Put(). + Resource("nodedrivers"). + Name(nodeDriver.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeDriver). + Do(ctx). + 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 *nodeDrivers) UpdateStatus(ctx context.Context, nodeDriver *v3.NodeDriver, opts v1.UpdateOptions) (result *v3.NodeDriver, err error) { + result = &v3.NodeDriver{} + err = c.client.Put(). + Resource("nodedrivers"). + Name(nodeDriver.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeDriver). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodeDriver and deletes it. Returns an error if one occurs. +func (c *nodeDrivers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("nodedrivers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodeDrivers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("nodedrivers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodeDriver. +func (c *nodeDrivers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.NodeDriver, err error) { + result = &v3.NodeDriver{} + err = c.client.Patch(pt). + Resource("nodedrivers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/nodepool.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/nodepool.go new file mode 100644 index 00000000..221e24a8 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/nodepool.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// NodePoolsGetter has a method to return a NodePoolInterface. +// A group's client should implement this interface. +type NodePoolsGetter interface { + NodePools(namespace string) NodePoolInterface +} + +// NodePoolInterface has methods to work with NodePool resources. +type NodePoolInterface interface { + Create(ctx context.Context, nodePool *v3.NodePool, opts v1.CreateOptions) (*v3.NodePool, error) + Update(ctx context.Context, nodePool *v3.NodePool, opts v1.UpdateOptions) (*v3.NodePool, error) + UpdateStatus(ctx context.Context, nodePool *v3.NodePool, opts v1.UpdateOptions) (*v3.NodePool, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.NodePool, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.NodePoolList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.NodePool, err error) + NodePoolExpansion +} + +// nodePools implements NodePoolInterface +type nodePools struct { + client rest.Interface + ns string +} + +// newNodePools returns a NodePools +func newNodePools(c *ManagementV3Client, namespace string) *nodePools { + return &nodePools{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the nodePool, and returns the corresponding nodePool object, and an error if there is any. +func (c *nodePools) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.NodePool, err error) { + result = &v3.NodePool{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodepools"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodePools that match those selectors. +func (c *nodePools) List(ctx context.Context, opts v1.ListOptions) (result *v3.NodePoolList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.NodePoolList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodepools"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodePools. +func (c *nodePools) Watch(ctx context.Context, 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("nodepools"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodePool and creates it. Returns the server's representation of the nodePool, and an error, if there is any. +func (c *nodePools) Create(ctx context.Context, nodePool *v3.NodePool, opts v1.CreateOptions) (result *v3.NodePool, err error) { + result = &v3.NodePool{} + err = c.client.Post(). + Namespace(c.ns). + Resource("nodepools"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodePool). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodePool and updates it. Returns the server's representation of the nodePool, and an error, if there is any. +func (c *nodePools) Update(ctx context.Context, nodePool *v3.NodePool, opts v1.UpdateOptions) (result *v3.NodePool, err error) { + result = &v3.NodePool{} + err = c.client.Put(). + Namespace(c.ns). + Resource("nodepools"). + Name(nodePool.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodePool). + Do(ctx). + 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 *nodePools) UpdateStatus(ctx context.Context, nodePool *v3.NodePool, opts v1.UpdateOptions) (result *v3.NodePool, err error) { + result = &v3.NodePool{} + err = c.client.Put(). + Namespace(c.ns). + Resource("nodepools"). + Name(nodePool.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodePool). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodePool and deletes it. Returns an error if one occurs. +func (c *nodePools) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("nodepools"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodePools) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("nodepools"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodePool. +func (c *nodePools) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.NodePool, err error) { + result = &v3.NodePool{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("nodepools"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/nodetemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/nodetemplate.go new file mode 100644 index 00000000..9d2a2774 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/nodetemplate.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// NodeTemplatesGetter has a method to return a NodeTemplateInterface. +// A group's client should implement this interface. +type NodeTemplatesGetter interface { + NodeTemplates(namespace string) NodeTemplateInterface +} + +// NodeTemplateInterface has methods to work with NodeTemplate resources. +type NodeTemplateInterface interface { + Create(ctx context.Context, nodeTemplate *v3.NodeTemplate, opts v1.CreateOptions) (*v3.NodeTemplate, error) + Update(ctx context.Context, nodeTemplate *v3.NodeTemplate, opts v1.UpdateOptions) (*v3.NodeTemplate, error) + UpdateStatus(ctx context.Context, nodeTemplate *v3.NodeTemplate, opts v1.UpdateOptions) (*v3.NodeTemplate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.NodeTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.NodeTemplateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.NodeTemplate, err error) + NodeTemplateExpansion +} + +// nodeTemplates implements NodeTemplateInterface +type nodeTemplates struct { + client rest.Interface + ns string +} + +// newNodeTemplates returns a NodeTemplates +func newNodeTemplates(c *ManagementV3Client, namespace string) *nodeTemplates { + return &nodeTemplates{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the nodeTemplate, and returns the corresponding nodeTemplate object, and an error if there is any. +func (c *nodeTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.NodeTemplate, err error) { + result = &v3.NodeTemplate{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodetemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NodeTemplates that match those selectors. +func (c *nodeTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.NodeTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.NodeTemplateList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("nodetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested nodeTemplates. +func (c *nodeTemplates) Watch(ctx context.Context, 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("nodetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a nodeTemplate and creates it. Returns the server's representation of the nodeTemplate, and an error, if there is any. +func (c *nodeTemplates) Create(ctx context.Context, nodeTemplate *v3.NodeTemplate, opts v1.CreateOptions) (result *v3.NodeTemplate, err error) { + result = &v3.NodeTemplate{} + err = c.client.Post(). + Namespace(c.ns). + Resource("nodetemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a nodeTemplate and updates it. Returns the server's representation of the nodeTemplate, and an error, if there is any. +func (c *nodeTemplates) Update(ctx context.Context, nodeTemplate *v3.NodeTemplate, opts v1.UpdateOptions) (result *v3.NodeTemplate, err error) { + result = &v3.NodeTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("nodetemplates"). + Name(nodeTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeTemplate). + Do(ctx). + 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 *nodeTemplates) UpdateStatus(ctx context.Context, nodeTemplate *v3.NodeTemplate, opts v1.UpdateOptions) (result *v3.NodeTemplate, err error) { + result = &v3.NodeTemplate{} + err = c.client.Put(). + Namespace(c.ns). + Resource("nodetemplates"). + Name(nodeTemplate.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(nodeTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the nodeTemplate and deletes it. Returns an error if one occurs. +func (c *nodeTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("nodetemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *nodeTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("nodetemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched nodeTemplate. +func (c *nodeTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.NodeTemplate, err error) { + result = &v3.NodeTemplate{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("nodetemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/notifier.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/notifier.go new file mode 100644 index 00000000..e712f64b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/notifier.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// NotifiersGetter has a method to return a NotifierInterface. +// A group's client should implement this interface. +type NotifiersGetter interface { + Notifiers(namespace string) NotifierInterface +} + +// NotifierInterface has methods to work with Notifier resources. +type NotifierInterface interface { + Create(ctx context.Context, notifier *v3.Notifier, opts v1.CreateOptions) (*v3.Notifier, error) + Update(ctx context.Context, notifier *v3.Notifier, opts v1.UpdateOptions) (*v3.Notifier, error) + UpdateStatus(ctx context.Context, notifier *v3.Notifier, opts v1.UpdateOptions) (*v3.Notifier, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Notifier, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.NotifierList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Notifier, err error) + NotifierExpansion +} + +// notifiers implements NotifierInterface +type notifiers struct { + client rest.Interface + ns string +} + +// newNotifiers returns a Notifiers +func newNotifiers(c *ManagementV3Client, namespace string) *notifiers { + return ¬ifiers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the notifier, and returns the corresponding notifier object, and an error if there is any. +func (c *notifiers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Notifier, err error) { + result = &v3.Notifier{} + err = c.client.Get(). + Namespace(c.ns). + Resource("notifiers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Notifiers that match those selectors. +func (c *notifiers) List(ctx context.Context, opts v1.ListOptions) (result *v3.NotifierList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.NotifierList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("notifiers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested notifiers. +func (c *notifiers) Watch(ctx context.Context, 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("notifiers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a notifier and creates it. Returns the server's representation of the notifier, and an error, if there is any. +func (c *notifiers) Create(ctx context.Context, notifier *v3.Notifier, opts v1.CreateOptions) (result *v3.Notifier, err error) { + result = &v3.Notifier{} + err = c.client.Post(). + Namespace(c.ns). + Resource("notifiers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(notifier). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a notifier and updates it. Returns the server's representation of the notifier, and an error, if there is any. +func (c *notifiers) Update(ctx context.Context, notifier *v3.Notifier, opts v1.UpdateOptions) (result *v3.Notifier, err error) { + result = &v3.Notifier{} + err = c.client.Put(). + Namespace(c.ns). + Resource("notifiers"). + Name(notifier.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(notifier). + Do(ctx). + 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 *notifiers) UpdateStatus(ctx context.Context, notifier *v3.Notifier, opts v1.UpdateOptions) (result *v3.Notifier, err error) { + result = &v3.Notifier{} + err = c.client.Put(). + Namespace(c.ns). + Resource("notifiers"). + Name(notifier.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(notifier). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the notifier and deletes it. Returns an error if one occurs. +func (c *notifiers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("notifiers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *notifiers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("notifiers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched notifier. +func (c *notifiers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Notifier, err error) { + result = &v3.Notifier{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("notifiers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/oidcprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/oidcprovider.go new file mode 100644 index 00000000..160de46e --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/oidcprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// OIDCProvidersGetter has a method to return a OIDCProviderInterface. +// A group's client should implement this interface. +type OIDCProvidersGetter interface { + OIDCProviders() OIDCProviderInterface +} + +// OIDCProviderInterface has methods to work with OIDCProvider resources. +type OIDCProviderInterface interface { + Create(ctx context.Context, oIDCProvider *v3.OIDCProvider, opts v1.CreateOptions) (*v3.OIDCProvider, error) + Update(ctx context.Context, oIDCProvider *v3.OIDCProvider, opts v1.UpdateOptions) (*v3.OIDCProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.OIDCProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.OIDCProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.OIDCProvider, err error) + OIDCProviderExpansion +} + +// oIDCProviders implements OIDCProviderInterface +type oIDCProviders struct { + client rest.Interface +} + +// newOIDCProviders returns a OIDCProviders +func newOIDCProviders(c *ManagementV3Client) *oIDCProviders { + return &oIDCProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the oIDCProvider, and returns the corresponding oIDCProvider object, and an error if there is any. +func (c *oIDCProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.OIDCProvider, err error) { + result = &v3.OIDCProvider{} + err = c.client.Get(). + Resource("oidcproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OIDCProviders that match those selectors. +func (c *oIDCProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.OIDCProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.OIDCProviderList{} + err = c.client.Get(). + Resource("oidcproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested oIDCProviders. +func (c *oIDCProviders) Watch(ctx context.Context, 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(). + Resource("oidcproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a oIDCProvider and creates it. Returns the server's representation of the oIDCProvider, and an error, if there is any. +func (c *oIDCProviders) Create(ctx context.Context, oIDCProvider *v3.OIDCProvider, opts v1.CreateOptions) (result *v3.OIDCProvider, err error) { + result = &v3.OIDCProvider{} + err = c.client.Post(). + Resource("oidcproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(oIDCProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a oIDCProvider and updates it. Returns the server's representation of the oIDCProvider, and an error, if there is any. +func (c *oIDCProviders) Update(ctx context.Context, oIDCProvider *v3.OIDCProvider, opts v1.UpdateOptions) (result *v3.OIDCProvider, err error) { + result = &v3.OIDCProvider{} + err = c.client.Put(). + Resource("oidcproviders"). + Name(oIDCProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(oIDCProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the oIDCProvider and deletes it. Returns an error if one occurs. +func (c *oIDCProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("oidcproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *oIDCProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("oidcproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched oIDCProvider. +func (c *oIDCProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.OIDCProvider, err error) { + result = &v3.OIDCProvider{} + err = c.client.Patch(pt). + Resource("oidcproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/openldapprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/openldapprovider.go new file mode 100644 index 00000000..cd455b37 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/openldapprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// OpenLdapProvidersGetter has a method to return a OpenLdapProviderInterface. +// A group's client should implement this interface. +type OpenLdapProvidersGetter interface { + OpenLdapProviders() OpenLdapProviderInterface +} + +// OpenLdapProviderInterface has methods to work with OpenLdapProvider resources. +type OpenLdapProviderInterface interface { + Create(ctx context.Context, openLdapProvider *v3.OpenLdapProvider, opts v1.CreateOptions) (*v3.OpenLdapProvider, error) + Update(ctx context.Context, openLdapProvider *v3.OpenLdapProvider, opts v1.UpdateOptions) (*v3.OpenLdapProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.OpenLdapProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.OpenLdapProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.OpenLdapProvider, err error) + OpenLdapProviderExpansion +} + +// openLdapProviders implements OpenLdapProviderInterface +type openLdapProviders struct { + client rest.Interface +} + +// newOpenLdapProviders returns a OpenLdapProviders +func newOpenLdapProviders(c *ManagementV3Client) *openLdapProviders { + return &openLdapProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the openLdapProvider, and returns the corresponding openLdapProvider object, and an error if there is any. +func (c *openLdapProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.OpenLdapProvider, err error) { + result = &v3.OpenLdapProvider{} + err = c.client.Get(). + Resource("openldapproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of OpenLdapProviders that match those selectors. +func (c *openLdapProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.OpenLdapProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.OpenLdapProviderList{} + err = c.client.Get(). + Resource("openldapproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested openLdapProviders. +func (c *openLdapProviders) Watch(ctx context.Context, 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(). + Resource("openldapproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a openLdapProvider and creates it. Returns the server's representation of the openLdapProvider, and an error, if there is any. +func (c *openLdapProviders) Create(ctx context.Context, openLdapProvider *v3.OpenLdapProvider, opts v1.CreateOptions) (result *v3.OpenLdapProvider, err error) { + result = &v3.OpenLdapProvider{} + err = c.client.Post(). + Resource("openldapproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(openLdapProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a openLdapProvider and updates it. Returns the server's representation of the openLdapProvider, and an error, if there is any. +func (c *openLdapProviders) Update(ctx context.Context, openLdapProvider *v3.OpenLdapProvider, opts v1.UpdateOptions) (result *v3.OpenLdapProvider, err error) { + result = &v3.OpenLdapProvider{} + err = c.client.Put(). + Resource("openldapproviders"). + Name(openLdapProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(openLdapProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the openLdapProvider and deletes it. Returns an error if one occurs. +func (c *openLdapProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("openldapproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *openLdapProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("openldapproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched openLdapProvider. +func (c *openLdapProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.OpenLdapProvider, err error) { + result = &v3.OpenLdapProvider{} + err = c.client.Patch(pt). + Resource("openldapproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/podsecuritypolicytemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/podsecuritypolicytemplate.go new file mode 100644 index 00000000..ca4034bc --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/podsecuritypolicytemplate.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// PodSecurityPolicyTemplatesGetter has a method to return a PodSecurityPolicyTemplateInterface. +// A group's client should implement this interface. +type PodSecurityPolicyTemplatesGetter interface { + PodSecurityPolicyTemplates() PodSecurityPolicyTemplateInterface +} + +// PodSecurityPolicyTemplateInterface has methods to work with PodSecurityPolicyTemplate resources. +type PodSecurityPolicyTemplateInterface interface { + Create(ctx context.Context, podSecurityPolicyTemplate *v3.PodSecurityPolicyTemplate, opts v1.CreateOptions) (*v3.PodSecurityPolicyTemplate, error) + Update(ctx context.Context, podSecurityPolicyTemplate *v3.PodSecurityPolicyTemplate, opts v1.UpdateOptions) (*v3.PodSecurityPolicyTemplate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.PodSecurityPolicyTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.PodSecurityPolicyTemplateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.PodSecurityPolicyTemplate, err error) + PodSecurityPolicyTemplateExpansion +} + +// podSecurityPolicyTemplates implements PodSecurityPolicyTemplateInterface +type podSecurityPolicyTemplates struct { + client rest.Interface +} + +// newPodSecurityPolicyTemplates returns a PodSecurityPolicyTemplates +func newPodSecurityPolicyTemplates(c *ManagementV3Client) *podSecurityPolicyTemplates { + return &podSecurityPolicyTemplates{ + client: c.RESTClient(), + } +} + +// Get takes name of the podSecurityPolicyTemplate, and returns the corresponding podSecurityPolicyTemplate object, and an error if there is any. +func (c *podSecurityPolicyTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.PodSecurityPolicyTemplate, err error) { + result = &v3.PodSecurityPolicyTemplate{} + err = c.client.Get(). + Resource("podsecuritypolicytemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PodSecurityPolicyTemplates that match those selectors. +func (c *podSecurityPolicyTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.PodSecurityPolicyTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.PodSecurityPolicyTemplateList{} + err = c.client.Get(). + Resource("podsecuritypolicytemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested podSecurityPolicyTemplates. +func (c *podSecurityPolicyTemplates) Watch(ctx context.Context, 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(). + Resource("podsecuritypolicytemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a podSecurityPolicyTemplate and creates it. Returns the server's representation of the podSecurityPolicyTemplate, and an error, if there is any. +func (c *podSecurityPolicyTemplates) Create(ctx context.Context, podSecurityPolicyTemplate *v3.PodSecurityPolicyTemplate, opts v1.CreateOptions) (result *v3.PodSecurityPolicyTemplate, err error) { + result = &v3.PodSecurityPolicyTemplate{} + err = c.client.Post(). + Resource("podsecuritypolicytemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podSecurityPolicyTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a podSecurityPolicyTemplate and updates it. Returns the server's representation of the podSecurityPolicyTemplate, and an error, if there is any. +func (c *podSecurityPolicyTemplates) Update(ctx context.Context, podSecurityPolicyTemplate *v3.PodSecurityPolicyTemplate, opts v1.UpdateOptions) (result *v3.PodSecurityPolicyTemplate, err error) { + result = &v3.PodSecurityPolicyTemplate{} + err = c.client.Put(). + Resource("podsecuritypolicytemplates"). + Name(podSecurityPolicyTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podSecurityPolicyTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the podSecurityPolicyTemplate and deletes it. Returns an error if one occurs. +func (c *podSecurityPolicyTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("podsecuritypolicytemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *podSecurityPolicyTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("podsecuritypolicytemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched podSecurityPolicyTemplate. +func (c *podSecurityPolicyTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.PodSecurityPolicyTemplate, err error) { + result = &v3.PodSecurityPolicyTemplate{} + err = c.client.Patch(pt). + Resource("podsecuritypolicytemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/podsecuritypolicytemplateprojectbinding.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/podsecuritypolicytemplateprojectbinding.go new file mode 100644 index 00000000..dae6f86c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/podsecuritypolicytemplateprojectbinding.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// PodSecurityPolicyTemplateProjectBindingsGetter has a method to return a PodSecurityPolicyTemplateProjectBindingInterface. +// A group's client should implement this interface. +type PodSecurityPolicyTemplateProjectBindingsGetter interface { + PodSecurityPolicyTemplateProjectBindings(namespace string) PodSecurityPolicyTemplateProjectBindingInterface +} + +// PodSecurityPolicyTemplateProjectBindingInterface has methods to work with PodSecurityPolicyTemplateProjectBinding resources. +type PodSecurityPolicyTemplateProjectBindingInterface interface { + Create(ctx context.Context, podSecurityPolicyTemplateProjectBinding *v3.PodSecurityPolicyTemplateProjectBinding, opts v1.CreateOptions) (*v3.PodSecurityPolicyTemplateProjectBinding, error) + Update(ctx context.Context, podSecurityPolicyTemplateProjectBinding *v3.PodSecurityPolicyTemplateProjectBinding, opts v1.UpdateOptions) (*v3.PodSecurityPolicyTemplateProjectBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.PodSecurityPolicyTemplateProjectBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.PodSecurityPolicyTemplateProjectBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.PodSecurityPolicyTemplateProjectBinding, err error) + PodSecurityPolicyTemplateProjectBindingExpansion +} + +// podSecurityPolicyTemplateProjectBindings implements PodSecurityPolicyTemplateProjectBindingInterface +type podSecurityPolicyTemplateProjectBindings struct { + client rest.Interface + ns string +} + +// newPodSecurityPolicyTemplateProjectBindings returns a PodSecurityPolicyTemplateProjectBindings +func newPodSecurityPolicyTemplateProjectBindings(c *ManagementV3Client, namespace string) *podSecurityPolicyTemplateProjectBindings { + return &podSecurityPolicyTemplateProjectBindings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the podSecurityPolicyTemplateProjectBinding, and returns the corresponding podSecurityPolicyTemplateProjectBinding object, and an error if there is any. +func (c *podSecurityPolicyTemplateProjectBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.PodSecurityPolicyTemplateProjectBinding, err error) { + result = &v3.PodSecurityPolicyTemplateProjectBinding{} + err = c.client.Get(). + Namespace(c.ns). + Resource("podsecuritypolicytemplateprojectbindings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PodSecurityPolicyTemplateProjectBindings that match those selectors. +func (c *podSecurityPolicyTemplateProjectBindings) List(ctx context.Context, opts v1.ListOptions) (result *v3.PodSecurityPolicyTemplateProjectBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.PodSecurityPolicyTemplateProjectBindingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("podsecuritypolicytemplateprojectbindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested podSecurityPolicyTemplateProjectBindings. +func (c *podSecurityPolicyTemplateProjectBindings) Watch(ctx context.Context, 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("podsecuritypolicytemplateprojectbindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a podSecurityPolicyTemplateProjectBinding and creates it. Returns the server's representation of the podSecurityPolicyTemplateProjectBinding, and an error, if there is any. +func (c *podSecurityPolicyTemplateProjectBindings) Create(ctx context.Context, podSecurityPolicyTemplateProjectBinding *v3.PodSecurityPolicyTemplateProjectBinding, opts v1.CreateOptions) (result *v3.PodSecurityPolicyTemplateProjectBinding, err error) { + result = &v3.PodSecurityPolicyTemplateProjectBinding{} + err = c.client.Post(). + Namespace(c.ns). + Resource("podsecuritypolicytemplateprojectbindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podSecurityPolicyTemplateProjectBinding). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a podSecurityPolicyTemplateProjectBinding and updates it. Returns the server's representation of the podSecurityPolicyTemplateProjectBinding, and an error, if there is any. +func (c *podSecurityPolicyTemplateProjectBindings) Update(ctx context.Context, podSecurityPolicyTemplateProjectBinding *v3.PodSecurityPolicyTemplateProjectBinding, opts v1.UpdateOptions) (result *v3.PodSecurityPolicyTemplateProjectBinding, err error) { + result = &v3.PodSecurityPolicyTemplateProjectBinding{} + err = c.client.Put(). + Namespace(c.ns). + Resource("podsecuritypolicytemplateprojectbindings"). + Name(podSecurityPolicyTemplateProjectBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podSecurityPolicyTemplateProjectBinding). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the podSecurityPolicyTemplateProjectBinding and deletes it. Returns an error if one occurs. +func (c *podSecurityPolicyTemplateProjectBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("podsecuritypolicytemplateprojectbindings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *podSecurityPolicyTemplateProjectBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("podsecuritypolicytemplateprojectbindings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched podSecurityPolicyTemplateProjectBinding. +func (c *podSecurityPolicyTemplateProjectBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.PodSecurityPolicyTemplateProjectBinding, err error) { + result = &v3.PodSecurityPolicyTemplateProjectBinding{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("podsecuritypolicytemplateprojectbindings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/preference.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/preference.go new file mode 100644 index 00000000..fa3ba375 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/preference.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// PreferencesGetter has a method to return a PreferenceInterface. +// A group's client should implement this interface. +type PreferencesGetter interface { + Preferences(namespace string) PreferenceInterface +} + +// PreferenceInterface has methods to work with Preference resources. +type PreferenceInterface interface { + Create(ctx context.Context, preference *v3.Preference, opts v1.CreateOptions) (*v3.Preference, error) + Update(ctx context.Context, preference *v3.Preference, opts v1.UpdateOptions) (*v3.Preference, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Preference, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.PreferenceList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Preference, err error) + PreferenceExpansion +} + +// preferences implements PreferenceInterface +type preferences struct { + client rest.Interface + ns string +} + +// newPreferences returns a Preferences +func newPreferences(c *ManagementV3Client, namespace string) *preferences { + return &preferences{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the preference, and returns the corresponding preference object, and an error if there is any. +func (c *preferences) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Preference, err error) { + result = &v3.Preference{} + err = c.client.Get(). + Namespace(c.ns). + Resource("preferences"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Preferences that match those selectors. +func (c *preferences) List(ctx context.Context, opts v1.ListOptions) (result *v3.PreferenceList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.PreferenceList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("preferences"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested preferences. +func (c *preferences) Watch(ctx context.Context, 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("preferences"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a preference and creates it. Returns the server's representation of the preference, and an error, if there is any. +func (c *preferences) Create(ctx context.Context, preference *v3.Preference, opts v1.CreateOptions) (result *v3.Preference, err error) { + result = &v3.Preference{} + err = c.client.Post(). + Namespace(c.ns). + Resource("preferences"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(preference). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a preference and updates it. Returns the server's representation of the preference, and an error, if there is any. +func (c *preferences) Update(ctx context.Context, preference *v3.Preference, opts v1.UpdateOptions) (result *v3.Preference, err error) { + result = &v3.Preference{} + err = c.client.Put(). + Namespace(c.ns). + Resource("preferences"). + Name(preference.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(preference). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the preference and deletes it. Returns an error if one occurs. +func (c *preferences) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("preferences"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *preferences) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("preferences"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched preference. +func (c *preferences) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Preference, err error) { + result = &v3.Preference{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("preferences"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/principal.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/principal.go new file mode 100644 index 00000000..66975d68 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/principal.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// PrincipalsGetter has a method to return a PrincipalInterface. +// A group's client should implement this interface. +type PrincipalsGetter interface { + Principals() PrincipalInterface +} + +// PrincipalInterface has methods to work with Principal resources. +type PrincipalInterface interface { + Create(ctx context.Context, principal *v3.Principal, opts v1.CreateOptions) (*v3.Principal, error) + Update(ctx context.Context, principal *v3.Principal, opts v1.UpdateOptions) (*v3.Principal, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Principal, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.PrincipalList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Principal, err error) + PrincipalExpansion +} + +// principals implements PrincipalInterface +type principals struct { + client rest.Interface +} + +// newPrincipals returns a Principals +func newPrincipals(c *ManagementV3Client) *principals { + return &principals{ + client: c.RESTClient(), + } +} + +// Get takes name of the principal, and returns the corresponding principal object, and an error if there is any. +func (c *principals) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Principal, err error) { + result = &v3.Principal{} + err = c.client.Get(). + Resource("principals"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Principals that match those selectors. +func (c *principals) List(ctx context.Context, opts v1.ListOptions) (result *v3.PrincipalList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.PrincipalList{} + err = c.client.Get(). + Resource("principals"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested principals. +func (c *principals) Watch(ctx context.Context, 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(). + Resource("principals"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a principal and creates it. Returns the server's representation of the principal, and an error, if there is any. +func (c *principals) Create(ctx context.Context, principal *v3.Principal, opts v1.CreateOptions) (result *v3.Principal, err error) { + result = &v3.Principal{} + err = c.client.Post(). + Resource("principals"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(principal). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a principal and updates it. Returns the server's representation of the principal, and an error, if there is any. +func (c *principals) Update(ctx context.Context, principal *v3.Principal, opts v1.UpdateOptions) (result *v3.Principal, err error) { + result = &v3.Principal{} + err = c.client.Put(). + Resource("principals"). + Name(principal.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(principal). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the principal and deletes it. Returns an error if one occurs. +func (c *principals) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("principals"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *principals) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("principals"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched principal. +func (c *principals) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Principal, err error) { + result = &v3.Principal{} + err = c.client.Patch(pt). + Resource("principals"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/project.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/project.go new file mode 100644 index 00000000..927f84e0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/project.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ProjectsGetter has a method to return a ProjectInterface. +// A group's client should implement this interface. +type ProjectsGetter interface { + Projects(namespace string) ProjectInterface +} + +// ProjectInterface has methods to work with Project resources. +type ProjectInterface interface { + Create(ctx context.Context, project *v3.Project, opts v1.CreateOptions) (*v3.Project, error) + Update(ctx context.Context, project *v3.Project, opts v1.UpdateOptions) (*v3.Project, error) + UpdateStatus(ctx context.Context, project *v3.Project, opts v1.UpdateOptions) (*v3.Project, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Project, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ProjectList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Project, err error) + ProjectExpansion +} + +// projects implements ProjectInterface +type projects struct { + client rest.Interface + ns string +} + +// newProjects returns a Projects +func newProjects(c *ManagementV3Client, namespace string) *projects { + return &projects{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the project, and returns the corresponding project object, and an error if there is any. +func (c *projects) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Project, err error) { + result = &v3.Project{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projects"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Projects that match those selectors. +func (c *projects) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ProjectList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projects. +func (c *projects) Watch(ctx context.Context, 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("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a project and creates it. Returns the server's representation of the project, and an error, if there is any. +func (c *projects) Create(ctx context.Context, project *v3.Project, opts v1.CreateOptions) (result *v3.Project, err error) { + result = &v3.Project{} + err = c.client.Post(). + Namespace(c.ns). + Resource("projects"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(project). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a project and updates it. Returns the server's representation of the project, and an error, if there is any. +func (c *projects) Update(ctx context.Context, project *v3.Project, opts v1.UpdateOptions) (result *v3.Project, err error) { + result = &v3.Project{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projects"). + Name(project.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(project). + Do(ctx). + 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 *projects) UpdateStatus(ctx context.Context, project *v3.Project, opts v1.UpdateOptions) (result *v3.Project, err error) { + result = &v3.Project{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projects"). + Name(project.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(project). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the project and deletes it. Returns an error if one occurs. +func (c *projects) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("projects"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projects) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("projects"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched project. +func (c *projects) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Project, err error) { + result = &v3.Project{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("projects"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectalert.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectalert.go new file mode 100644 index 00000000..61de2b01 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectalert.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ProjectAlertsGetter has a method to return a ProjectAlertInterface. +// A group's client should implement this interface. +type ProjectAlertsGetter interface { + ProjectAlerts(namespace string) ProjectAlertInterface +} + +// ProjectAlertInterface has methods to work with ProjectAlert resources. +type ProjectAlertInterface interface { + Create(ctx context.Context, projectAlert *v3.ProjectAlert, opts v1.CreateOptions) (*v3.ProjectAlert, error) + Update(ctx context.Context, projectAlert *v3.ProjectAlert, opts v1.UpdateOptions) (*v3.ProjectAlert, error) + UpdateStatus(ctx context.Context, projectAlert *v3.ProjectAlert, opts v1.UpdateOptions) (*v3.ProjectAlert, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ProjectAlert, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ProjectAlertList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectAlert, err error) + ProjectAlertExpansion +} + +// projectAlerts implements ProjectAlertInterface +type projectAlerts struct { + client rest.Interface + ns string +} + +// newProjectAlerts returns a ProjectAlerts +func newProjectAlerts(c *ManagementV3Client, namespace string) *projectAlerts { + return &projectAlerts{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the projectAlert, and returns the corresponding projectAlert object, and an error if there is any. +func (c *projectAlerts) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectAlert, err error) { + result = &v3.ProjectAlert{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectalerts"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectAlerts that match those selectors. +func (c *projectAlerts) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectAlertList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ProjectAlertList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectalerts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectAlerts. +func (c *projectAlerts) Watch(ctx context.Context, 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("projectalerts"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectAlert and creates it. Returns the server's representation of the projectAlert, and an error, if there is any. +func (c *projectAlerts) Create(ctx context.Context, projectAlert *v3.ProjectAlert, opts v1.CreateOptions) (result *v3.ProjectAlert, err error) { + result = &v3.ProjectAlert{} + err = c.client.Post(). + Namespace(c.ns). + Resource("projectalerts"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectAlert). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectAlert and updates it. Returns the server's representation of the projectAlert, and an error, if there is any. +func (c *projectAlerts) Update(ctx context.Context, projectAlert *v3.ProjectAlert, opts v1.UpdateOptions) (result *v3.ProjectAlert, err error) { + result = &v3.ProjectAlert{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectalerts"). + Name(projectAlert.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectAlert). + Do(ctx). + 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 *projectAlerts) UpdateStatus(ctx context.Context, projectAlert *v3.ProjectAlert, opts v1.UpdateOptions) (result *v3.ProjectAlert, err error) { + result = &v3.ProjectAlert{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectalerts"). + Name(projectAlert.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectAlert). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectAlert and deletes it. Returns an error if one occurs. +func (c *projectAlerts) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("projectalerts"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectAlerts) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("projectalerts"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectAlert. +func (c *projectAlerts) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectAlert, err error) { + result = &v3.ProjectAlert{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("projectalerts"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectalertgroup.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectalertgroup.go new file mode 100644 index 00000000..79b1b34d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectalertgroup.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ProjectAlertGroupsGetter has a method to return a ProjectAlertGroupInterface. +// A group's client should implement this interface. +type ProjectAlertGroupsGetter interface { + ProjectAlertGroups(namespace string) ProjectAlertGroupInterface +} + +// ProjectAlertGroupInterface has methods to work with ProjectAlertGroup resources. +type ProjectAlertGroupInterface interface { + Create(ctx context.Context, projectAlertGroup *v3.ProjectAlertGroup, opts v1.CreateOptions) (*v3.ProjectAlertGroup, error) + Update(ctx context.Context, projectAlertGroup *v3.ProjectAlertGroup, opts v1.UpdateOptions) (*v3.ProjectAlertGroup, error) + UpdateStatus(ctx context.Context, projectAlertGroup *v3.ProjectAlertGroup, opts v1.UpdateOptions) (*v3.ProjectAlertGroup, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ProjectAlertGroup, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ProjectAlertGroupList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectAlertGroup, err error) + ProjectAlertGroupExpansion +} + +// projectAlertGroups implements ProjectAlertGroupInterface +type projectAlertGroups struct { + client rest.Interface + ns string +} + +// newProjectAlertGroups returns a ProjectAlertGroups +func newProjectAlertGroups(c *ManagementV3Client, namespace string) *projectAlertGroups { + return &projectAlertGroups{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the projectAlertGroup, and returns the corresponding projectAlertGroup object, and an error if there is any. +func (c *projectAlertGroups) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectAlertGroup, err error) { + result = &v3.ProjectAlertGroup{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectalertgroups"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectAlertGroups that match those selectors. +func (c *projectAlertGroups) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectAlertGroupList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ProjectAlertGroupList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectalertgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectAlertGroups. +func (c *projectAlertGroups) Watch(ctx context.Context, 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("projectalertgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectAlertGroup and creates it. Returns the server's representation of the projectAlertGroup, and an error, if there is any. +func (c *projectAlertGroups) Create(ctx context.Context, projectAlertGroup *v3.ProjectAlertGroup, opts v1.CreateOptions) (result *v3.ProjectAlertGroup, err error) { + result = &v3.ProjectAlertGroup{} + err = c.client.Post(). + Namespace(c.ns). + Resource("projectalertgroups"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectAlertGroup). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectAlertGroup and updates it. Returns the server's representation of the projectAlertGroup, and an error, if there is any. +func (c *projectAlertGroups) Update(ctx context.Context, projectAlertGroup *v3.ProjectAlertGroup, opts v1.UpdateOptions) (result *v3.ProjectAlertGroup, err error) { + result = &v3.ProjectAlertGroup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectalertgroups"). + Name(projectAlertGroup.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectAlertGroup). + Do(ctx). + 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 *projectAlertGroups) UpdateStatus(ctx context.Context, projectAlertGroup *v3.ProjectAlertGroup, opts v1.UpdateOptions) (result *v3.ProjectAlertGroup, err error) { + result = &v3.ProjectAlertGroup{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectalertgroups"). + Name(projectAlertGroup.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectAlertGroup). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectAlertGroup and deletes it. Returns an error if one occurs. +func (c *projectAlertGroups) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("projectalertgroups"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectAlertGroups) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("projectalertgroups"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectAlertGroup. +func (c *projectAlertGroups) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectAlertGroup, err error) { + result = &v3.ProjectAlertGroup{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("projectalertgroups"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectalertrule.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectalertrule.go new file mode 100644 index 00000000..0670b3d7 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectalertrule.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ProjectAlertRulesGetter has a method to return a ProjectAlertRuleInterface. +// A group's client should implement this interface. +type ProjectAlertRulesGetter interface { + ProjectAlertRules(namespace string) ProjectAlertRuleInterface +} + +// ProjectAlertRuleInterface has methods to work with ProjectAlertRule resources. +type ProjectAlertRuleInterface interface { + Create(ctx context.Context, projectAlertRule *v3.ProjectAlertRule, opts v1.CreateOptions) (*v3.ProjectAlertRule, error) + Update(ctx context.Context, projectAlertRule *v3.ProjectAlertRule, opts v1.UpdateOptions) (*v3.ProjectAlertRule, error) + UpdateStatus(ctx context.Context, projectAlertRule *v3.ProjectAlertRule, opts v1.UpdateOptions) (*v3.ProjectAlertRule, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ProjectAlertRule, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ProjectAlertRuleList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectAlertRule, err error) + ProjectAlertRuleExpansion +} + +// projectAlertRules implements ProjectAlertRuleInterface +type projectAlertRules struct { + client rest.Interface + ns string +} + +// newProjectAlertRules returns a ProjectAlertRules +func newProjectAlertRules(c *ManagementV3Client, namespace string) *projectAlertRules { + return &projectAlertRules{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the projectAlertRule, and returns the corresponding projectAlertRule object, and an error if there is any. +func (c *projectAlertRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectAlertRule, err error) { + result = &v3.ProjectAlertRule{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectalertrules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectAlertRules that match those selectors. +func (c *projectAlertRules) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectAlertRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ProjectAlertRuleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectalertrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectAlertRules. +func (c *projectAlertRules) Watch(ctx context.Context, 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("projectalertrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectAlertRule and creates it. Returns the server's representation of the projectAlertRule, and an error, if there is any. +func (c *projectAlertRules) Create(ctx context.Context, projectAlertRule *v3.ProjectAlertRule, opts v1.CreateOptions) (result *v3.ProjectAlertRule, err error) { + result = &v3.ProjectAlertRule{} + err = c.client.Post(). + Namespace(c.ns). + Resource("projectalertrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectAlertRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectAlertRule and updates it. Returns the server's representation of the projectAlertRule, and an error, if there is any. +func (c *projectAlertRules) Update(ctx context.Context, projectAlertRule *v3.ProjectAlertRule, opts v1.UpdateOptions) (result *v3.ProjectAlertRule, err error) { + result = &v3.ProjectAlertRule{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectalertrules"). + Name(projectAlertRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectAlertRule). + Do(ctx). + 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 *projectAlertRules) UpdateStatus(ctx context.Context, projectAlertRule *v3.ProjectAlertRule, opts v1.UpdateOptions) (result *v3.ProjectAlertRule, err error) { + result = &v3.ProjectAlertRule{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectalertrules"). + Name(projectAlertRule.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectAlertRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectAlertRule and deletes it. Returns an error if one occurs. +func (c *projectAlertRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("projectalertrules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectAlertRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("projectalertrules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectAlertRule. +func (c *projectAlertRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectAlertRule, err error) { + result = &v3.ProjectAlertRule{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("projectalertrules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectcatalog.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectcatalog.go new file mode 100644 index 00000000..c9127b62 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectcatalog.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ProjectCatalogsGetter has a method to return a ProjectCatalogInterface. +// A group's client should implement this interface. +type ProjectCatalogsGetter interface { + ProjectCatalogs(namespace string) ProjectCatalogInterface +} + +// ProjectCatalogInterface has methods to work with ProjectCatalog resources. +type ProjectCatalogInterface interface { + Create(ctx context.Context, projectCatalog *v3.ProjectCatalog, opts v1.CreateOptions) (*v3.ProjectCatalog, error) + Update(ctx context.Context, projectCatalog *v3.ProjectCatalog, opts v1.UpdateOptions) (*v3.ProjectCatalog, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ProjectCatalog, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ProjectCatalogList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectCatalog, err error) + ProjectCatalogExpansion +} + +// projectCatalogs implements ProjectCatalogInterface +type projectCatalogs struct { + client rest.Interface + ns string +} + +// newProjectCatalogs returns a ProjectCatalogs +func newProjectCatalogs(c *ManagementV3Client, namespace string) *projectCatalogs { + return &projectCatalogs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the projectCatalog, and returns the corresponding projectCatalog object, and an error if there is any. +func (c *projectCatalogs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectCatalog, err error) { + result = &v3.ProjectCatalog{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectcatalogs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectCatalogs that match those selectors. +func (c *projectCatalogs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectCatalogList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ProjectCatalogList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectcatalogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectCatalogs. +func (c *projectCatalogs) Watch(ctx context.Context, 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("projectcatalogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectCatalog and creates it. Returns the server's representation of the projectCatalog, and an error, if there is any. +func (c *projectCatalogs) Create(ctx context.Context, projectCatalog *v3.ProjectCatalog, opts v1.CreateOptions) (result *v3.ProjectCatalog, err error) { + result = &v3.ProjectCatalog{} + err = c.client.Post(). + Namespace(c.ns). + Resource("projectcatalogs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectCatalog). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectCatalog and updates it. Returns the server's representation of the projectCatalog, and an error, if there is any. +func (c *projectCatalogs) Update(ctx context.Context, projectCatalog *v3.ProjectCatalog, opts v1.UpdateOptions) (result *v3.ProjectCatalog, err error) { + result = &v3.ProjectCatalog{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectcatalogs"). + Name(projectCatalog.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectCatalog). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectCatalog and deletes it. Returns an error if one occurs. +func (c *projectCatalogs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("projectcatalogs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectCatalogs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("projectcatalogs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectCatalog. +func (c *projectCatalogs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectCatalog, err error) { + result = &v3.ProjectCatalog{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("projectcatalogs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectlogging.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectlogging.go new file mode 100644 index 00000000..841c1862 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectlogging.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ProjectLoggingsGetter has a method to return a ProjectLoggingInterface. +// A group's client should implement this interface. +type ProjectLoggingsGetter interface { + ProjectLoggings(namespace string) ProjectLoggingInterface +} + +// ProjectLoggingInterface has methods to work with ProjectLogging resources. +type ProjectLoggingInterface interface { + Create(ctx context.Context, projectLogging *v3.ProjectLogging, opts v1.CreateOptions) (*v3.ProjectLogging, error) + Update(ctx context.Context, projectLogging *v3.ProjectLogging, opts v1.UpdateOptions) (*v3.ProjectLogging, error) + UpdateStatus(ctx context.Context, projectLogging *v3.ProjectLogging, opts v1.UpdateOptions) (*v3.ProjectLogging, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ProjectLogging, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ProjectLoggingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectLogging, err error) + ProjectLoggingExpansion +} + +// projectLoggings implements ProjectLoggingInterface +type projectLoggings struct { + client rest.Interface + ns string +} + +// newProjectLoggings returns a ProjectLoggings +func newProjectLoggings(c *ManagementV3Client, namespace string) *projectLoggings { + return &projectLoggings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the projectLogging, and returns the corresponding projectLogging object, and an error if there is any. +func (c *projectLoggings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectLogging, err error) { + result = &v3.ProjectLogging{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectloggings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectLoggings that match those selectors. +func (c *projectLoggings) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectLoggingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ProjectLoggingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectloggings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectLoggings. +func (c *projectLoggings) Watch(ctx context.Context, 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("projectloggings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectLogging and creates it. Returns the server's representation of the projectLogging, and an error, if there is any. +func (c *projectLoggings) Create(ctx context.Context, projectLogging *v3.ProjectLogging, opts v1.CreateOptions) (result *v3.ProjectLogging, err error) { + result = &v3.ProjectLogging{} + err = c.client.Post(). + Namespace(c.ns). + Resource("projectloggings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectLogging). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectLogging and updates it. Returns the server's representation of the projectLogging, and an error, if there is any. +func (c *projectLoggings) Update(ctx context.Context, projectLogging *v3.ProjectLogging, opts v1.UpdateOptions) (result *v3.ProjectLogging, err error) { + result = &v3.ProjectLogging{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectloggings"). + Name(projectLogging.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectLogging). + Do(ctx). + 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 *projectLoggings) UpdateStatus(ctx context.Context, projectLogging *v3.ProjectLogging, opts v1.UpdateOptions) (result *v3.ProjectLogging, err error) { + result = &v3.ProjectLogging{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectloggings"). + Name(projectLogging.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectLogging). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectLogging and deletes it. Returns an error if one occurs. +func (c *projectLoggings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("projectloggings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectLoggings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("projectloggings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectLogging. +func (c *projectLoggings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectLogging, err error) { + result = &v3.ProjectLogging{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("projectloggings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectmonitorgraph.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectmonitorgraph.go new file mode 100644 index 00000000..5752c943 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectmonitorgraph.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ProjectMonitorGraphsGetter has a method to return a ProjectMonitorGraphInterface. +// A group's client should implement this interface. +type ProjectMonitorGraphsGetter interface { + ProjectMonitorGraphs(namespace string) ProjectMonitorGraphInterface +} + +// ProjectMonitorGraphInterface has methods to work with ProjectMonitorGraph resources. +type ProjectMonitorGraphInterface interface { + Create(ctx context.Context, projectMonitorGraph *v3.ProjectMonitorGraph, opts v1.CreateOptions) (*v3.ProjectMonitorGraph, error) + Update(ctx context.Context, projectMonitorGraph *v3.ProjectMonitorGraph, opts v1.UpdateOptions) (*v3.ProjectMonitorGraph, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ProjectMonitorGraph, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ProjectMonitorGraphList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectMonitorGraph, err error) + ProjectMonitorGraphExpansion +} + +// projectMonitorGraphs implements ProjectMonitorGraphInterface +type projectMonitorGraphs struct { + client rest.Interface + ns string +} + +// newProjectMonitorGraphs returns a ProjectMonitorGraphs +func newProjectMonitorGraphs(c *ManagementV3Client, namespace string) *projectMonitorGraphs { + return &projectMonitorGraphs{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the projectMonitorGraph, and returns the corresponding projectMonitorGraph object, and an error if there is any. +func (c *projectMonitorGraphs) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectMonitorGraph, err error) { + result = &v3.ProjectMonitorGraph{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectmonitorgraphs"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectMonitorGraphs that match those selectors. +func (c *projectMonitorGraphs) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectMonitorGraphList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ProjectMonitorGraphList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectmonitorgraphs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectMonitorGraphs. +func (c *projectMonitorGraphs) Watch(ctx context.Context, 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("projectmonitorgraphs"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectMonitorGraph and creates it. Returns the server's representation of the projectMonitorGraph, and an error, if there is any. +func (c *projectMonitorGraphs) Create(ctx context.Context, projectMonitorGraph *v3.ProjectMonitorGraph, opts v1.CreateOptions) (result *v3.ProjectMonitorGraph, err error) { + result = &v3.ProjectMonitorGraph{} + err = c.client.Post(). + Namespace(c.ns). + Resource("projectmonitorgraphs"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectMonitorGraph). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectMonitorGraph and updates it. Returns the server's representation of the projectMonitorGraph, and an error, if there is any. +func (c *projectMonitorGraphs) Update(ctx context.Context, projectMonitorGraph *v3.ProjectMonitorGraph, opts v1.UpdateOptions) (result *v3.ProjectMonitorGraph, err error) { + result = &v3.ProjectMonitorGraph{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectmonitorgraphs"). + Name(projectMonitorGraph.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectMonitorGraph). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectMonitorGraph and deletes it. Returns an error if one occurs. +func (c *projectMonitorGraphs) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("projectmonitorgraphs"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectMonitorGraphs) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("projectmonitorgraphs"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectMonitorGraph. +func (c *projectMonitorGraphs) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectMonitorGraph, err error) { + result = &v3.ProjectMonitorGraph{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("projectmonitorgraphs"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectnetworkpolicy.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectnetworkpolicy.go new file mode 100644 index 00000000..d71f297e --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectnetworkpolicy.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ProjectNetworkPoliciesGetter has a method to return a ProjectNetworkPolicyInterface. +// A group's client should implement this interface. +type ProjectNetworkPoliciesGetter interface { + ProjectNetworkPolicies(namespace string) ProjectNetworkPolicyInterface +} + +// ProjectNetworkPolicyInterface has methods to work with ProjectNetworkPolicy resources. +type ProjectNetworkPolicyInterface interface { + Create(ctx context.Context, projectNetworkPolicy *v3.ProjectNetworkPolicy, opts v1.CreateOptions) (*v3.ProjectNetworkPolicy, error) + Update(ctx context.Context, projectNetworkPolicy *v3.ProjectNetworkPolicy, opts v1.UpdateOptions) (*v3.ProjectNetworkPolicy, error) + UpdateStatus(ctx context.Context, projectNetworkPolicy *v3.ProjectNetworkPolicy, opts v1.UpdateOptions) (*v3.ProjectNetworkPolicy, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ProjectNetworkPolicy, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ProjectNetworkPolicyList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectNetworkPolicy, err error) + ProjectNetworkPolicyExpansion +} + +// projectNetworkPolicies implements ProjectNetworkPolicyInterface +type projectNetworkPolicies struct { + client rest.Interface + ns string +} + +// newProjectNetworkPolicies returns a ProjectNetworkPolicies +func newProjectNetworkPolicies(c *ManagementV3Client, namespace string) *projectNetworkPolicies { + return &projectNetworkPolicies{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the projectNetworkPolicy, and returns the corresponding projectNetworkPolicy object, and an error if there is any. +func (c *projectNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectNetworkPolicy, err error) { + result = &v3.ProjectNetworkPolicy{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectnetworkpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectNetworkPolicies that match those selectors. +func (c *projectNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectNetworkPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ProjectNetworkPolicyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectnetworkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectNetworkPolicies. +func (c *projectNetworkPolicies) Watch(ctx context.Context, 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("projectnetworkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectNetworkPolicy and creates it. Returns the server's representation of the projectNetworkPolicy, and an error, if there is any. +func (c *projectNetworkPolicies) Create(ctx context.Context, projectNetworkPolicy *v3.ProjectNetworkPolicy, opts v1.CreateOptions) (result *v3.ProjectNetworkPolicy, err error) { + result = &v3.ProjectNetworkPolicy{} + err = c.client.Post(). + Namespace(c.ns). + Resource("projectnetworkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectNetworkPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectNetworkPolicy and updates it. Returns the server's representation of the projectNetworkPolicy, and an error, if there is any. +func (c *projectNetworkPolicies) Update(ctx context.Context, projectNetworkPolicy *v3.ProjectNetworkPolicy, opts v1.UpdateOptions) (result *v3.ProjectNetworkPolicy, err error) { + result = &v3.ProjectNetworkPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectnetworkpolicies"). + Name(projectNetworkPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectNetworkPolicy). + Do(ctx). + 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 *projectNetworkPolicies) UpdateStatus(ctx context.Context, projectNetworkPolicy *v3.ProjectNetworkPolicy, opts v1.UpdateOptions) (result *v3.ProjectNetworkPolicy, err error) { + result = &v3.ProjectNetworkPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectnetworkpolicies"). + Name(projectNetworkPolicy.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectNetworkPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectNetworkPolicy and deletes it. Returns an error if one occurs. +func (c *projectNetworkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("projectnetworkpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("projectnetworkpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectNetworkPolicy. +func (c *projectNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectNetworkPolicy, err error) { + result = &v3.ProjectNetworkPolicy{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("projectnetworkpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectroletemplatebinding.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectroletemplatebinding.go new file mode 100644 index 00000000..5012bacf --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/projectroletemplatebinding.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// ProjectRoleTemplateBindingsGetter has a method to return a ProjectRoleTemplateBindingInterface. +// A group's client should implement this interface. +type ProjectRoleTemplateBindingsGetter interface { + ProjectRoleTemplateBindings(namespace string) ProjectRoleTemplateBindingInterface +} + +// ProjectRoleTemplateBindingInterface has methods to work with ProjectRoleTemplateBinding resources. +type ProjectRoleTemplateBindingInterface interface { + Create(ctx context.Context, projectRoleTemplateBinding *v3.ProjectRoleTemplateBinding, opts v1.CreateOptions) (*v3.ProjectRoleTemplateBinding, error) + Update(ctx context.Context, projectRoleTemplateBinding *v3.ProjectRoleTemplateBinding, opts v1.UpdateOptions) (*v3.ProjectRoleTemplateBinding, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.ProjectRoleTemplateBinding, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.ProjectRoleTemplateBindingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectRoleTemplateBinding, err error) + ProjectRoleTemplateBindingExpansion +} + +// projectRoleTemplateBindings implements ProjectRoleTemplateBindingInterface +type projectRoleTemplateBindings struct { + client rest.Interface + ns string +} + +// newProjectRoleTemplateBindings returns a ProjectRoleTemplateBindings +func newProjectRoleTemplateBindings(c *ManagementV3Client, namespace string) *projectRoleTemplateBindings { + return &projectRoleTemplateBindings{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the projectRoleTemplateBinding, and returns the corresponding projectRoleTemplateBinding object, and an error if there is any. +func (c *projectRoleTemplateBindings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.ProjectRoleTemplateBinding, err error) { + result = &v3.ProjectRoleTemplateBinding{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectroletemplatebindings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ProjectRoleTemplateBindings that match those selectors. +func (c *projectRoleTemplateBindings) List(ctx context.Context, opts v1.ListOptions) (result *v3.ProjectRoleTemplateBindingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.ProjectRoleTemplateBindingList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("projectroletemplatebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested projectRoleTemplateBindings. +func (c *projectRoleTemplateBindings) Watch(ctx context.Context, 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("projectroletemplatebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a projectRoleTemplateBinding and creates it. Returns the server's representation of the projectRoleTemplateBinding, and an error, if there is any. +func (c *projectRoleTemplateBindings) Create(ctx context.Context, projectRoleTemplateBinding *v3.ProjectRoleTemplateBinding, opts v1.CreateOptions) (result *v3.ProjectRoleTemplateBinding, err error) { + result = &v3.ProjectRoleTemplateBinding{} + err = c.client.Post(). + Namespace(c.ns). + Resource("projectroletemplatebindings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectRoleTemplateBinding). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a projectRoleTemplateBinding and updates it. Returns the server's representation of the projectRoleTemplateBinding, and an error, if there is any. +func (c *projectRoleTemplateBindings) Update(ctx context.Context, projectRoleTemplateBinding *v3.ProjectRoleTemplateBinding, opts v1.UpdateOptions) (result *v3.ProjectRoleTemplateBinding, err error) { + result = &v3.ProjectRoleTemplateBinding{} + err = c.client.Put(). + Namespace(c.ns). + Resource("projectroletemplatebindings"). + Name(projectRoleTemplateBinding.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(projectRoleTemplateBinding). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the projectRoleTemplateBinding and deletes it. Returns an error if one occurs. +func (c *projectRoleTemplateBindings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("projectroletemplatebindings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *projectRoleTemplateBindings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("projectroletemplatebindings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched projectRoleTemplateBinding. +func (c *projectRoleTemplateBindings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.ProjectRoleTemplateBinding, err error) { + result = &v3.ProjectRoleTemplateBinding{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("projectroletemplatebindings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rancherusernotification.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rancherusernotification.go new file mode 100644 index 00000000..c6f250c2 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rancherusernotification.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// RancherUserNotificationsGetter has a method to return a RancherUserNotificationInterface. +// A group's client should implement this interface. +type RancherUserNotificationsGetter interface { + RancherUserNotifications() RancherUserNotificationInterface +} + +// RancherUserNotificationInterface has methods to work with RancherUserNotification resources. +type RancherUserNotificationInterface interface { + Create(ctx context.Context, rancherUserNotification *v3.RancherUserNotification, opts v1.CreateOptions) (*v3.RancherUserNotification, error) + Update(ctx context.Context, rancherUserNotification *v3.RancherUserNotification, opts v1.UpdateOptions) (*v3.RancherUserNotification, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.RancherUserNotification, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.RancherUserNotificationList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RancherUserNotification, err error) + RancherUserNotificationExpansion +} + +// rancherUserNotifications implements RancherUserNotificationInterface +type rancherUserNotifications struct { + client rest.Interface +} + +// newRancherUserNotifications returns a RancherUserNotifications +func newRancherUserNotifications(c *ManagementV3Client) *rancherUserNotifications { + return &rancherUserNotifications{ + client: c.RESTClient(), + } +} + +// Get takes name of the rancherUserNotification, and returns the corresponding rancherUserNotification object, and an error if there is any. +func (c *rancherUserNotifications) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RancherUserNotification, err error) { + result = &v3.RancherUserNotification{} + err = c.client.Get(). + Resource("rancherusernotifications"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RancherUserNotifications that match those selectors. +func (c *rancherUserNotifications) List(ctx context.Context, opts v1.ListOptions) (result *v3.RancherUserNotificationList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.RancherUserNotificationList{} + err = c.client.Get(). + Resource("rancherusernotifications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested rancherUserNotifications. +func (c *rancherUserNotifications) Watch(ctx context.Context, 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(). + Resource("rancherusernotifications"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a rancherUserNotification and creates it. Returns the server's representation of the rancherUserNotification, and an error, if there is any. +func (c *rancherUserNotifications) Create(ctx context.Context, rancherUserNotification *v3.RancherUserNotification, opts v1.CreateOptions) (result *v3.RancherUserNotification, err error) { + result = &v3.RancherUserNotification{} + err = c.client.Post(). + Resource("rancherusernotifications"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rancherUserNotification). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a rancherUserNotification and updates it. Returns the server's representation of the rancherUserNotification, and an error, if there is any. +func (c *rancherUserNotifications) Update(ctx context.Context, rancherUserNotification *v3.RancherUserNotification, opts v1.UpdateOptions) (result *v3.RancherUserNotification, err error) { + result = &v3.RancherUserNotification{} + err = c.client.Put(). + Resource("rancherusernotifications"). + Name(rancherUserNotification.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rancherUserNotification). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the rancherUserNotification and deletes it. Returns an error if one occurs. +func (c *rancherUserNotifications) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("rancherusernotifications"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *rancherUserNotifications) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("rancherusernotifications"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched rancherUserNotification. +func (c *rancherUserNotifications) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RancherUserNotification, err error) { + result = &v3.RancherUserNotification{} + err = c.client.Patch(pt). + Resource("rancherusernotifications"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rkeaddon.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rkeaddon.go new file mode 100644 index 00000000..14ebafde --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rkeaddon.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// RkeAddonsGetter has a method to return a RkeAddonInterface. +// A group's client should implement this interface. +type RkeAddonsGetter interface { + RkeAddons(namespace string) RkeAddonInterface +} + +// RkeAddonInterface has methods to work with RkeAddon resources. +type RkeAddonInterface interface { + Create(ctx context.Context, rkeAddon *v3.RkeAddon, opts v1.CreateOptions) (*v3.RkeAddon, error) + Update(ctx context.Context, rkeAddon *v3.RkeAddon, opts v1.UpdateOptions) (*v3.RkeAddon, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.RkeAddon, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.RkeAddonList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RkeAddon, err error) + RkeAddonExpansion +} + +// rkeAddons implements RkeAddonInterface +type rkeAddons struct { + client rest.Interface + ns string +} + +// newRkeAddons returns a RkeAddons +func newRkeAddons(c *ManagementV3Client, namespace string) *rkeAddons { + return &rkeAddons{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the rkeAddon, and returns the corresponding rkeAddon object, and an error if there is any. +func (c *rkeAddons) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RkeAddon, err error) { + result = &v3.RkeAddon{} + err = c.client.Get(). + Namespace(c.ns). + Resource("rkeaddons"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RkeAddons that match those selectors. +func (c *rkeAddons) List(ctx context.Context, opts v1.ListOptions) (result *v3.RkeAddonList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.RkeAddonList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("rkeaddons"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested rkeAddons. +func (c *rkeAddons) Watch(ctx context.Context, 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("rkeaddons"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a rkeAddon and creates it. Returns the server's representation of the rkeAddon, and an error, if there is any. +func (c *rkeAddons) Create(ctx context.Context, rkeAddon *v3.RkeAddon, opts v1.CreateOptions) (result *v3.RkeAddon, err error) { + result = &v3.RkeAddon{} + err = c.client.Post(). + Namespace(c.ns). + Resource("rkeaddons"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rkeAddon). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a rkeAddon and updates it. Returns the server's representation of the rkeAddon, and an error, if there is any. +func (c *rkeAddons) Update(ctx context.Context, rkeAddon *v3.RkeAddon, opts v1.UpdateOptions) (result *v3.RkeAddon, err error) { + result = &v3.RkeAddon{} + err = c.client.Put(). + Namespace(c.ns). + Resource("rkeaddons"). + Name(rkeAddon.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rkeAddon). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the rkeAddon and deletes it. Returns an error if one occurs. +func (c *rkeAddons) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("rkeaddons"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *rkeAddons) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("rkeaddons"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched rkeAddon. +func (c *rkeAddons) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RkeAddon, err error) { + result = &v3.RkeAddon{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("rkeaddons"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rkek8sserviceoption.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rkek8sserviceoption.go new file mode 100644 index 00000000..3e803814 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rkek8sserviceoption.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// RkeK8sServiceOptionsGetter has a method to return a RkeK8sServiceOptionInterface. +// A group's client should implement this interface. +type RkeK8sServiceOptionsGetter interface { + RkeK8sServiceOptions(namespace string) RkeK8sServiceOptionInterface +} + +// RkeK8sServiceOptionInterface has methods to work with RkeK8sServiceOption resources. +type RkeK8sServiceOptionInterface interface { + Create(ctx context.Context, rkeK8sServiceOption *v3.RkeK8sServiceOption, opts v1.CreateOptions) (*v3.RkeK8sServiceOption, error) + Update(ctx context.Context, rkeK8sServiceOption *v3.RkeK8sServiceOption, opts v1.UpdateOptions) (*v3.RkeK8sServiceOption, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.RkeK8sServiceOption, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.RkeK8sServiceOptionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RkeK8sServiceOption, err error) + RkeK8sServiceOptionExpansion +} + +// rkeK8sServiceOptions implements RkeK8sServiceOptionInterface +type rkeK8sServiceOptions struct { + client rest.Interface + ns string +} + +// newRkeK8sServiceOptions returns a RkeK8sServiceOptions +func newRkeK8sServiceOptions(c *ManagementV3Client, namespace string) *rkeK8sServiceOptions { + return &rkeK8sServiceOptions{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the rkeK8sServiceOption, and returns the corresponding rkeK8sServiceOption object, and an error if there is any. +func (c *rkeK8sServiceOptions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RkeK8sServiceOption, err error) { + result = &v3.RkeK8sServiceOption{} + err = c.client.Get(). + Namespace(c.ns). + Resource("rkek8sserviceoptions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RkeK8sServiceOptions that match those selectors. +func (c *rkeK8sServiceOptions) List(ctx context.Context, opts v1.ListOptions) (result *v3.RkeK8sServiceOptionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.RkeK8sServiceOptionList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("rkek8sserviceoptions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested rkeK8sServiceOptions. +func (c *rkeK8sServiceOptions) Watch(ctx context.Context, 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("rkek8sserviceoptions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a rkeK8sServiceOption and creates it. Returns the server's representation of the rkeK8sServiceOption, and an error, if there is any. +func (c *rkeK8sServiceOptions) Create(ctx context.Context, rkeK8sServiceOption *v3.RkeK8sServiceOption, opts v1.CreateOptions) (result *v3.RkeK8sServiceOption, err error) { + result = &v3.RkeK8sServiceOption{} + err = c.client.Post(). + Namespace(c.ns). + Resource("rkek8sserviceoptions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rkeK8sServiceOption). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a rkeK8sServiceOption and updates it. Returns the server's representation of the rkeK8sServiceOption, and an error, if there is any. +func (c *rkeK8sServiceOptions) Update(ctx context.Context, rkeK8sServiceOption *v3.RkeK8sServiceOption, opts v1.UpdateOptions) (result *v3.RkeK8sServiceOption, err error) { + result = &v3.RkeK8sServiceOption{} + err = c.client.Put(). + Namespace(c.ns). + Resource("rkek8sserviceoptions"). + Name(rkeK8sServiceOption.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rkeK8sServiceOption). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the rkeK8sServiceOption and deletes it. Returns an error if one occurs. +func (c *rkeK8sServiceOptions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("rkek8sserviceoptions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *rkeK8sServiceOptions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("rkek8sserviceoptions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched rkeK8sServiceOption. +func (c *rkeK8sServiceOptions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RkeK8sServiceOption, err error) { + result = &v3.RkeK8sServiceOption{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("rkek8sserviceoptions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rkek8ssystemimage.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rkek8ssystemimage.go new file mode 100644 index 00000000..0dfbc8e7 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/rkek8ssystemimage.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// RkeK8sSystemImagesGetter has a method to return a RkeK8sSystemImageInterface. +// A group's client should implement this interface. +type RkeK8sSystemImagesGetter interface { + RkeK8sSystemImages(namespace string) RkeK8sSystemImageInterface +} + +// RkeK8sSystemImageInterface has methods to work with RkeK8sSystemImage resources. +type RkeK8sSystemImageInterface interface { + Create(ctx context.Context, rkeK8sSystemImage *v3.RkeK8sSystemImage, opts v1.CreateOptions) (*v3.RkeK8sSystemImage, error) + Update(ctx context.Context, rkeK8sSystemImage *v3.RkeK8sSystemImage, opts v1.UpdateOptions) (*v3.RkeK8sSystemImage, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.RkeK8sSystemImage, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.RkeK8sSystemImageList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RkeK8sSystemImage, err error) + RkeK8sSystemImageExpansion +} + +// rkeK8sSystemImages implements RkeK8sSystemImageInterface +type rkeK8sSystemImages struct { + client rest.Interface + ns string +} + +// newRkeK8sSystemImages returns a RkeK8sSystemImages +func newRkeK8sSystemImages(c *ManagementV3Client, namespace string) *rkeK8sSystemImages { + return &rkeK8sSystemImages{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the rkeK8sSystemImage, and returns the corresponding rkeK8sSystemImage object, and an error if there is any. +func (c *rkeK8sSystemImages) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RkeK8sSystemImage, err error) { + result = &v3.RkeK8sSystemImage{} + err = c.client.Get(). + Namespace(c.ns). + Resource("rkek8ssystemimages"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RkeK8sSystemImages that match those selectors. +func (c *rkeK8sSystemImages) List(ctx context.Context, opts v1.ListOptions) (result *v3.RkeK8sSystemImageList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.RkeK8sSystemImageList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("rkek8ssystemimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested rkeK8sSystemImages. +func (c *rkeK8sSystemImages) Watch(ctx context.Context, 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("rkek8ssystemimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a rkeK8sSystemImage and creates it. Returns the server's representation of the rkeK8sSystemImage, and an error, if there is any. +func (c *rkeK8sSystemImages) Create(ctx context.Context, rkeK8sSystemImage *v3.RkeK8sSystemImage, opts v1.CreateOptions) (result *v3.RkeK8sSystemImage, err error) { + result = &v3.RkeK8sSystemImage{} + err = c.client.Post(). + Namespace(c.ns). + Resource("rkek8ssystemimages"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rkeK8sSystemImage). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a rkeK8sSystemImage and updates it. Returns the server's representation of the rkeK8sSystemImage, and an error, if there is any. +func (c *rkeK8sSystemImages) Update(ctx context.Context, rkeK8sSystemImage *v3.RkeK8sSystemImage, opts v1.UpdateOptions) (result *v3.RkeK8sSystemImage, err error) { + result = &v3.RkeK8sSystemImage{} + err = c.client.Put(). + Namespace(c.ns). + Resource("rkek8ssystemimages"). + Name(rkeK8sSystemImage.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(rkeK8sSystemImage). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the rkeK8sSystemImage and deletes it. Returns an error if one occurs. +func (c *rkeK8sSystemImages) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("rkek8ssystemimages"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *rkeK8sSystemImages) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("rkek8ssystemimages"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched rkeK8sSystemImage. +func (c *rkeK8sSystemImages) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RkeK8sSystemImage, err error) { + result = &v3.RkeK8sSystemImage{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("rkek8ssystemimages"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/roletemplate.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/roletemplate.go new file mode 100644 index 00000000..b6839e48 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/roletemplate.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// RoleTemplatesGetter has a method to return a RoleTemplateInterface. +// A group's client should implement this interface. +type RoleTemplatesGetter interface { + RoleTemplates() RoleTemplateInterface +} + +// RoleTemplateInterface has methods to work with RoleTemplate resources. +type RoleTemplateInterface interface { + Create(ctx context.Context, roleTemplate *v3.RoleTemplate, opts v1.CreateOptions) (*v3.RoleTemplate, error) + Update(ctx context.Context, roleTemplate *v3.RoleTemplate, opts v1.UpdateOptions) (*v3.RoleTemplate, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.RoleTemplate, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.RoleTemplateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RoleTemplate, err error) + RoleTemplateExpansion +} + +// roleTemplates implements RoleTemplateInterface +type roleTemplates struct { + client rest.Interface +} + +// newRoleTemplates returns a RoleTemplates +func newRoleTemplates(c *ManagementV3Client) *roleTemplates { + return &roleTemplates{ + client: c.RESTClient(), + } +} + +// Get takes name of the roleTemplate, and returns the corresponding roleTemplate object, and an error if there is any. +func (c *roleTemplates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.RoleTemplate, err error) { + result = &v3.RoleTemplate{} + err = c.client.Get(). + Resource("roletemplates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of RoleTemplates that match those selectors. +func (c *roleTemplates) List(ctx context.Context, opts v1.ListOptions) (result *v3.RoleTemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.RoleTemplateList{} + err = c.client.Get(). + Resource("roletemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested roleTemplates. +func (c *roleTemplates) Watch(ctx context.Context, 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(). + Resource("roletemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a roleTemplate and creates it. Returns the server's representation of the roleTemplate, and an error, if there is any. +func (c *roleTemplates) Create(ctx context.Context, roleTemplate *v3.RoleTemplate, opts v1.CreateOptions) (result *v3.RoleTemplate, err error) { + result = &v3.RoleTemplate{} + err = c.client.Post(). + Resource("roletemplates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(roleTemplate). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a roleTemplate and updates it. Returns the server's representation of the roleTemplate, and an error, if there is any. +func (c *roleTemplates) Update(ctx context.Context, roleTemplate *v3.RoleTemplate, opts v1.UpdateOptions) (result *v3.RoleTemplate, err error) { + result = &v3.RoleTemplate{} + err = c.client.Put(). + Resource("roletemplates"). + Name(roleTemplate.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(roleTemplate). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the roleTemplate and deletes it. Returns an error if one occurs. +func (c *roleTemplates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("roletemplates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *roleTemplates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("roletemplates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched roleTemplate. +func (c *roleTemplates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.RoleTemplate, err error) { + result = &v3.RoleTemplate{} + err = c.client.Patch(pt). + Resource("roletemplates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/samlprovider.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/samlprovider.go new file mode 100644 index 00000000..56c9a282 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/samlprovider.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// SamlProvidersGetter has a method to return a SamlProviderInterface. +// A group's client should implement this interface. +type SamlProvidersGetter interface { + SamlProviders() SamlProviderInterface +} + +// SamlProviderInterface has methods to work with SamlProvider resources. +type SamlProviderInterface interface { + Create(ctx context.Context, samlProvider *v3.SamlProvider, opts v1.CreateOptions) (*v3.SamlProvider, error) + Update(ctx context.Context, samlProvider *v3.SamlProvider, opts v1.UpdateOptions) (*v3.SamlProvider, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.SamlProvider, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.SamlProviderList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.SamlProvider, err error) + SamlProviderExpansion +} + +// samlProviders implements SamlProviderInterface +type samlProviders struct { + client rest.Interface +} + +// newSamlProviders returns a SamlProviders +func newSamlProviders(c *ManagementV3Client) *samlProviders { + return &samlProviders{ + client: c.RESTClient(), + } +} + +// Get takes name of the samlProvider, and returns the corresponding samlProvider object, and an error if there is any. +func (c *samlProviders) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.SamlProvider, err error) { + result = &v3.SamlProvider{} + err = c.client.Get(). + Resource("samlproviders"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SamlProviders that match those selectors. +func (c *samlProviders) List(ctx context.Context, opts v1.ListOptions) (result *v3.SamlProviderList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.SamlProviderList{} + err = c.client.Get(). + Resource("samlproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested samlProviders. +func (c *samlProviders) Watch(ctx context.Context, 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(). + Resource("samlproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a samlProvider and creates it. Returns the server's representation of the samlProvider, and an error, if there is any. +func (c *samlProviders) Create(ctx context.Context, samlProvider *v3.SamlProvider, opts v1.CreateOptions) (result *v3.SamlProvider, err error) { + result = &v3.SamlProvider{} + err = c.client.Post(). + Resource("samlproviders"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(samlProvider). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a samlProvider and updates it. Returns the server's representation of the samlProvider, and an error, if there is any. +func (c *samlProviders) Update(ctx context.Context, samlProvider *v3.SamlProvider, opts v1.UpdateOptions) (result *v3.SamlProvider, err error) { + result = &v3.SamlProvider{} + err = c.client.Put(). + Resource("samlproviders"). + Name(samlProvider.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(samlProvider). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the samlProvider and deletes it. Returns an error if one occurs. +func (c *samlProviders) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("samlproviders"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *samlProviders) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("samlproviders"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched samlProvider. +func (c *samlProviders) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.SamlProvider, err error) { + result = &v3.SamlProvider{} + err = c.client.Patch(pt). + Resource("samlproviders"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/samltoken.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/samltoken.go new file mode 100644 index 00000000..ccc157ec --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/samltoken.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// SamlTokensGetter has a method to return a SamlTokenInterface. +// A group's client should implement this interface. +type SamlTokensGetter interface { + SamlTokens() SamlTokenInterface +} + +// SamlTokenInterface has methods to work with SamlToken resources. +type SamlTokenInterface interface { + Create(ctx context.Context, samlToken *v3.SamlToken, opts v1.CreateOptions) (*v3.SamlToken, error) + Update(ctx context.Context, samlToken *v3.SamlToken, opts v1.UpdateOptions) (*v3.SamlToken, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.SamlToken, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.SamlTokenList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.SamlToken, err error) + SamlTokenExpansion +} + +// samlTokens implements SamlTokenInterface +type samlTokens struct { + client rest.Interface +} + +// newSamlTokens returns a SamlTokens +func newSamlTokens(c *ManagementV3Client) *samlTokens { + return &samlTokens{ + client: c.RESTClient(), + } +} + +// Get takes name of the samlToken, and returns the corresponding samlToken object, and an error if there is any. +func (c *samlTokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.SamlToken, err error) { + result = &v3.SamlToken{} + err = c.client.Get(). + Resource("samltokens"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of SamlTokens that match those selectors. +func (c *samlTokens) List(ctx context.Context, opts v1.ListOptions) (result *v3.SamlTokenList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.SamlTokenList{} + err = c.client.Get(). + Resource("samltokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested samlTokens. +func (c *samlTokens) Watch(ctx context.Context, 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(). + Resource("samltokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a samlToken and creates it. Returns the server's representation of the samlToken, and an error, if there is any. +func (c *samlTokens) Create(ctx context.Context, samlToken *v3.SamlToken, opts v1.CreateOptions) (result *v3.SamlToken, err error) { + result = &v3.SamlToken{} + err = c.client.Post(). + Resource("samltokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(samlToken). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a samlToken and updates it. Returns the server's representation of the samlToken, and an error, if there is any. +func (c *samlTokens) Update(ctx context.Context, samlToken *v3.SamlToken, opts v1.UpdateOptions) (result *v3.SamlToken, err error) { + result = &v3.SamlToken{} + err = c.client.Put(). + Resource("samltokens"). + Name(samlToken.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(samlToken). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the samlToken and deletes it. Returns an error if one occurs. +func (c *samlTokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("samltokens"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *samlTokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("samltokens"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched samlToken. +func (c *samlTokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.SamlToken, err error) { + result = &v3.SamlToken{} + err = c.client.Patch(pt). + Resource("samltokens"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/setting.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/setting.go new file mode 100644 index 00000000..015ea3d9 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/setting.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// SettingsGetter has a method to return a SettingInterface. +// A group's client should implement this interface. +type SettingsGetter interface { + Settings() SettingInterface +} + +// SettingInterface has methods to work with Setting resources. +type SettingInterface interface { + Create(ctx context.Context, setting *v3.Setting, opts v1.CreateOptions) (*v3.Setting, error) + Update(ctx context.Context, setting *v3.Setting, opts v1.UpdateOptions) (*v3.Setting, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Setting, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.SettingList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Setting, err error) + SettingExpansion +} + +// settings implements SettingInterface +type settings struct { + client rest.Interface +} + +// newSettings returns a Settings +func newSettings(c *ManagementV3Client) *settings { + return &settings{ + client: c.RESTClient(), + } +} + +// Get takes name of the setting, and returns the corresponding setting object, and an error if there is any. +func (c *settings) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Setting, err error) { + result = &v3.Setting{} + err = c.client.Get(). + Resource("settings"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Settings that match those selectors. +func (c *settings) List(ctx context.Context, opts v1.ListOptions) (result *v3.SettingList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.SettingList{} + err = c.client.Get(). + Resource("settings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested settings. +func (c *settings) Watch(ctx context.Context, 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(). + Resource("settings"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a setting and creates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *settings) Create(ctx context.Context, setting *v3.Setting, opts v1.CreateOptions) (result *v3.Setting, err error) { + result = &v3.Setting{} + err = c.client.Post(). + Resource("settings"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(setting). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a setting and updates it. Returns the server's representation of the setting, and an error, if there is any. +func (c *settings) Update(ctx context.Context, setting *v3.Setting, opts v1.UpdateOptions) (result *v3.Setting, err error) { + result = &v3.Setting{} + err = c.client.Put(). + Resource("settings"). + Name(setting.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(setting). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the setting and deletes it. Returns an error if one occurs. +func (c *settings) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("settings"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *settings) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("settings"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched setting. +func (c *settings) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Setting, err error) { + result = &v3.Setting{} + err = c.client.Patch(pt). + Resource("settings"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/template.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/template.go new file mode 100644 index 00000000..8e3f55f5 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/template.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// TemplatesGetter has a method to return a TemplateInterface. +// A group's client should implement this interface. +type TemplatesGetter interface { + Templates() TemplateInterface +} + +// TemplateInterface has methods to work with Template resources. +type TemplateInterface interface { + Create(ctx context.Context, template *v3.Template, opts v1.CreateOptions) (*v3.Template, error) + Update(ctx context.Context, template *v3.Template, opts v1.UpdateOptions) (*v3.Template, error) + UpdateStatus(ctx context.Context, template *v3.Template, opts v1.UpdateOptions) (*v3.Template, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Template, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.TemplateList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Template, err error) + TemplateExpansion +} + +// templates implements TemplateInterface +type templates struct { + client rest.Interface +} + +// newTemplates returns a Templates +func newTemplates(c *ManagementV3Client) *templates { + return &templates{ + client: c.RESTClient(), + } +} + +// Get takes name of the template, and returns the corresponding template object, and an error if there is any. +func (c *templates) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Template, err error) { + result = &v3.Template{} + err = c.client.Get(). + Resource("templates"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Templates that match those selectors. +func (c *templates) List(ctx context.Context, opts v1.ListOptions) (result *v3.TemplateList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.TemplateList{} + err = c.client.Get(). + Resource("templates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested templates. +func (c *templates) Watch(ctx context.Context, 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(). + Resource("templates"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a template and creates it. Returns the server's representation of the template, and an error, if there is any. +func (c *templates) Create(ctx context.Context, template *v3.Template, opts v1.CreateOptions) (result *v3.Template, err error) { + result = &v3.Template{} + err = c.client.Post(). + Resource("templates"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(template). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a template and updates it. Returns the server's representation of the template, and an error, if there is any. +func (c *templates) Update(ctx context.Context, template *v3.Template, opts v1.UpdateOptions) (result *v3.Template, err error) { + result = &v3.Template{} + err = c.client.Put(). + Resource("templates"). + Name(template.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(template). + Do(ctx). + 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 *templates) UpdateStatus(ctx context.Context, template *v3.Template, opts v1.UpdateOptions) (result *v3.Template, err error) { + result = &v3.Template{} + err = c.client.Put(). + Resource("templates"). + Name(template.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(template). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the template and deletes it. Returns an error if one occurs. +func (c *templates) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("templates"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *templates) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("templates"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched template. +func (c *templates) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Template, err error) { + result = &v3.Template{} + err = c.client.Patch(pt). + Resource("templates"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/templatecontent.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/templatecontent.go new file mode 100644 index 00000000..8f9ad04b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/templatecontent.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// TemplateContentsGetter has a method to return a TemplateContentInterface. +// A group's client should implement this interface. +type TemplateContentsGetter interface { + TemplateContents() TemplateContentInterface +} + +// TemplateContentInterface has methods to work with TemplateContent resources. +type TemplateContentInterface interface { + Create(ctx context.Context, templateContent *v3.TemplateContent, opts v1.CreateOptions) (*v3.TemplateContent, error) + Update(ctx context.Context, templateContent *v3.TemplateContent, opts v1.UpdateOptions) (*v3.TemplateContent, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.TemplateContent, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.TemplateContentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.TemplateContent, err error) + TemplateContentExpansion +} + +// templateContents implements TemplateContentInterface +type templateContents struct { + client rest.Interface +} + +// newTemplateContents returns a TemplateContents +func newTemplateContents(c *ManagementV3Client) *templateContents { + return &templateContents{ + client: c.RESTClient(), + } +} + +// Get takes name of the templateContent, and returns the corresponding templateContent object, and an error if there is any. +func (c *templateContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.TemplateContent, err error) { + result = &v3.TemplateContent{} + err = c.client.Get(). + Resource("templatecontents"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TemplateContents that match those selectors. +func (c *templateContents) List(ctx context.Context, opts v1.ListOptions) (result *v3.TemplateContentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.TemplateContentList{} + err = c.client.Get(). + Resource("templatecontents"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested templateContents. +func (c *templateContents) Watch(ctx context.Context, 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(). + Resource("templatecontents"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a templateContent and creates it. Returns the server's representation of the templateContent, and an error, if there is any. +func (c *templateContents) Create(ctx context.Context, templateContent *v3.TemplateContent, opts v1.CreateOptions) (result *v3.TemplateContent, err error) { + result = &v3.TemplateContent{} + err = c.client.Post(). + Resource("templatecontents"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(templateContent). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a templateContent and updates it. Returns the server's representation of the templateContent, and an error, if there is any. +func (c *templateContents) Update(ctx context.Context, templateContent *v3.TemplateContent, opts v1.UpdateOptions) (result *v3.TemplateContent, err error) { + result = &v3.TemplateContent{} + err = c.client.Put(). + Resource("templatecontents"). + Name(templateContent.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(templateContent). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the templateContent and deletes it. Returns an error if one occurs. +func (c *templateContents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("templatecontents"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *templateContents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("templatecontents"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched templateContent. +func (c *templateContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.TemplateContent, err error) { + result = &v3.TemplateContent{} + err = c.client.Patch(pt). + Resource("templatecontents"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/templateversion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/templateversion.go new file mode 100644 index 00000000..eec06cfb --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/templateversion.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// TemplateVersionsGetter has a method to return a TemplateVersionInterface. +// A group's client should implement this interface. +type TemplateVersionsGetter interface { + TemplateVersions() TemplateVersionInterface +} + +// TemplateVersionInterface has methods to work with TemplateVersion resources. +type TemplateVersionInterface interface { + Create(ctx context.Context, templateVersion *v3.TemplateVersion, opts v1.CreateOptions) (*v3.TemplateVersion, error) + Update(ctx context.Context, templateVersion *v3.TemplateVersion, opts v1.UpdateOptions) (*v3.TemplateVersion, error) + UpdateStatus(ctx context.Context, templateVersion *v3.TemplateVersion, opts v1.UpdateOptions) (*v3.TemplateVersion, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.TemplateVersion, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.TemplateVersionList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.TemplateVersion, err error) + TemplateVersionExpansion +} + +// templateVersions implements TemplateVersionInterface +type templateVersions struct { + client rest.Interface +} + +// newTemplateVersions returns a TemplateVersions +func newTemplateVersions(c *ManagementV3Client) *templateVersions { + return &templateVersions{ + client: c.RESTClient(), + } +} + +// Get takes name of the templateVersion, and returns the corresponding templateVersion object, and an error if there is any. +func (c *templateVersions) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.TemplateVersion, err error) { + result = &v3.TemplateVersion{} + err = c.client.Get(). + Resource("templateversions"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of TemplateVersions that match those selectors. +func (c *templateVersions) List(ctx context.Context, opts v1.ListOptions) (result *v3.TemplateVersionList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.TemplateVersionList{} + err = c.client.Get(). + Resource("templateversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested templateVersions. +func (c *templateVersions) Watch(ctx context.Context, 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(). + Resource("templateversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a templateVersion and creates it. Returns the server's representation of the templateVersion, and an error, if there is any. +func (c *templateVersions) Create(ctx context.Context, templateVersion *v3.TemplateVersion, opts v1.CreateOptions) (result *v3.TemplateVersion, err error) { + result = &v3.TemplateVersion{} + err = c.client.Post(). + Resource("templateversions"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(templateVersion). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a templateVersion and updates it. Returns the server's representation of the templateVersion, and an error, if there is any. +func (c *templateVersions) Update(ctx context.Context, templateVersion *v3.TemplateVersion, opts v1.UpdateOptions) (result *v3.TemplateVersion, err error) { + result = &v3.TemplateVersion{} + err = c.client.Put(). + Resource("templateversions"). + Name(templateVersion.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(templateVersion). + Do(ctx). + 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 *templateVersions) UpdateStatus(ctx context.Context, templateVersion *v3.TemplateVersion, opts v1.UpdateOptions) (result *v3.TemplateVersion, err error) { + result = &v3.TemplateVersion{} + err = c.client.Put(). + Resource("templateversions"). + Name(templateVersion.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(templateVersion). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the templateVersion and deletes it. Returns an error if one occurs. +func (c *templateVersions) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("templateversions"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *templateVersions) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("templateversions"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched templateVersion. +func (c *templateVersions) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.TemplateVersion, err error) { + result = &v3.TemplateVersion{} + err = c.client.Patch(pt). + Resource("templateversions"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/token.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/token.go new file mode 100644 index 00000000..1768f84c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/token.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// TokensGetter has a method to return a TokenInterface. +// A group's client should implement this interface. +type TokensGetter interface { + Tokens() TokenInterface +} + +// TokenInterface has methods to work with Token resources. +type TokenInterface interface { + Create(ctx context.Context, token *v3.Token, opts v1.CreateOptions) (*v3.Token, error) + Update(ctx context.Context, token *v3.Token, opts v1.UpdateOptions) (*v3.Token, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.Token, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.TokenList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Token, err error) + TokenExpansion +} + +// tokens implements TokenInterface +type tokens struct { + client rest.Interface +} + +// newTokens returns a Tokens +func newTokens(c *ManagementV3Client) *tokens { + return &tokens{ + client: c.RESTClient(), + } +} + +// Get takes name of the token, and returns the corresponding token object, and an error if there is any. +func (c *tokens) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.Token, err error) { + result = &v3.Token{} + err = c.client.Get(). + Resource("tokens"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Tokens that match those selectors. +func (c *tokens) List(ctx context.Context, opts v1.ListOptions) (result *v3.TokenList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.TokenList{} + err = c.client.Get(). + Resource("tokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested tokens. +func (c *tokens) Watch(ctx context.Context, 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(). + Resource("tokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a token and creates it. Returns the server's representation of the token, and an error, if there is any. +func (c *tokens) Create(ctx context.Context, token *v3.Token, opts v1.CreateOptions) (result *v3.Token, err error) { + result = &v3.Token{} + err = c.client.Post(). + Resource("tokens"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(token). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a token and updates it. Returns the server's representation of the token, and an error, if there is any. +func (c *tokens) Update(ctx context.Context, token *v3.Token, opts v1.UpdateOptions) (result *v3.Token, err error) { + result = &v3.Token{} + err = c.client.Put(). + Resource("tokens"). + Name(token.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(token). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the token and deletes it. Returns an error if one occurs. +func (c *tokens) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("tokens"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *tokens) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("tokens"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched token. +func (c *tokens) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.Token, err error) { + result = &v3.Token{} + err = c.client.Patch(pt). + Resource("tokens"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/user.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/user.go new file mode 100644 index 00000000..fb41774b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/user.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// UsersGetter has a method to return a UserInterface. +// A group's client should implement this interface. +type UsersGetter interface { + Users() UserInterface +} + +// UserInterface has methods to work with User resources. +type UserInterface interface { + Create(ctx context.Context, user *v3.User, opts v1.CreateOptions) (*v3.User, error) + Update(ctx context.Context, user *v3.User, opts v1.UpdateOptions) (*v3.User, error) + UpdateStatus(ctx context.Context, user *v3.User, opts v1.UpdateOptions) (*v3.User, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.User, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.UserList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.User, err error) + UserExpansion +} + +// users implements UserInterface +type users struct { + client rest.Interface +} + +// newUsers returns a Users +func newUsers(c *ManagementV3Client) *users { + return &users{ + client: c.RESTClient(), + } +} + +// Get takes name of the user, and returns the corresponding user object, and an error if there is any. +func (c *users) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.User, err error) { + result = &v3.User{} + err = c.client.Get(). + Resource("users"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Users that match those selectors. +func (c *users) List(ctx context.Context, opts v1.ListOptions) (result *v3.UserList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.UserList{} + err = c.client.Get(). + Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested users. +func (c *users) Watch(ctx context.Context, 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(). + Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a user and creates it. Returns the server's representation of the user, and an error, if there is any. +func (c *users) Create(ctx context.Context, user *v3.User, opts v1.CreateOptions) (result *v3.User, err error) { + result = &v3.User{} + err = c.client.Post(). + Resource("users"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(user). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a user and updates it. Returns the server's representation of the user, and an error, if there is any. +func (c *users) Update(ctx context.Context, user *v3.User, opts v1.UpdateOptions) (result *v3.User, err error) { + result = &v3.User{} + err = c.client.Put(). + Resource("users"). + Name(user.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(user). + Do(ctx). + 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 *users) UpdateStatus(ctx context.Context, user *v3.User, opts v1.UpdateOptions) (result *v3.User, err error) { + result = &v3.User{} + err = c.client.Put(). + Resource("users"). + Name(user.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(user). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the user and deletes it. Returns an error if one occurs. +func (c *users) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("users"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *users) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("users"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched user. +func (c *users) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.User, err error) { + result = &v3.User{} + err = c.client.Patch(pt). + Resource("users"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/userattribute.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/userattribute.go new file mode 100644 index 00000000..a02088fd --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3/userattribute.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v3 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + 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" +) + +// UserAttributesGetter has a method to return a UserAttributeInterface. +// A group's client should implement this interface. +type UserAttributesGetter interface { + UserAttributes() UserAttributeInterface +} + +// UserAttributeInterface has methods to work with UserAttribute resources. +type UserAttributeInterface interface { + Create(ctx context.Context, userAttribute *v3.UserAttribute, opts v1.CreateOptions) (*v3.UserAttribute, error) + Update(ctx context.Context, userAttribute *v3.UserAttribute, opts v1.UpdateOptions) (*v3.UserAttribute, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v3.UserAttribute, error) + List(ctx context.Context, opts v1.ListOptions) (*v3.UserAttributeList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.UserAttribute, err error) + UserAttributeExpansion +} + +// userAttributes implements UserAttributeInterface +type userAttributes struct { + client rest.Interface +} + +// newUserAttributes returns a UserAttributes +func newUserAttributes(c *ManagementV3Client) *userAttributes { + return &userAttributes{ + client: c.RESTClient(), + } +} + +// Get takes name of the userAttribute, and returns the corresponding userAttribute object, and an error if there is any. +func (c *userAttributes) Get(ctx context.Context, name string, options v1.GetOptions) (result *v3.UserAttribute, err error) { + result = &v3.UserAttribute{} + err = c.client.Get(). + Resource("userattributes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of UserAttributes that match those selectors. +func (c *userAttributes) List(ctx context.Context, opts v1.ListOptions) (result *v3.UserAttributeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v3.UserAttributeList{} + err = c.client.Get(). + Resource("userattributes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested userAttributes. +func (c *userAttributes) Watch(ctx context.Context, 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(). + Resource("userattributes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a userAttribute and creates it. Returns the server's representation of the userAttribute, and an error, if there is any. +func (c *userAttributes) Create(ctx context.Context, userAttribute *v3.UserAttribute, opts v1.CreateOptions) (result *v3.UserAttribute, err error) { + result = &v3.UserAttribute{} + err = c.client.Post(). + Resource("userattributes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userAttribute). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a userAttribute and updates it. Returns the server's representation of the userAttribute, and an error, if there is any. +func (c *userAttributes) Update(ctx context.Context, userAttribute *v3.UserAttribute, opts v1.UpdateOptions) (result *v3.UserAttribute, err error) { + result = &v3.UserAttribute{} + err = c.client.Put(). + Resource("userattributes"). + Name(userAttribute.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(userAttribute). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the userAttribute and deletes it. Returns an error if one occurs. +func (c *userAttributes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("userattributes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *userAttributes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("userattributes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched userAttribute. +func (c *userAttributes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v3.UserAttribute, err error) { + result = &v3.UserAttribute{} + err = c.client.Patch(pt). + Resource("userattributes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/alertmanager.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/alertmanager.go new file mode 100644 index 00000000..eb2d15ff --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/alertmanager.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + metav1 "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" +) + +// AlertmanagersGetter has a method to return a AlertmanagerInterface. +// A group's client should implement this interface. +type AlertmanagersGetter interface { + Alertmanagers(namespace string) AlertmanagerInterface +} + +// AlertmanagerInterface has methods to work with Alertmanager resources. +type AlertmanagerInterface interface { + Create(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.CreateOptions) (*v1.Alertmanager, error) + Update(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.UpdateOptions) (*v1.Alertmanager, error) + UpdateStatus(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.UpdateOptions) (*v1.Alertmanager, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Alertmanager, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.AlertmanagerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Alertmanager, err error) + AlertmanagerExpansion +} + +// alertmanagers implements AlertmanagerInterface +type alertmanagers struct { + client rest.Interface + ns string +} + +// newAlertmanagers returns a Alertmanagers +func newAlertmanagers(c *MonitoringV1Client, namespace string) *alertmanagers { + return &alertmanagers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the alertmanager, and returns the corresponding alertmanager object, and an error if there is any. +func (c *alertmanagers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Alertmanager, err error) { + result = &v1.Alertmanager{} + err = c.client.Get(). + Namespace(c.ns). + Resource("alertmanagers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Alertmanagers that match those selectors. +func (c *alertmanagers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.AlertmanagerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.AlertmanagerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("alertmanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested alertmanagers. +func (c *alertmanagers) Watch(ctx context.Context, opts metav1.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("alertmanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a alertmanager and creates it. Returns the server's representation of the alertmanager, and an error, if there is any. +func (c *alertmanagers) Create(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.CreateOptions) (result *v1.Alertmanager, err error) { + result = &v1.Alertmanager{} + err = c.client.Post(). + Namespace(c.ns). + Resource("alertmanagers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(alertmanager). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a alertmanager and updates it. Returns the server's representation of the alertmanager, and an error, if there is any. +func (c *alertmanagers) Update(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.UpdateOptions) (result *v1.Alertmanager, err error) { + result = &v1.Alertmanager{} + err = c.client.Put(). + Namespace(c.ns). + Resource("alertmanagers"). + Name(alertmanager.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(alertmanager). + Do(ctx). + 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 *alertmanagers) UpdateStatus(ctx context.Context, alertmanager *v1.Alertmanager, opts metav1.UpdateOptions) (result *v1.Alertmanager, err error) { + result = &v1.Alertmanager{} + err = c.client.Put(). + Namespace(c.ns). + Resource("alertmanagers"). + Name(alertmanager.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(alertmanager). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the alertmanager and deletes it. Returns an error if one occurs. +func (c *alertmanagers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("alertmanagers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *alertmanagers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("alertmanagers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched alertmanager. +func (c *alertmanagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Alertmanager, err error) { + result = &v1.Alertmanager{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("alertmanagers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/doc.go new file mode 100644 index 00000000..5e9c88f0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_alertmanager.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_alertmanager.go new file mode 100644 index 00000000..15f469b0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_alertmanager.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeAlertmanagers implements AlertmanagerInterface +type FakeAlertmanagers struct { + Fake *FakeMonitoringV1 + ns string +} + +var alertmanagersResource = schema.GroupVersionResource{Group: "monitoring.coreos.com", Version: "v1", Resource: "alertmanagers"} + +var alertmanagersKind = schema.GroupVersionKind{Group: "monitoring.coreos.com", Version: "v1", Kind: "Alertmanager"} + +// Get takes name of the alertmanager, and returns the corresponding alertmanager object, and an error if there is any. +func (c *FakeAlertmanagers) Get(ctx context.Context, name string, options v1.GetOptions) (result *monitoringv1.Alertmanager, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(alertmanagersResource, c.ns, name), &monitoringv1.Alertmanager{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Alertmanager), err +} + +// List takes label and field selectors, and returns the list of Alertmanagers that match those selectors. +func (c *FakeAlertmanagers) List(ctx context.Context, opts v1.ListOptions) (result *monitoringv1.AlertmanagerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(alertmanagersResource, alertmanagersKind, c.ns, opts), &monitoringv1.AlertmanagerList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &monitoringv1.AlertmanagerList{ListMeta: obj.(*monitoringv1.AlertmanagerList).ListMeta} + for _, item := range obj.(*monitoringv1.AlertmanagerList).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 alertmanagers. +func (c *FakeAlertmanagers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(alertmanagersResource, c.ns, opts)) + +} + +// Create takes the representation of a alertmanager and creates it. Returns the server's representation of the alertmanager, and an error, if there is any. +func (c *FakeAlertmanagers) Create(ctx context.Context, alertmanager *monitoringv1.Alertmanager, opts v1.CreateOptions) (result *monitoringv1.Alertmanager, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(alertmanagersResource, c.ns, alertmanager), &monitoringv1.Alertmanager{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Alertmanager), err +} + +// Update takes the representation of a alertmanager and updates it. Returns the server's representation of the alertmanager, and an error, if there is any. +func (c *FakeAlertmanagers) Update(ctx context.Context, alertmanager *monitoringv1.Alertmanager, opts v1.UpdateOptions) (result *monitoringv1.Alertmanager, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(alertmanagersResource, c.ns, alertmanager), &monitoringv1.Alertmanager{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Alertmanager), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeAlertmanagers) UpdateStatus(ctx context.Context, alertmanager *monitoringv1.Alertmanager, opts v1.UpdateOptions) (*monitoringv1.Alertmanager, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(alertmanagersResource, "status", c.ns, alertmanager), &monitoringv1.Alertmanager{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Alertmanager), err +} + +// Delete takes name of the alertmanager and deletes it. Returns an error if one occurs. +func (c *FakeAlertmanagers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(alertmanagersResource, c.ns, name, opts), &monitoringv1.Alertmanager{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeAlertmanagers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(alertmanagersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &monitoringv1.AlertmanagerList{}) + return err +} + +// Patch applies the patch and returns the patched alertmanager. +func (c *FakeAlertmanagers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *monitoringv1.Alertmanager, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(alertmanagersResource, c.ns, name, pt, data, subresources...), &monitoringv1.Alertmanager{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Alertmanager), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_monitoring.coreos.com_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_monitoring.coreos.com_client.go new file mode 100644 index 00000000..090fb05b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_monitoring.coreos.com_client.go @@ -0,0 +1,64 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeMonitoringV1 struct { + *testing.Fake +} + +func (c *FakeMonitoringV1) Alertmanagers(namespace string) v1.AlertmanagerInterface { + return &FakeAlertmanagers{c, namespace} +} + +func (c *FakeMonitoringV1) PodMonitors(namespace string) v1.PodMonitorInterface { + return &FakePodMonitors{c, namespace} +} + +func (c *FakeMonitoringV1) Probes(namespace string) v1.ProbeInterface { + return &FakeProbes{c, namespace} +} + +func (c *FakeMonitoringV1) Prometheuses(namespace string) v1.PrometheusInterface { + return &FakePrometheuses{c, namespace} +} + +func (c *FakeMonitoringV1) PrometheusRules(namespace string) v1.PrometheusRuleInterface { + return &FakePrometheusRules{c, namespace} +} + +func (c *FakeMonitoringV1) ServiceMonitors(namespace string) v1.ServiceMonitorInterface { + return &FakeServiceMonitors{c, namespace} +} + +func (c *FakeMonitoringV1) ThanosRulers(namespace string) v1.ThanosRulerInterface { + return &FakeThanosRulers{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeMonitoringV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_podmonitor.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_podmonitor.go new file mode 100644 index 00000000..de8ed4ec --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_podmonitor.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePodMonitors implements PodMonitorInterface +type FakePodMonitors struct { + Fake *FakeMonitoringV1 + ns string +} + +var podmonitorsResource = schema.GroupVersionResource{Group: "monitoring.coreos.com", Version: "v1", Resource: "podmonitors"} + +var podmonitorsKind = schema.GroupVersionKind{Group: "monitoring.coreos.com", Version: "v1", Kind: "PodMonitor"} + +// Get takes name of the podMonitor, and returns the corresponding podMonitor object, and an error if there is any. +func (c *FakePodMonitors) Get(ctx context.Context, name string, options v1.GetOptions) (result *monitoringv1.PodMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(podmonitorsResource, c.ns, name), &monitoringv1.PodMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PodMonitor), err +} + +// List takes label and field selectors, and returns the list of PodMonitors that match those selectors. +func (c *FakePodMonitors) List(ctx context.Context, opts v1.ListOptions) (result *monitoringv1.PodMonitorList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(podmonitorsResource, podmonitorsKind, c.ns, opts), &monitoringv1.PodMonitorList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &monitoringv1.PodMonitorList{ListMeta: obj.(*monitoringv1.PodMonitorList).ListMeta} + for _, item := range obj.(*monitoringv1.PodMonitorList).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 podMonitors. +func (c *FakePodMonitors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(podmonitorsResource, c.ns, opts)) + +} + +// Create takes the representation of a podMonitor and creates it. Returns the server's representation of the podMonitor, and an error, if there is any. +func (c *FakePodMonitors) Create(ctx context.Context, podMonitor *monitoringv1.PodMonitor, opts v1.CreateOptions) (result *monitoringv1.PodMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(podmonitorsResource, c.ns, podMonitor), &monitoringv1.PodMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PodMonitor), err +} + +// Update takes the representation of a podMonitor and updates it. Returns the server's representation of the podMonitor, and an error, if there is any. +func (c *FakePodMonitors) Update(ctx context.Context, podMonitor *monitoringv1.PodMonitor, opts v1.UpdateOptions) (result *monitoringv1.PodMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(podmonitorsResource, c.ns, podMonitor), &monitoringv1.PodMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PodMonitor), err +} + +// Delete takes name of the podMonitor and deletes it. Returns an error if one occurs. +func (c *FakePodMonitors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(podmonitorsResource, c.ns, name, opts), &monitoringv1.PodMonitor{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePodMonitors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(podmonitorsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &monitoringv1.PodMonitorList{}) + return err +} + +// Patch applies the patch and returns the patched podMonitor. +func (c *FakePodMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *monitoringv1.PodMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(podmonitorsResource, c.ns, name, pt, data, subresources...), &monitoringv1.PodMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PodMonitor), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_probe.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_probe.go new file mode 100644 index 00000000..5c87646a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_probe.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeProbes implements ProbeInterface +type FakeProbes struct { + Fake *FakeMonitoringV1 + ns string +} + +var probesResource = schema.GroupVersionResource{Group: "monitoring.coreos.com", Version: "v1", Resource: "probes"} + +var probesKind = schema.GroupVersionKind{Group: "monitoring.coreos.com", Version: "v1", Kind: "Probe"} + +// Get takes name of the probe, and returns the corresponding probe object, and an error if there is any. +func (c *FakeProbes) Get(ctx context.Context, name string, options v1.GetOptions) (result *monitoringv1.Probe, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(probesResource, c.ns, name), &monitoringv1.Probe{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Probe), err +} + +// List takes label and field selectors, and returns the list of Probes that match those selectors. +func (c *FakeProbes) List(ctx context.Context, opts v1.ListOptions) (result *monitoringv1.ProbeList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(probesResource, probesKind, c.ns, opts), &monitoringv1.ProbeList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &monitoringv1.ProbeList{ListMeta: obj.(*monitoringv1.ProbeList).ListMeta} + for _, item := range obj.(*monitoringv1.ProbeList).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 probes. +func (c *FakeProbes) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(probesResource, c.ns, opts)) + +} + +// Create takes the representation of a probe and creates it. Returns the server's representation of the probe, and an error, if there is any. +func (c *FakeProbes) Create(ctx context.Context, probe *monitoringv1.Probe, opts v1.CreateOptions) (result *monitoringv1.Probe, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(probesResource, c.ns, probe), &monitoringv1.Probe{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Probe), err +} + +// Update takes the representation of a probe and updates it. Returns the server's representation of the probe, and an error, if there is any. +func (c *FakeProbes) Update(ctx context.Context, probe *monitoringv1.Probe, opts v1.UpdateOptions) (result *monitoringv1.Probe, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(probesResource, c.ns, probe), &monitoringv1.Probe{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Probe), err +} + +// Delete takes name of the probe and deletes it. Returns an error if one occurs. +func (c *FakeProbes) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(probesResource, c.ns, name, opts), &monitoringv1.Probe{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeProbes) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(probesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &monitoringv1.ProbeList{}) + return err +} + +// Patch applies the patch and returns the patched probe. +func (c *FakeProbes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *monitoringv1.Probe, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(probesResource, c.ns, name, pt, data, subresources...), &monitoringv1.Probe{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Probe), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_prometheus.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_prometheus.go new file mode 100644 index 00000000..e2697b53 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_prometheus.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePrometheuses implements PrometheusInterface +type FakePrometheuses struct { + Fake *FakeMonitoringV1 + ns string +} + +var prometheusesResource = schema.GroupVersionResource{Group: "monitoring.coreos.com", Version: "v1", Resource: "prometheuses"} + +var prometheusesKind = schema.GroupVersionKind{Group: "monitoring.coreos.com", Version: "v1", Kind: "Prometheus"} + +// Get takes name of the prometheus, and returns the corresponding prometheus object, and an error if there is any. +func (c *FakePrometheuses) Get(ctx context.Context, name string, options v1.GetOptions) (result *monitoringv1.Prometheus, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(prometheusesResource, c.ns, name), &monitoringv1.Prometheus{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Prometheus), err +} + +// List takes label and field selectors, and returns the list of Prometheuses that match those selectors. +func (c *FakePrometheuses) List(ctx context.Context, opts v1.ListOptions) (result *monitoringv1.PrometheusList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(prometheusesResource, prometheusesKind, c.ns, opts), &monitoringv1.PrometheusList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &monitoringv1.PrometheusList{ListMeta: obj.(*monitoringv1.PrometheusList).ListMeta} + for _, item := range obj.(*monitoringv1.PrometheusList).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 prometheuses. +func (c *FakePrometheuses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(prometheusesResource, c.ns, opts)) + +} + +// Create takes the representation of a prometheus and creates it. Returns the server's representation of the prometheus, and an error, if there is any. +func (c *FakePrometheuses) Create(ctx context.Context, prometheus *monitoringv1.Prometheus, opts v1.CreateOptions) (result *monitoringv1.Prometheus, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(prometheusesResource, c.ns, prometheus), &monitoringv1.Prometheus{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Prometheus), err +} + +// Update takes the representation of a prometheus and updates it. Returns the server's representation of the prometheus, and an error, if there is any. +func (c *FakePrometheuses) Update(ctx context.Context, prometheus *monitoringv1.Prometheus, opts v1.UpdateOptions) (result *monitoringv1.Prometheus, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(prometheusesResource, c.ns, prometheus), &monitoringv1.Prometheus{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Prometheus), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakePrometheuses) UpdateStatus(ctx context.Context, prometheus *monitoringv1.Prometheus, opts v1.UpdateOptions) (*monitoringv1.Prometheus, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(prometheusesResource, "status", c.ns, prometheus), &monitoringv1.Prometheus{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Prometheus), err +} + +// Delete takes name of the prometheus and deletes it. Returns an error if one occurs. +func (c *FakePrometheuses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(prometheusesResource, c.ns, name, opts), &monitoringv1.Prometheus{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePrometheuses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(prometheusesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &monitoringv1.PrometheusList{}) + return err +} + +// Patch applies the patch and returns the patched prometheus. +func (c *FakePrometheuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *monitoringv1.Prometheus, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(prometheusesResource, c.ns, name, pt, data, subresources...), &monitoringv1.Prometheus{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.Prometheus), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_prometheusrule.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_prometheusrule.go new file mode 100644 index 00000000..db249400 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_prometheusrule.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePrometheusRules implements PrometheusRuleInterface +type FakePrometheusRules struct { + Fake *FakeMonitoringV1 + ns string +} + +var prometheusrulesResource = schema.GroupVersionResource{Group: "monitoring.coreos.com", Version: "v1", Resource: "prometheusrules"} + +var prometheusrulesKind = schema.GroupVersionKind{Group: "monitoring.coreos.com", Version: "v1", Kind: "PrometheusRule"} + +// Get takes name of the prometheusRule, and returns the corresponding prometheusRule object, and an error if there is any. +func (c *FakePrometheusRules) Get(ctx context.Context, name string, options v1.GetOptions) (result *monitoringv1.PrometheusRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(prometheusrulesResource, c.ns, name), &monitoringv1.PrometheusRule{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PrometheusRule), err +} + +// List takes label and field selectors, and returns the list of PrometheusRules that match those selectors. +func (c *FakePrometheusRules) List(ctx context.Context, opts v1.ListOptions) (result *monitoringv1.PrometheusRuleList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(prometheusrulesResource, prometheusrulesKind, c.ns, opts), &monitoringv1.PrometheusRuleList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &monitoringv1.PrometheusRuleList{ListMeta: obj.(*monitoringv1.PrometheusRuleList).ListMeta} + for _, item := range obj.(*monitoringv1.PrometheusRuleList).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 prometheusRules. +func (c *FakePrometheusRules) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(prometheusrulesResource, c.ns, opts)) + +} + +// Create takes the representation of a prometheusRule and creates it. Returns the server's representation of the prometheusRule, and an error, if there is any. +func (c *FakePrometheusRules) Create(ctx context.Context, prometheusRule *monitoringv1.PrometheusRule, opts v1.CreateOptions) (result *monitoringv1.PrometheusRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(prometheusrulesResource, c.ns, prometheusRule), &monitoringv1.PrometheusRule{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PrometheusRule), err +} + +// Update takes the representation of a prometheusRule and updates it. Returns the server's representation of the prometheusRule, and an error, if there is any. +func (c *FakePrometheusRules) Update(ctx context.Context, prometheusRule *monitoringv1.PrometheusRule, opts v1.UpdateOptions) (result *monitoringv1.PrometheusRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(prometheusrulesResource, c.ns, prometheusRule), &monitoringv1.PrometheusRule{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PrometheusRule), err +} + +// Delete takes name of the prometheusRule and deletes it. Returns an error if one occurs. +func (c *FakePrometheusRules) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(prometheusrulesResource, c.ns, name, opts), &monitoringv1.PrometheusRule{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePrometheusRules) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(prometheusrulesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &monitoringv1.PrometheusRuleList{}) + return err +} + +// Patch applies the patch and returns the patched prometheusRule. +func (c *FakePrometheusRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *monitoringv1.PrometheusRule, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(prometheusrulesResource, c.ns, name, pt, data, subresources...), &monitoringv1.PrometheusRule{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.PrometheusRule), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_servicemonitor.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_servicemonitor.go new file mode 100644 index 00000000..e692563b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_servicemonitor.go @@ -0,0 +1,130 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeServiceMonitors implements ServiceMonitorInterface +type FakeServiceMonitors struct { + Fake *FakeMonitoringV1 + ns string +} + +var servicemonitorsResource = schema.GroupVersionResource{Group: "monitoring.coreos.com", Version: "v1", Resource: "servicemonitors"} + +var servicemonitorsKind = schema.GroupVersionKind{Group: "monitoring.coreos.com", Version: "v1", Kind: "ServiceMonitor"} + +// Get takes name of the serviceMonitor, and returns the corresponding serviceMonitor object, and an error if there is any. +func (c *FakeServiceMonitors) Get(ctx context.Context, name string, options v1.GetOptions) (result *monitoringv1.ServiceMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(servicemonitorsResource, c.ns, name), &monitoringv1.ServiceMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ServiceMonitor), err +} + +// List takes label and field selectors, and returns the list of ServiceMonitors that match those selectors. +func (c *FakeServiceMonitors) List(ctx context.Context, opts v1.ListOptions) (result *monitoringv1.ServiceMonitorList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(servicemonitorsResource, servicemonitorsKind, c.ns, opts), &monitoringv1.ServiceMonitorList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &monitoringv1.ServiceMonitorList{ListMeta: obj.(*monitoringv1.ServiceMonitorList).ListMeta} + for _, item := range obj.(*monitoringv1.ServiceMonitorList).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 serviceMonitors. +func (c *FakeServiceMonitors) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(servicemonitorsResource, c.ns, opts)) + +} + +// Create takes the representation of a serviceMonitor and creates it. Returns the server's representation of the serviceMonitor, and an error, if there is any. +func (c *FakeServiceMonitors) Create(ctx context.Context, serviceMonitor *monitoringv1.ServiceMonitor, opts v1.CreateOptions) (result *monitoringv1.ServiceMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(servicemonitorsResource, c.ns, serviceMonitor), &monitoringv1.ServiceMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ServiceMonitor), err +} + +// Update takes the representation of a serviceMonitor and updates it. Returns the server's representation of the serviceMonitor, and an error, if there is any. +func (c *FakeServiceMonitors) Update(ctx context.Context, serviceMonitor *monitoringv1.ServiceMonitor, opts v1.UpdateOptions) (result *monitoringv1.ServiceMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(servicemonitorsResource, c.ns, serviceMonitor), &monitoringv1.ServiceMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ServiceMonitor), err +} + +// Delete takes name of the serviceMonitor and deletes it. Returns an error if one occurs. +func (c *FakeServiceMonitors) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(servicemonitorsResource, c.ns, name, opts), &monitoringv1.ServiceMonitor{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeServiceMonitors) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(servicemonitorsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &monitoringv1.ServiceMonitorList{}) + return err +} + +// Patch applies the patch and returns the patched serviceMonitor. +func (c *FakeServiceMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *monitoringv1.ServiceMonitor, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(servicemonitorsResource, c.ns, name, pt, data, subresources...), &monitoringv1.ServiceMonitor{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ServiceMonitor), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_thanosruler.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_thanosruler.go new file mode 100644 index 00000000..96bbec3d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/fake/fake_thanosruler.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeThanosRulers implements ThanosRulerInterface +type FakeThanosRulers struct { + Fake *FakeMonitoringV1 + ns string +} + +var thanosrulersResource = schema.GroupVersionResource{Group: "monitoring.coreos.com", Version: "v1", Resource: "thanosrulers"} + +var thanosrulersKind = schema.GroupVersionKind{Group: "monitoring.coreos.com", Version: "v1", Kind: "ThanosRuler"} + +// Get takes name of the thanosRuler, and returns the corresponding thanosRuler object, and an error if there is any. +func (c *FakeThanosRulers) Get(ctx context.Context, name string, options v1.GetOptions) (result *monitoringv1.ThanosRuler, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(thanosrulersResource, c.ns, name), &monitoringv1.ThanosRuler{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ThanosRuler), err +} + +// List takes label and field selectors, and returns the list of ThanosRulers that match those selectors. +func (c *FakeThanosRulers) List(ctx context.Context, opts v1.ListOptions) (result *monitoringv1.ThanosRulerList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(thanosrulersResource, thanosrulersKind, c.ns, opts), &monitoringv1.ThanosRulerList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &monitoringv1.ThanosRulerList{ListMeta: obj.(*monitoringv1.ThanosRulerList).ListMeta} + for _, item := range obj.(*monitoringv1.ThanosRulerList).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 thanosRulers. +func (c *FakeThanosRulers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(thanosrulersResource, c.ns, opts)) + +} + +// Create takes the representation of a thanosRuler and creates it. Returns the server's representation of the thanosRuler, and an error, if there is any. +func (c *FakeThanosRulers) Create(ctx context.Context, thanosRuler *monitoringv1.ThanosRuler, opts v1.CreateOptions) (result *monitoringv1.ThanosRuler, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(thanosrulersResource, c.ns, thanosRuler), &monitoringv1.ThanosRuler{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ThanosRuler), err +} + +// Update takes the representation of a thanosRuler and updates it. Returns the server's representation of the thanosRuler, and an error, if there is any. +func (c *FakeThanosRulers) Update(ctx context.Context, thanosRuler *monitoringv1.ThanosRuler, opts v1.UpdateOptions) (result *monitoringv1.ThanosRuler, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(thanosrulersResource, c.ns, thanosRuler), &monitoringv1.ThanosRuler{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ThanosRuler), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeThanosRulers) UpdateStatus(ctx context.Context, thanosRuler *monitoringv1.ThanosRuler, opts v1.UpdateOptions) (*monitoringv1.ThanosRuler, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(thanosrulersResource, "status", c.ns, thanosRuler), &monitoringv1.ThanosRuler{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ThanosRuler), err +} + +// Delete takes name of the thanosRuler and deletes it. Returns an error if one occurs. +func (c *FakeThanosRulers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(thanosrulersResource, c.ns, name, opts), &monitoringv1.ThanosRuler{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeThanosRulers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(thanosrulersResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &monitoringv1.ThanosRulerList{}) + return err +} + +// Patch applies the patch and returns the patched thanosRuler. +func (c *FakeThanosRulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *monitoringv1.ThanosRuler, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(thanosrulersResource, c.ns, name, pt, data, subresources...), &monitoringv1.ThanosRuler{}) + + if obj == nil { + return nil, err + } + return obj.(*monitoringv1.ThanosRuler), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/generated_expansion.go new file mode 100644 index 00000000..0244df37 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/generated_expansion.go @@ -0,0 +1,33 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +type AlertmanagerExpansion interface{} + +type PodMonitorExpansion interface{} + +type ProbeExpansion interface{} + +type PrometheusExpansion interface{} + +type PrometheusRuleExpansion interface{} + +type ServiceMonitorExpansion interface{} + +type ThanosRulerExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/monitoring.coreos.com_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/monitoring.coreos.com_client.go new file mode 100644 index 00000000..b5c8b12c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/monitoring.coreos.com_client.go @@ -0,0 +1,137 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + rest "k8s.io/client-go/rest" +) + +type MonitoringV1Interface interface { + RESTClient() rest.Interface + AlertmanagersGetter + PodMonitorsGetter + ProbesGetter + PrometheusesGetter + PrometheusRulesGetter + ServiceMonitorsGetter + ThanosRulersGetter +} + +// MonitoringV1Client is used to interact with features provided by the monitoring.coreos.com group. +type MonitoringV1Client struct { + restClient rest.Interface +} + +func (c *MonitoringV1Client) Alertmanagers(namespace string) AlertmanagerInterface { + return newAlertmanagers(c, namespace) +} + +func (c *MonitoringV1Client) PodMonitors(namespace string) PodMonitorInterface { + return newPodMonitors(c, namespace) +} + +func (c *MonitoringV1Client) Probes(namespace string) ProbeInterface { + return newProbes(c, namespace) +} + +func (c *MonitoringV1Client) Prometheuses(namespace string) PrometheusInterface { + return newPrometheuses(c, namespace) +} + +func (c *MonitoringV1Client) PrometheusRules(namespace string) PrometheusRuleInterface { + return newPrometheusRules(c, namespace) +} + +func (c *MonitoringV1Client) ServiceMonitors(namespace string) ServiceMonitorInterface { + return newServiceMonitors(c, namespace) +} + +func (c *MonitoringV1Client) ThanosRulers(namespace string) ThanosRulerInterface { + return newThanosRulers(c, namespace) +} + +// NewForConfig creates a new MonitoringV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*MonitoringV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new MonitoringV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*MonitoringV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &MonitoringV1Client{client}, nil +} + +// NewForConfigOrDie creates a new MonitoringV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *MonitoringV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new MonitoringV1Client for the given RESTClient. +func New(c rest.Interface) *MonitoringV1Client { + return &MonitoringV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.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 *MonitoringV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/podmonitor.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/podmonitor.go new file mode 100644 index 00000000..ca8f4fdd --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/podmonitor.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + metav1 "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" +) + +// PodMonitorsGetter has a method to return a PodMonitorInterface. +// A group's client should implement this interface. +type PodMonitorsGetter interface { + PodMonitors(namespace string) PodMonitorInterface +} + +// PodMonitorInterface has methods to work with PodMonitor resources. +type PodMonitorInterface interface { + Create(ctx context.Context, podMonitor *v1.PodMonitor, opts metav1.CreateOptions) (*v1.PodMonitor, error) + Update(ctx context.Context, podMonitor *v1.PodMonitor, opts metav1.UpdateOptions) (*v1.PodMonitor, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PodMonitor, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PodMonitorList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodMonitor, err error) + PodMonitorExpansion +} + +// podMonitors implements PodMonitorInterface +type podMonitors struct { + client rest.Interface + ns string +} + +// newPodMonitors returns a PodMonitors +func newPodMonitors(c *MonitoringV1Client, namespace string) *podMonitors { + return &podMonitors{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the podMonitor, and returns the corresponding podMonitor object, and an error if there is any. +func (c *podMonitors) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PodMonitor, err error) { + result = &v1.PodMonitor{} + err = c.client.Get(). + Namespace(c.ns). + Resource("podmonitors"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PodMonitors that match those selectors. +func (c *podMonitors) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PodMonitorList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PodMonitorList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("podmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested podMonitors. +func (c *podMonitors) Watch(ctx context.Context, opts metav1.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("podmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a podMonitor and creates it. Returns the server's representation of the podMonitor, and an error, if there is any. +func (c *podMonitors) Create(ctx context.Context, podMonitor *v1.PodMonitor, opts metav1.CreateOptions) (result *v1.PodMonitor, err error) { + result = &v1.PodMonitor{} + err = c.client.Post(). + Namespace(c.ns). + Resource("podmonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podMonitor). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a podMonitor and updates it. Returns the server's representation of the podMonitor, and an error, if there is any. +func (c *podMonitors) Update(ctx context.Context, podMonitor *v1.PodMonitor, opts metav1.UpdateOptions) (result *v1.PodMonitor, err error) { + result = &v1.PodMonitor{} + err = c.client.Put(). + Namespace(c.ns). + Resource("podmonitors"). + Name(podMonitor.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(podMonitor). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the podMonitor and deletes it. Returns an error if one occurs. +func (c *podMonitors) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("podmonitors"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *podMonitors) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("podmonitors"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched podMonitor. +func (c *podMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PodMonitor, err error) { + result = &v1.PodMonitor{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("podmonitors"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/probe.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/probe.go new file mode 100644 index 00000000..37ea8d7f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/probe.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + metav1 "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" +) + +// ProbesGetter has a method to return a ProbeInterface. +// A group's client should implement this interface. +type ProbesGetter interface { + Probes(namespace string) ProbeInterface +} + +// ProbeInterface has methods to work with Probe resources. +type ProbeInterface interface { + Create(ctx context.Context, probe *v1.Probe, opts metav1.CreateOptions) (*v1.Probe, error) + Update(ctx context.Context, probe *v1.Probe, opts metav1.UpdateOptions) (*v1.Probe, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Probe, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ProbeList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Probe, err error) + ProbeExpansion +} + +// probes implements ProbeInterface +type probes struct { + client rest.Interface + ns string +} + +// newProbes returns a Probes +func newProbes(c *MonitoringV1Client, namespace string) *probes { + return &probes{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the probe, and returns the corresponding probe object, and an error if there is any. +func (c *probes) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Probe, err error) { + result = &v1.Probe{} + err = c.client.Get(). + Namespace(c.ns). + Resource("probes"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Probes that match those selectors. +func (c *probes) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ProbeList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ProbeList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("probes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested probes. +func (c *probes) Watch(ctx context.Context, opts metav1.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("probes"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a probe and creates it. Returns the server's representation of the probe, and an error, if there is any. +func (c *probes) Create(ctx context.Context, probe *v1.Probe, opts metav1.CreateOptions) (result *v1.Probe, err error) { + result = &v1.Probe{} + err = c.client.Post(). + Namespace(c.ns). + Resource("probes"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(probe). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a probe and updates it. Returns the server's representation of the probe, and an error, if there is any. +func (c *probes) Update(ctx context.Context, probe *v1.Probe, opts metav1.UpdateOptions) (result *v1.Probe, err error) { + result = &v1.Probe{} + err = c.client.Put(). + Namespace(c.ns). + Resource("probes"). + Name(probe.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(probe). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the probe and deletes it. Returns an error if one occurs. +func (c *probes) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("probes"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *probes) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("probes"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched probe. +func (c *probes) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Probe, err error) { + result = &v1.Probe{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("probes"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/prometheus.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/prometheus.go new file mode 100644 index 00000000..c7cf7b25 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/prometheus.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + metav1 "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" +) + +// PrometheusesGetter has a method to return a PrometheusInterface. +// A group's client should implement this interface. +type PrometheusesGetter interface { + Prometheuses(namespace string) PrometheusInterface +} + +// PrometheusInterface has methods to work with Prometheus resources. +type PrometheusInterface interface { + Create(ctx context.Context, prometheus *v1.Prometheus, opts metav1.CreateOptions) (*v1.Prometheus, error) + Update(ctx context.Context, prometheus *v1.Prometheus, opts metav1.UpdateOptions) (*v1.Prometheus, error) + UpdateStatus(ctx context.Context, prometheus *v1.Prometheus, opts metav1.UpdateOptions) (*v1.Prometheus, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Prometheus, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PrometheusList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Prometheus, err error) + PrometheusExpansion +} + +// prometheuses implements PrometheusInterface +type prometheuses struct { + client rest.Interface + ns string +} + +// newPrometheuses returns a Prometheuses +func newPrometheuses(c *MonitoringV1Client, namespace string) *prometheuses { + return &prometheuses{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the prometheus, and returns the corresponding prometheus object, and an error if there is any. +func (c *prometheuses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Prometheus, err error) { + result = &v1.Prometheus{} + err = c.client.Get(). + Namespace(c.ns). + Resource("prometheuses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Prometheuses that match those selectors. +func (c *prometheuses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PrometheusList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PrometheusList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("prometheuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested prometheuses. +func (c *prometheuses) Watch(ctx context.Context, opts metav1.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("prometheuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a prometheus and creates it. Returns the server's representation of the prometheus, and an error, if there is any. +func (c *prometheuses) Create(ctx context.Context, prometheus *v1.Prometheus, opts metav1.CreateOptions) (result *v1.Prometheus, err error) { + result = &v1.Prometheus{} + err = c.client.Post(). + Namespace(c.ns). + Resource("prometheuses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(prometheus). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a prometheus and updates it. Returns the server's representation of the prometheus, and an error, if there is any. +func (c *prometheuses) Update(ctx context.Context, prometheus *v1.Prometheus, opts metav1.UpdateOptions) (result *v1.Prometheus, err error) { + result = &v1.Prometheus{} + err = c.client.Put(). + Namespace(c.ns). + Resource("prometheuses"). + Name(prometheus.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(prometheus). + Do(ctx). + 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 *prometheuses) UpdateStatus(ctx context.Context, prometheus *v1.Prometheus, opts metav1.UpdateOptions) (result *v1.Prometheus, err error) { + result = &v1.Prometheus{} + err = c.client.Put(). + Namespace(c.ns). + Resource("prometheuses"). + Name(prometheus.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(prometheus). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the prometheus and deletes it. Returns an error if one occurs. +func (c *prometheuses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("prometheuses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *prometheuses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("prometheuses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched prometheus. +func (c *prometheuses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Prometheus, err error) { + result = &v1.Prometheus{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("prometheuses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/prometheusrule.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/prometheusrule.go new file mode 100644 index 00000000..0437fe0e --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/prometheusrule.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + metav1 "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" +) + +// PrometheusRulesGetter has a method to return a PrometheusRuleInterface. +// A group's client should implement this interface. +type PrometheusRulesGetter interface { + PrometheusRules(namespace string) PrometheusRuleInterface +} + +// PrometheusRuleInterface has methods to work with PrometheusRule resources. +type PrometheusRuleInterface interface { + Create(ctx context.Context, prometheusRule *v1.PrometheusRule, opts metav1.CreateOptions) (*v1.PrometheusRule, error) + Update(ctx context.Context, prometheusRule *v1.PrometheusRule, opts metav1.UpdateOptions) (*v1.PrometheusRule, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.PrometheusRule, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PrometheusRuleList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PrometheusRule, err error) + PrometheusRuleExpansion +} + +// prometheusRules implements PrometheusRuleInterface +type prometheusRules struct { + client rest.Interface + ns string +} + +// newPrometheusRules returns a PrometheusRules +func newPrometheusRules(c *MonitoringV1Client, namespace string) *prometheusRules { + return &prometheusRules{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the prometheusRule, and returns the corresponding prometheusRule object, and an error if there is any. +func (c *prometheusRules) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.PrometheusRule, err error) { + result = &v1.PrometheusRule{} + err = c.client.Get(). + Namespace(c.ns). + Resource("prometheusrules"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of PrometheusRules that match those selectors. +func (c *prometheusRules) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PrometheusRuleList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PrometheusRuleList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("prometheusrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested prometheusRules. +func (c *prometheusRules) Watch(ctx context.Context, opts metav1.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("prometheusrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a prometheusRule and creates it. Returns the server's representation of the prometheusRule, and an error, if there is any. +func (c *prometheusRules) Create(ctx context.Context, prometheusRule *v1.PrometheusRule, opts metav1.CreateOptions) (result *v1.PrometheusRule, err error) { + result = &v1.PrometheusRule{} + err = c.client.Post(). + Namespace(c.ns). + Resource("prometheusrules"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(prometheusRule). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a prometheusRule and updates it. Returns the server's representation of the prometheusRule, and an error, if there is any. +func (c *prometheusRules) Update(ctx context.Context, prometheusRule *v1.PrometheusRule, opts metav1.UpdateOptions) (result *v1.PrometheusRule, err error) { + result = &v1.PrometheusRule{} + err = c.client.Put(). + Namespace(c.ns). + Resource("prometheusrules"). + Name(prometheusRule.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(prometheusRule). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the prometheusRule and deletes it. Returns an error if one occurs. +func (c *prometheusRules) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("prometheusrules"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *prometheusRules) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("prometheusrules"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched prometheusRule. +func (c *prometheusRules) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.PrometheusRule, err error) { + result = &v1.PrometheusRule{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("prometheusrules"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/servicemonitor.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/servicemonitor.go new file mode 100644 index 00000000..4be8ca73 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/servicemonitor.go @@ -0,0 +1,178 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + metav1 "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" +) + +// ServiceMonitorsGetter has a method to return a ServiceMonitorInterface. +// A group's client should implement this interface. +type ServiceMonitorsGetter interface { + ServiceMonitors(namespace string) ServiceMonitorInterface +} + +// ServiceMonitorInterface has methods to work with ServiceMonitor resources. +type ServiceMonitorInterface interface { + Create(ctx context.Context, serviceMonitor *v1.ServiceMonitor, opts metav1.CreateOptions) (*v1.ServiceMonitor, error) + Update(ctx context.Context, serviceMonitor *v1.ServiceMonitor, opts metav1.UpdateOptions) (*v1.ServiceMonitor, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ServiceMonitor, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ServiceMonitorList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceMonitor, err error) + ServiceMonitorExpansion +} + +// serviceMonitors implements ServiceMonitorInterface +type serviceMonitors struct { + client rest.Interface + ns string +} + +// newServiceMonitors returns a ServiceMonitors +func newServiceMonitors(c *MonitoringV1Client, namespace string) *serviceMonitors { + return &serviceMonitors{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the serviceMonitor, and returns the corresponding serviceMonitor object, and an error if there is any. +func (c *serviceMonitors) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ServiceMonitor, err error) { + result = &v1.ServiceMonitor{} + err = c.client.Get(). + Namespace(c.ns). + Resource("servicemonitors"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ServiceMonitors that match those selectors. +func (c *serviceMonitors) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ServiceMonitorList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ServiceMonitorList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("servicemonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested serviceMonitors. +func (c *serviceMonitors) Watch(ctx context.Context, opts metav1.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("servicemonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a serviceMonitor and creates it. Returns the server's representation of the serviceMonitor, and an error, if there is any. +func (c *serviceMonitors) Create(ctx context.Context, serviceMonitor *v1.ServiceMonitor, opts metav1.CreateOptions) (result *v1.ServiceMonitor, err error) { + result = &v1.ServiceMonitor{} + err = c.client.Post(). + Namespace(c.ns). + Resource("servicemonitors"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceMonitor). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a serviceMonitor and updates it. Returns the server's representation of the serviceMonitor, and an error, if there is any. +func (c *serviceMonitors) Update(ctx context.Context, serviceMonitor *v1.ServiceMonitor, opts metav1.UpdateOptions) (result *v1.ServiceMonitor, err error) { + result = &v1.ServiceMonitor{} + err = c.client.Put(). + Namespace(c.ns). + Resource("servicemonitors"). + Name(serviceMonitor.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(serviceMonitor). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the serviceMonitor and deletes it. Returns an error if one occurs. +func (c *serviceMonitors) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("servicemonitors"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *serviceMonitors) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("servicemonitors"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched serviceMonitor. +func (c *serviceMonitors) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ServiceMonitor, err error) { + result = &v1.ServiceMonitor{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("servicemonitors"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/thanosruler.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/thanosruler.go new file mode 100644 index 00000000..19c85e98 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/monitoring.coreos.com/v1/thanosruler.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1" + metav1 "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" +) + +// ThanosRulersGetter has a method to return a ThanosRulerInterface. +// A group's client should implement this interface. +type ThanosRulersGetter interface { + ThanosRulers(namespace string) ThanosRulerInterface +} + +// ThanosRulerInterface has methods to work with ThanosRuler resources. +type ThanosRulerInterface interface { + Create(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.CreateOptions) (*v1.ThanosRuler, error) + Update(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.UpdateOptions) (*v1.ThanosRuler, error) + UpdateStatus(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.UpdateOptions) (*v1.ThanosRuler, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.ThanosRuler, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.ThanosRulerList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ThanosRuler, err error) + ThanosRulerExpansion +} + +// thanosRulers implements ThanosRulerInterface +type thanosRulers struct { + client rest.Interface + ns string +} + +// newThanosRulers returns a ThanosRulers +func newThanosRulers(c *MonitoringV1Client, namespace string) *thanosRulers { + return &thanosRulers{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the thanosRuler, and returns the corresponding thanosRuler object, and an error if there is any. +func (c *thanosRulers) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.ThanosRuler, err error) { + result = &v1.ThanosRuler{} + err = c.client.Get(). + Namespace(c.ns). + Resource("thanosrulers"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of ThanosRulers that match those selectors. +func (c *thanosRulers) List(ctx context.Context, opts metav1.ListOptions) (result *v1.ThanosRulerList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.ThanosRulerList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("thanosrulers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested thanosRulers. +func (c *thanosRulers) Watch(ctx context.Context, opts metav1.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("thanosrulers"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a thanosRuler and creates it. Returns the server's representation of the thanosRuler, and an error, if there is any. +func (c *thanosRulers) Create(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.CreateOptions) (result *v1.ThanosRuler, err error) { + result = &v1.ThanosRuler{} + err = c.client.Post(). + Namespace(c.ns). + Resource("thanosrulers"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(thanosRuler). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a thanosRuler and updates it. Returns the server's representation of the thanosRuler, and an error, if there is any. +func (c *thanosRulers) Update(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.UpdateOptions) (result *v1.ThanosRuler, err error) { + result = &v1.ThanosRuler{} + err = c.client.Put(). + Namespace(c.ns). + Resource("thanosrulers"). + Name(thanosRuler.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(thanosRuler). + Do(ctx). + 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 *thanosRulers) UpdateStatus(ctx context.Context, thanosRuler *v1.ThanosRuler, opts metav1.UpdateOptions) (result *v1.ThanosRuler, err error) { + result = &v1.ThanosRuler{} + err = c.client.Put(). + Namespace(c.ns). + Resource("thanosrulers"). + Name(thanosRuler.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(thanosRuler). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the thanosRuler and deletes it. Returns an error if one occurs. +func (c *thanosRulers) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("thanosrulers"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *thanosRulers) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("thanosrulers"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched thanosRuler. +func (c *thanosRulers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.ThanosRuler, err error) { + result = &v1.ThanosRuler{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("thanosrulers"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/doc.go new file mode 100644 index 00000000..5e9c88f0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_ingress.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_ingress.go new file mode 100644 index 00000000..f3f2a1b0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_ingress.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + networkingv1 "k8s.io/api/networking/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeIngresses implements IngressInterface +type FakeIngresses struct { + Fake *FakeNetworkingV1 + ns string +} + +var ingressesResource = schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1", Resource: "ingresses"} + +var ingressesKind = schema.GroupVersionKind{Group: "networking.k8s.io", Version: "v1", Kind: "Ingress"} + +// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. +func (c *FakeIngresses) Get(ctx context.Context, name string, options v1.GetOptions) (result *networkingv1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(ingressesResource, c.ns, name), &networkingv1.Ingress{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.Ingress), err +} + +// List takes label and field selectors, and returns the list of Ingresses that match those selectors. +func (c *FakeIngresses) List(ctx context.Context, opts v1.ListOptions) (result *networkingv1.IngressList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(ingressesResource, ingressesKind, c.ns, opts), &networkingv1.IngressList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &networkingv1.IngressList{ListMeta: obj.(*networkingv1.IngressList).ListMeta} + for _, item := range obj.(*networkingv1.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(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(ingressesResource, c.ns, opts)) + +} + +// 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 *FakeIngresses) Create(ctx context.Context, ingress *networkingv1.Ingress, opts v1.CreateOptions) (result *networkingv1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(ingressesResource, c.ns, ingress), &networkingv1.Ingress{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.Ingress), err +} + +// 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 *FakeIngresses) Update(ctx context.Context, ingress *networkingv1.Ingress, opts v1.UpdateOptions) (result *networkingv1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(ingressesResource, c.ns, ingress), &networkingv1.Ingress{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.Ingress), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeIngresses) UpdateStatus(ctx context.Context, ingress *networkingv1.Ingress, opts v1.UpdateOptions) (*networkingv1.Ingress, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(ingressesResource, "status", c.ns, ingress), &networkingv1.Ingress{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.Ingress), err +} + +// Delete takes name of the ingress and deletes it. Returns an error if one occurs. +func (c *FakeIngresses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(ingressesResource, c.ns, name, opts), &networkingv1.Ingress{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIngresses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(ingressesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &networkingv1.IngressList{}) + return err +} + +// Patch applies the patch and returns the patched ingress. +func (c *FakeIngresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *networkingv1.Ingress, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, pt, data, subresources...), &networkingv1.Ingress{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.Ingress), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_ingressclass.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_ingressclass.go new file mode 100644 index 00000000..793224eb --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_ingressclass.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + networkingv1 "k8s.io/api/networking/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeIngressClasses implements IngressClassInterface +type FakeIngressClasses struct { + Fake *FakeNetworkingV1 +} + +var ingressclassesResource = schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1", Resource: "ingressclasses"} + +var ingressclassesKind = schema.GroupVersionKind{Group: "networking.k8s.io", Version: "v1", Kind: "IngressClass"} + +// Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. +func (c *FakeIngressClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *networkingv1.IngressClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(ingressclassesResource, name), &networkingv1.IngressClass{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1.IngressClass), err +} + +// List takes label and field selectors, and returns the list of IngressClasses that match those selectors. +func (c *FakeIngressClasses) List(ctx context.Context, opts v1.ListOptions) (result *networkingv1.IngressClassList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(ingressclassesResource, ingressclassesKind, opts), &networkingv1.IngressClassList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &networkingv1.IngressClassList{ListMeta: obj.(*networkingv1.IngressClassList).ListMeta} + for _, item := range obj.(*networkingv1.IngressClassList).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 ingressClasses. +func (c *FakeIngressClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(ingressclassesResource, opts)) +} + +// Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. +func (c *FakeIngressClasses) Create(ctx context.Context, ingressClass *networkingv1.IngressClass, opts v1.CreateOptions) (result *networkingv1.IngressClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(ingressclassesResource, ingressClass), &networkingv1.IngressClass{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1.IngressClass), err +} + +// Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. +func (c *FakeIngressClasses) Update(ctx context.Context, ingressClass *networkingv1.IngressClass, opts v1.UpdateOptions) (result *networkingv1.IngressClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(ingressclassesResource, ingressClass), &networkingv1.IngressClass{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1.IngressClass), err +} + +// Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. +func (c *FakeIngressClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(ingressclassesResource, name, opts), &networkingv1.IngressClass{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeIngressClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(ingressclassesResource, listOpts) + + _, err := c.Fake.Invokes(action, &networkingv1.IngressClassList{}) + return err +} + +// Patch applies the patch and returns the patched ingressClass. +func (c *FakeIngressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *networkingv1.IngressClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(ingressclassesResource, name, pt, data, subresources...), &networkingv1.IngressClass{}) + if obj == nil { + return nil, err + } + return obj.(*networkingv1.IngressClass), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_networking.k8s.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_networking.k8s.io_client.go new file mode 100644 index 00000000..c915d9ab --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_networking.k8s.io_client.go @@ -0,0 +1,48 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeNetworkingV1 struct { + *testing.Fake +} + +func (c *FakeNetworkingV1) Ingresses(namespace string) v1.IngressInterface { + return &FakeIngresses{c, namespace} +} + +func (c *FakeNetworkingV1) IngressClasses() v1.IngressClassInterface { + return &FakeIngressClasses{c} +} + +func (c *FakeNetworkingV1) NetworkPolicies(namespace string) v1.NetworkPolicyInterface { + return &FakeNetworkPolicies{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeNetworkingV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_networkpolicy.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_networkpolicy.go new file mode 100644 index 00000000..8d296190 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/fake/fake_networkpolicy.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + networkingv1 "k8s.io/api/networking/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeNetworkPolicies implements NetworkPolicyInterface +type FakeNetworkPolicies struct { + Fake *FakeNetworkingV1 + ns string +} + +var networkpoliciesResource = schema.GroupVersionResource{Group: "networking.k8s.io", Version: "v1", Resource: "networkpolicies"} + +var networkpoliciesKind = schema.GroupVersionKind{Group: "networking.k8s.io", Version: "v1", Kind: "NetworkPolicy"} + +// Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. +func (c *FakeNetworkPolicies) Get(ctx context.Context, name string, options v1.GetOptions) (result *networkingv1.NetworkPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(networkpoliciesResource, c.ns, name), &networkingv1.NetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.NetworkPolicy), err +} + +// List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. +func (c *FakeNetworkPolicies) List(ctx context.Context, opts v1.ListOptions) (result *networkingv1.NetworkPolicyList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(networkpoliciesResource, networkpoliciesKind, c.ns, opts), &networkingv1.NetworkPolicyList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &networkingv1.NetworkPolicyList{ListMeta: obj.(*networkingv1.NetworkPolicyList).ListMeta} + for _, item := range obj.(*networkingv1.NetworkPolicyList).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 networkPolicies. +func (c *FakeNetworkPolicies) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(networkpoliciesResource, c.ns, opts)) + +} + +// Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. +func (c *FakeNetworkPolicies) Create(ctx context.Context, networkPolicy *networkingv1.NetworkPolicy, opts v1.CreateOptions) (result *networkingv1.NetworkPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(networkpoliciesResource, c.ns, networkPolicy), &networkingv1.NetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.NetworkPolicy), err +} + +// Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. +func (c *FakeNetworkPolicies) Update(ctx context.Context, networkPolicy *networkingv1.NetworkPolicy, opts v1.UpdateOptions) (result *networkingv1.NetworkPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(networkpoliciesResource, c.ns, networkPolicy), &networkingv1.NetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.NetworkPolicy), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeNetworkPolicies) UpdateStatus(ctx context.Context, networkPolicy *networkingv1.NetworkPolicy, opts v1.UpdateOptions) (*networkingv1.NetworkPolicy, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(networkpoliciesResource, "status", c.ns, networkPolicy), &networkingv1.NetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.NetworkPolicy), err +} + +// Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. +func (c *FakeNetworkPolicies) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(networkpoliciesResource, c.ns, name, opts), &networkingv1.NetworkPolicy{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeNetworkPolicies) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(networkpoliciesResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &networkingv1.NetworkPolicyList{}) + return err +} + +// Patch applies the patch and returns the patched networkPolicy. +func (c *FakeNetworkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *networkingv1.NetworkPolicy, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(networkpoliciesResource, c.ns, name, pt, data, subresources...), &networkingv1.NetworkPolicy{}) + + if obj == nil { + return nil, err + } + return obj.(*networkingv1.NetworkPolicy), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/generated_expansion.go new file mode 100644 index 00000000..247ad8b2 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/generated_expansion.go @@ -0,0 +1,25 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +type IngressExpansion interface{} + +type IngressClassExpansion interface{} + +type NetworkPolicyExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/ingress.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/ingress.go new file mode 100644 index 00000000..81b6a419 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/ingress.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/api/networking/v1" + metav1 "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" +) + +// 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(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (*v1.Ingress, error) + Update(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) + UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (*v1.Ingress, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Ingress, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) + IngressExpansion +} + +// ingresses implements IngressInterface +type ingresses struct { + client rest.Interface + ns string +} + +// newIngresses returns a Ingresses +func newIngresses(c *NetworkingV1Client, namespace string) *ingresses { + return &ingresses{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the ingress, and returns the corresponding ingress object, and an error if there is any. +func (c *ingresses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Get(). + Namespace(c.ns). + Resource("ingresses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Ingresses that match those selectors. +func (c *ingresses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IngressList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested ingresses. +func (c *ingresses) Watch(ctx context.Context, opts metav1.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("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// 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(ctx context.Context, ingress *v1.Ingress, opts metav1.CreateOptions) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Post(). + Namespace(c.ns). + Resource("ingresses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingress). + Do(ctx). + 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(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Put(). + Namespace(c.ns). + Resource("ingresses"). + Name(ingress.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingress). + Do(ctx). + 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 *ingresses) UpdateStatus(ctx context.Context, ingress *v1.Ingress, opts metav1.UpdateOptions) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Put(). + Namespace(c.ns). + Resource("ingresses"). + Name(ingress.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingress). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the ingress and deletes it. Returns an error if one occurs. +func (c *ingresses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("ingresses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *ingresses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("ingresses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched ingress. +func (c *ingresses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Ingress, err error) { + result = &v1.Ingress{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("ingresses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/ingressclass.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/ingressclass.go new file mode 100644 index 00000000..6cc2e545 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/ingressclass.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/api/networking/v1" + metav1 "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" +) + +// IngressClassesGetter has a method to return a IngressClassInterface. +// A group's client should implement this interface. +type IngressClassesGetter interface { + IngressClasses() IngressClassInterface +} + +// IngressClassInterface has methods to work with IngressClass resources. +type IngressClassInterface interface { + Create(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.CreateOptions) (*v1.IngressClass, error) + Update(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.UpdateOptions) (*v1.IngressClass, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.IngressClass, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.IngressClassList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressClass, err error) + IngressClassExpansion +} + +// ingressClasses implements IngressClassInterface +type ingressClasses struct { + client rest.Interface +} + +// newIngressClasses returns a IngressClasses +func newIngressClasses(c *NetworkingV1Client) *ingressClasses { + return &ingressClasses{ + client: c.RESTClient(), + } +} + +// Get takes name of the ingressClass, and returns the corresponding ingressClass object, and an error if there is any. +func (c *ingressClasses) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.IngressClass, err error) { + result = &v1.IngressClass{} + err = c.client.Get(). + Resource("ingressclasses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of IngressClasses that match those selectors. +func (c *ingressClasses) List(ctx context.Context, opts metav1.ListOptions) (result *v1.IngressClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.IngressClassList{} + err = c.client.Get(). + Resource("ingressclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested ingressClasses. +func (c *ingressClasses) Watch(ctx context.Context, opts metav1.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(). + Resource("ingressclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a ingressClass and creates it. Returns the server's representation of the ingressClass, and an error, if there is any. +func (c *ingressClasses) Create(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.CreateOptions) (result *v1.IngressClass, err error) { + result = &v1.IngressClass{} + err = c.client.Post(). + Resource("ingressclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingressClass). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a ingressClass and updates it. Returns the server's representation of the ingressClass, and an error, if there is any. +func (c *ingressClasses) Update(ctx context.Context, ingressClass *v1.IngressClass, opts metav1.UpdateOptions) (result *v1.IngressClass, err error) { + result = &v1.IngressClass{} + err = c.client.Put(). + Resource("ingressclasses"). + Name(ingressClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(ingressClass). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the ingressClass and deletes it. Returns an error if one occurs. +func (c *ingressClasses) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Resource("ingressclasses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *ingressClasses) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("ingressclasses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched ingressClass. +func (c *ingressClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.IngressClass, err error) { + result = &v1.IngressClass{} + err = c.client.Patch(pt). + Resource("ingressclasses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/networking.k8s.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/networking.k8s.io_client.go new file mode 100644 index 00000000..8e729593 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/networking.k8s.io_client.go @@ -0,0 +1,117 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/api/networking/v1" + rest "k8s.io/client-go/rest" +) + +type NetworkingV1Interface interface { + RESTClient() rest.Interface + IngressesGetter + IngressClassesGetter + NetworkPoliciesGetter +} + +// NetworkingV1Client is used to interact with features provided by the networking.k8s.io group. +type NetworkingV1Client struct { + restClient rest.Interface +} + +func (c *NetworkingV1Client) Ingresses(namespace string) IngressInterface { + return newIngresses(c, namespace) +} + +func (c *NetworkingV1Client) IngressClasses() IngressClassInterface { + return newIngressClasses(c) +} + +func (c *NetworkingV1Client) NetworkPolicies(namespace string) NetworkPolicyInterface { + return newNetworkPolicies(c, namespace) +} + +// NewForConfig creates a new NetworkingV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*NetworkingV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new NetworkingV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &NetworkingV1Client{client}, nil +} + +// NewForConfigOrDie creates a new NetworkingV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *NetworkingV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new NetworkingV1Client for the given RESTClient. +func New(c rest.Interface) *NetworkingV1Client { + return &NetworkingV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.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 *NetworkingV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/networkpolicy.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/networkpolicy.go new file mode 100644 index 00000000..03142257 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/networking.k8s.io/v1/networkpolicy.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "k8s.io/api/networking/v1" + metav1 "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" +) + +// NetworkPoliciesGetter has a method to return a NetworkPolicyInterface. +// A group's client should implement this interface. +type NetworkPoliciesGetter interface { + NetworkPolicies(namespace string) NetworkPolicyInterface +} + +// NetworkPolicyInterface has methods to work with NetworkPolicy resources. +type NetworkPolicyInterface interface { + Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (*v1.NetworkPolicy, error) + Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (*v1.NetworkPolicy, error) + UpdateStatus(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (*v1.NetworkPolicy, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.NetworkPolicy, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.NetworkPolicyList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) + NetworkPolicyExpansion +} + +// networkPolicies implements NetworkPolicyInterface +type networkPolicies struct { + client rest.Interface + ns string +} + +// newNetworkPolicies returns a NetworkPolicies +func newNetworkPolicies(c *NetworkingV1Client, namespace string) *networkPolicies { + return &networkPolicies{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the networkPolicy, and returns the corresponding networkPolicy object, and an error if there is any. +func (c *networkPolicies) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.NetworkPolicy, err error) { + result = &v1.NetworkPolicy{} + err = c.client.Get(). + Namespace(c.ns). + Resource("networkpolicies"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. +func (c *networkPolicies) List(ctx context.Context, opts metav1.ListOptions) (result *v1.NetworkPolicyList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.NetworkPolicyList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("networkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested networkPolicies. +func (c *networkPolicies) Watch(ctx context.Context, opts metav1.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("networkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a networkPolicy and creates it. Returns the server's representation of the networkPolicy, and an error, if there is any. +func (c *networkPolicies) Create(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.CreateOptions) (result *v1.NetworkPolicy, err error) { + result = &v1.NetworkPolicy{} + err = c.client.Post(). + Namespace(c.ns). + Resource("networkpolicies"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkPolicy). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a networkPolicy and updates it. Returns the server's representation of the networkPolicy, and an error, if there is any. +func (c *networkPolicies) Update(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (result *v1.NetworkPolicy, err error) { + result = &v1.NetworkPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("networkpolicies"). + Name(networkPolicy.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkPolicy). + Do(ctx). + 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 *networkPolicies) UpdateStatus(ctx context.Context, networkPolicy *v1.NetworkPolicy, opts metav1.UpdateOptions) (result *v1.NetworkPolicy, err error) { + result = &v1.NetworkPolicy{} + err = c.client.Put(). + Namespace(c.ns). + Resource("networkpolicies"). + Name(networkPolicy.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(networkPolicy). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the networkPolicy and deletes it. Returns an error if one occurs. +func (c *networkPolicies) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("networkpolicies"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *networkPolicies) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("networkpolicies"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched networkPolicy. +func (c *networkPolicies) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.NetworkPolicy, err error) { + result = &v1.NetworkPolicy{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("networkpolicies"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/doc.go new file mode 100644 index 00000000..d9184aec --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1beta1 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_snapshot.storage.k8s.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_snapshot.storage.k8s.io_client.go new file mode 100644 index 00000000..00e56e9f --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_snapshot.storage.k8s.io_client.go @@ -0,0 +1,48 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1beta1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeSnapshotV1beta1 struct { + *testing.Fake +} + +func (c *FakeSnapshotV1beta1) VolumeSnapshots(namespace string) v1beta1.VolumeSnapshotInterface { + return &FakeVolumeSnapshots{c, namespace} +} + +func (c *FakeSnapshotV1beta1) VolumeSnapshotClasses() v1beta1.VolumeSnapshotClassInterface { + return &FakeVolumeSnapshotClasses{c} +} + +func (c *FakeSnapshotV1beta1) VolumeSnapshotContents() v1beta1.VolumeSnapshotContentInterface { + return &FakeVolumeSnapshotContents{c} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeSnapshotV1beta1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_volumesnapshot.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_volumesnapshot.go new file mode 100644 index 00000000..ba4e1af3 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_volumesnapshot.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeSnapshots implements VolumeSnapshotInterface +type FakeVolumeSnapshots struct { + Fake *FakeSnapshotV1beta1 + ns string +} + +var volumesnapshotsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1beta1", Resource: "volumesnapshots"} + +var volumesnapshotsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1beta1", Kind: "VolumeSnapshot"} + +// Get takes name of the volumeSnapshot, and returns the corresponding volumeSnapshot object, and an error if there is any. +func (c *FakeVolumeSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(volumesnapshotsResource, c.ns, name), &v1beta1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshot), err +} + +// List takes label and field selectors, and returns the list of VolumeSnapshots that match those selectors. +func (c *FakeVolumeSnapshots) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeSnapshotList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(volumesnapshotsResource, volumesnapshotsKind, c.ns, opts), &v1beta1.VolumeSnapshotList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeSnapshotList{ListMeta: obj.(*v1beta1.VolumeSnapshotList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeSnapshotList).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 volumeSnapshots. +func (c *FakeVolumeSnapshots) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(volumesnapshotsResource, c.ns, opts)) + +} + +// Create takes the representation of a volumeSnapshot and creates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. +func (c *FakeVolumeSnapshots) Create(ctx context.Context, volumeSnapshot *v1beta1.VolumeSnapshot, opts v1.CreateOptions) (result *v1beta1.VolumeSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &v1beta1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshot), err +} + +// Update takes the representation of a volumeSnapshot and updates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. +func (c *FakeVolumeSnapshots) Update(ctx context.Context, volumeSnapshot *v1beta1.VolumeSnapshot, opts v1.UpdateOptions) (result *v1beta1.VolumeSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(volumesnapshotsResource, c.ns, volumeSnapshot), &v1beta1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshot), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVolumeSnapshots) UpdateStatus(ctx context.Context, volumeSnapshot *v1beta1.VolumeSnapshot, opts v1.UpdateOptions) (*v1beta1.VolumeSnapshot, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(volumesnapshotsResource, "status", c.ns, volumeSnapshot), &v1beta1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshot), err +} + +// Delete takes name of the volumeSnapshot and deletes it. Returns an error if one occurs. +func (c *FakeVolumeSnapshots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(volumesnapshotsResource, c.ns, name, opts), &v1beta1.VolumeSnapshot{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeSnapshots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(volumesnapshotsResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeSnapshotList{}) + return err +} + +// Patch applies the patch and returns the patched volumeSnapshot. +func (c *FakeVolumeSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeSnapshot, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(volumesnapshotsResource, c.ns, name, pt, data, subresources...), &v1beta1.VolumeSnapshot{}) + + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshot), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_volumesnapshotclass.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_volumesnapshotclass.go new file mode 100644 index 00000000..68e18a9c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_volumesnapshotclass.go @@ -0,0 +1,122 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeSnapshotClasses implements VolumeSnapshotClassInterface +type FakeVolumeSnapshotClasses struct { + Fake *FakeSnapshotV1beta1 +} + +var volumesnapshotclassesResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1beta1", Resource: "volumesnapshotclasses"} + +var volumesnapshotclassesKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1beta1", Kind: "VolumeSnapshotClass"} + +// Get takes name of the volumeSnapshotClass, and returns the corresponding volumeSnapshotClass object, and an error if there is any. +func (c *FakeVolumeSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(volumesnapshotclassesResource, name), &v1beta1.VolumeSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshotClass), err +} + +// List takes label and field selectors, and returns the list of VolumeSnapshotClasses that match those selectors. +func (c *FakeVolumeSnapshotClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeSnapshotClassList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(volumesnapshotclassesResource, volumesnapshotclassesKind, opts), &v1beta1.VolumeSnapshotClassList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeSnapshotClassList{ListMeta: obj.(*v1beta1.VolumeSnapshotClassList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeSnapshotClassList).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 volumeSnapshotClasses. +func (c *FakeVolumeSnapshotClasses) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(volumesnapshotclassesResource, opts)) +} + +// Create takes the representation of a volumeSnapshotClass and creates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. +func (c *FakeVolumeSnapshotClasses) Create(ctx context.Context, volumeSnapshotClass *v1beta1.VolumeSnapshotClass, opts v1.CreateOptions) (result *v1beta1.VolumeSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(volumesnapshotclassesResource, volumeSnapshotClass), &v1beta1.VolumeSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshotClass), err +} + +// Update takes the representation of a volumeSnapshotClass and updates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. +func (c *FakeVolumeSnapshotClasses) Update(ctx context.Context, volumeSnapshotClass *v1beta1.VolumeSnapshotClass, opts v1.UpdateOptions) (result *v1beta1.VolumeSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(volumesnapshotclassesResource, volumeSnapshotClass), &v1beta1.VolumeSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshotClass), err +} + +// Delete takes name of the volumeSnapshotClass and deletes it. Returns an error if one occurs. +func (c *FakeVolumeSnapshotClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotclassesResource, name, opts), &v1beta1.VolumeSnapshotClass{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeSnapshotClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumesnapshotclassesResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeSnapshotClassList{}) + return err +} + +// Patch applies the patch and returns the patched volumeSnapshotClass. +func (c *FakeVolumeSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeSnapshotClass, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotclassesResource, name, pt, data, subresources...), &v1beta1.VolumeSnapshotClass{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshotClass), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_volumesnapshotcontent.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_volumesnapshotcontent.go new file mode 100644 index 00000000..9d714983 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/fake/fake_volumesnapshotcontent.go @@ -0,0 +1,133 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + v1beta1 "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeVolumeSnapshotContents implements VolumeSnapshotContentInterface +type FakeVolumeSnapshotContents struct { + Fake *FakeSnapshotV1beta1 +} + +var volumesnapshotcontentsResource = schema.GroupVersionResource{Group: "snapshot.storage.k8s.io", Version: "v1beta1", Resource: "volumesnapshotcontents"} + +var volumesnapshotcontentsKind = schema.GroupVersionKind{Group: "snapshot.storage.k8s.io", Version: "v1beta1", Kind: "VolumeSnapshotContent"} + +// Get takes name of the volumeSnapshotContent, and returns the corresponding volumeSnapshotContent object, and an error if there is any. +func (c *FakeVolumeSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootGetAction(volumesnapshotcontentsResource, name), &v1beta1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshotContent), err +} + +// List takes label and field selectors, and returns the list of VolumeSnapshotContents that match those selectors. +func (c *FakeVolumeSnapshotContents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeSnapshotContentList, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootListAction(volumesnapshotcontentsResource, volumesnapshotcontentsKind, opts), &v1beta1.VolumeSnapshotContentList{}) + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1beta1.VolumeSnapshotContentList{ListMeta: obj.(*v1beta1.VolumeSnapshotContentList).ListMeta} + for _, item := range obj.(*v1beta1.VolumeSnapshotContentList).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 volumeSnapshotContents. +func (c *FakeVolumeSnapshotContents) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewRootWatchAction(volumesnapshotcontentsResource, opts)) +} + +// Create takes the representation of a volumeSnapshotContent and creates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. +func (c *FakeVolumeSnapshotContents) Create(ctx context.Context, volumeSnapshotContent *v1beta1.VolumeSnapshotContent, opts v1.CreateOptions) (result *v1beta1.VolumeSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootCreateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &v1beta1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshotContent), err +} + +// Update takes the representation of a volumeSnapshotContent and updates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. +func (c *FakeVolumeSnapshotContents) Update(ctx context.Context, volumeSnapshotContent *v1beta1.VolumeSnapshotContent, opts v1.UpdateOptions) (result *v1beta1.VolumeSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateAction(volumesnapshotcontentsResource, volumeSnapshotContent), &v1beta1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshotContent), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakeVolumeSnapshotContents) UpdateStatus(ctx context.Context, volumeSnapshotContent *v1beta1.VolumeSnapshotContent, opts v1.UpdateOptions) (*v1beta1.VolumeSnapshotContent, error) { + obj, err := c.Fake. + Invokes(testing.NewRootUpdateSubresourceAction(volumesnapshotcontentsResource, "status", volumeSnapshotContent), &v1beta1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshotContent), err +} + +// Delete takes name of the volumeSnapshotContent and deletes it. Returns an error if one occurs. +func (c *FakeVolumeSnapshotContents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewRootDeleteActionWithOptions(volumesnapshotcontentsResource, name, opts), &v1beta1.VolumeSnapshotContent{}) + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeVolumeSnapshotContents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewRootDeleteCollectionAction(volumesnapshotcontentsResource, listOpts) + + _, err := c.Fake.Invokes(action, &v1beta1.VolumeSnapshotContentList{}) + return err +} + +// Patch applies the patch and returns the patched volumeSnapshotContent. +func (c *FakeVolumeSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeSnapshotContent, err error) { + obj, err := c.Fake. + Invokes(testing.NewRootPatchSubresourceAction(volumesnapshotcontentsResource, name, pt, data, subresources...), &v1beta1.VolumeSnapshotContent{}) + if obj == nil { + return nil, err + } + return obj.(*v1beta1.VolumeSnapshotContent), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/generated_expansion.go new file mode 100644 index 00000000..3b7038f6 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/generated_expansion.go @@ -0,0 +1,25 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +type VolumeSnapshotExpansion interface{} + +type VolumeSnapshotClassExpansion interface{} + +type VolumeSnapshotContentExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/snapshot.storage.k8s.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/snapshot.storage.k8s.io_client.go new file mode 100644 index 00000000..c343d543 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/snapshot.storage.k8s.io_client.go @@ -0,0 +1,117 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "net/http" + + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1" + rest "k8s.io/client-go/rest" +) + +type SnapshotV1beta1Interface interface { + RESTClient() rest.Interface + VolumeSnapshotsGetter + VolumeSnapshotClassesGetter + VolumeSnapshotContentsGetter +} + +// SnapshotV1beta1Client is used to interact with features provided by the snapshot.storage.k8s.io group. +type SnapshotV1beta1Client struct { + restClient rest.Interface +} + +func (c *SnapshotV1beta1Client) VolumeSnapshots(namespace string) VolumeSnapshotInterface { + return newVolumeSnapshots(c, namespace) +} + +func (c *SnapshotV1beta1Client) VolumeSnapshotClasses() VolumeSnapshotClassInterface { + return newVolumeSnapshotClasses(c) +} + +func (c *SnapshotV1beta1Client) VolumeSnapshotContents() VolumeSnapshotContentInterface { + return newVolumeSnapshotContents(c) +} + +// NewForConfig creates a new SnapshotV1beta1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*SnapshotV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new SnapshotV1beta1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SnapshotV1beta1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &SnapshotV1beta1Client{client}, nil +} + +// NewForConfigOrDie creates a new SnapshotV1beta1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *SnapshotV1beta1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new SnapshotV1beta1Client for the given RESTClient. +func New(c rest.Interface) *SnapshotV1beta1Client { + return &SnapshotV1beta1Client{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 *SnapshotV1beta1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/volumesnapshot.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/volumesnapshot.go new file mode 100644 index 00000000..9c74a41d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/volumesnapshot.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1" + 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" +) + +// VolumeSnapshotsGetter has a method to return a VolumeSnapshotInterface. +// A group's client should implement this interface. +type VolumeSnapshotsGetter interface { + VolumeSnapshots(namespace string) VolumeSnapshotInterface +} + +// VolumeSnapshotInterface has methods to work with VolumeSnapshot resources. +type VolumeSnapshotInterface interface { + Create(ctx context.Context, volumeSnapshot *v1beta1.VolumeSnapshot, opts v1.CreateOptions) (*v1beta1.VolumeSnapshot, error) + Update(ctx context.Context, volumeSnapshot *v1beta1.VolumeSnapshot, opts v1.UpdateOptions) (*v1beta1.VolumeSnapshot, error) + UpdateStatus(ctx context.Context, volumeSnapshot *v1beta1.VolumeSnapshot, opts v1.UpdateOptions) (*v1beta1.VolumeSnapshot, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeSnapshot, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeSnapshotList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeSnapshot, err error) + VolumeSnapshotExpansion +} + +// volumeSnapshots implements VolumeSnapshotInterface +type volumeSnapshots struct { + client rest.Interface + ns string +} + +// newVolumeSnapshots returns a VolumeSnapshots +func newVolumeSnapshots(c *SnapshotV1beta1Client, namespace string) *volumeSnapshots { + return &volumeSnapshots{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the volumeSnapshot, and returns the corresponding volumeSnapshot object, and an error if there is any. +func (c *volumeSnapshots) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeSnapshot, err error) { + result = &v1beta1.VolumeSnapshot{} + err = c.client.Get(). + Namespace(c.ns). + Resource("volumesnapshots"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VolumeSnapshots that match those selectors. +func (c *volumeSnapshots) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeSnapshotList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VolumeSnapshotList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("volumesnapshots"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested volumeSnapshots. +func (c *volumeSnapshots) Watch(ctx context.Context, 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("volumesnapshots"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a volumeSnapshot and creates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. +func (c *volumeSnapshots) Create(ctx context.Context, volumeSnapshot *v1beta1.VolumeSnapshot, opts v1.CreateOptions) (result *v1beta1.VolumeSnapshot, err error) { + result = &v1beta1.VolumeSnapshot{} + err = c.client.Post(). + Namespace(c.ns). + Resource("volumesnapshots"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volumeSnapshot). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a volumeSnapshot and updates it. Returns the server's representation of the volumeSnapshot, and an error, if there is any. +func (c *volumeSnapshots) Update(ctx context.Context, volumeSnapshot *v1beta1.VolumeSnapshot, opts v1.UpdateOptions) (result *v1beta1.VolumeSnapshot, err error) { + result = &v1beta1.VolumeSnapshot{} + err = c.client.Put(). + Namespace(c.ns). + Resource("volumesnapshots"). + Name(volumeSnapshot.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volumeSnapshot). + Do(ctx). + 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 *volumeSnapshots) UpdateStatus(ctx context.Context, volumeSnapshot *v1beta1.VolumeSnapshot, opts v1.UpdateOptions) (result *v1beta1.VolumeSnapshot, err error) { + result = &v1beta1.VolumeSnapshot{} + err = c.client.Put(). + Namespace(c.ns). + Resource("volumesnapshots"). + Name(volumeSnapshot.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volumeSnapshot). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the volumeSnapshot and deletes it. Returns an error if one occurs. +func (c *volumeSnapshots) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("volumesnapshots"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *volumeSnapshots) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("volumesnapshots"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched volumeSnapshot. +func (c *volumeSnapshots) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeSnapshot, err error) { + result = &v1beta1.VolumeSnapshot{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("volumesnapshots"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/volumesnapshotclass.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/volumesnapshotclass.go new file mode 100644 index 00000000..488bee6b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/volumesnapshotclass.go @@ -0,0 +1,168 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1" + 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" +) + +// VolumeSnapshotClassesGetter has a method to return a VolumeSnapshotClassInterface. +// A group's client should implement this interface. +type VolumeSnapshotClassesGetter interface { + VolumeSnapshotClasses() VolumeSnapshotClassInterface +} + +// VolumeSnapshotClassInterface has methods to work with VolumeSnapshotClass resources. +type VolumeSnapshotClassInterface interface { + Create(ctx context.Context, volumeSnapshotClass *v1beta1.VolumeSnapshotClass, opts v1.CreateOptions) (*v1beta1.VolumeSnapshotClass, error) + Update(ctx context.Context, volumeSnapshotClass *v1beta1.VolumeSnapshotClass, opts v1.UpdateOptions) (*v1beta1.VolumeSnapshotClass, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeSnapshotClass, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeSnapshotClassList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeSnapshotClass, err error) + VolumeSnapshotClassExpansion +} + +// volumeSnapshotClasses implements VolumeSnapshotClassInterface +type volumeSnapshotClasses struct { + client rest.Interface +} + +// newVolumeSnapshotClasses returns a VolumeSnapshotClasses +func newVolumeSnapshotClasses(c *SnapshotV1beta1Client) *volumeSnapshotClasses { + return &volumeSnapshotClasses{ + client: c.RESTClient(), + } +} + +// Get takes name of the volumeSnapshotClass, and returns the corresponding volumeSnapshotClass object, and an error if there is any. +func (c *volumeSnapshotClasses) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeSnapshotClass, err error) { + result = &v1beta1.VolumeSnapshotClass{} + err = c.client.Get(). + Resource("volumesnapshotclasses"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VolumeSnapshotClasses that match those selectors. +func (c *volumeSnapshotClasses) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeSnapshotClassList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VolumeSnapshotClassList{} + err = c.client.Get(). + Resource("volumesnapshotclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested volumeSnapshotClasses. +func (c *volumeSnapshotClasses) Watch(ctx context.Context, 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(). + Resource("volumesnapshotclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a volumeSnapshotClass and creates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. +func (c *volumeSnapshotClasses) Create(ctx context.Context, volumeSnapshotClass *v1beta1.VolumeSnapshotClass, opts v1.CreateOptions) (result *v1beta1.VolumeSnapshotClass, err error) { + result = &v1beta1.VolumeSnapshotClass{} + err = c.client.Post(). + Resource("volumesnapshotclasses"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volumeSnapshotClass). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a volumeSnapshotClass and updates it. Returns the server's representation of the volumeSnapshotClass, and an error, if there is any. +func (c *volumeSnapshotClasses) Update(ctx context.Context, volumeSnapshotClass *v1beta1.VolumeSnapshotClass, opts v1.UpdateOptions) (result *v1beta1.VolumeSnapshotClass, err error) { + result = &v1beta1.VolumeSnapshotClass{} + err = c.client.Put(). + Resource("volumesnapshotclasses"). + Name(volumeSnapshotClass.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volumeSnapshotClass). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the volumeSnapshotClass and deletes it. Returns an error if one occurs. +func (c *volumeSnapshotClasses) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("volumesnapshotclasses"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *volumeSnapshotClasses) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("volumesnapshotclasses"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched volumeSnapshotClass. +func (c *volumeSnapshotClasses) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeSnapshotClass, err error) { + result = &v1beta1.VolumeSnapshotClass{} + err = c.client.Patch(pt). + Resource("volumesnapshotclasses"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/volumesnapshotcontent.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/volumesnapshotcontent.go new file mode 100644 index 00000000..1dddb478 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/snapshot.storage.k8s.io/v1beta1/volumesnapshotcontent.go @@ -0,0 +1,184 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1beta1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1beta1 "github.com/kubernetes-csi/external-snapshotter/v2/pkg/apis/volumesnapshot/v1beta1" + 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" +) + +// VolumeSnapshotContentsGetter has a method to return a VolumeSnapshotContentInterface. +// A group's client should implement this interface. +type VolumeSnapshotContentsGetter interface { + VolumeSnapshotContents() VolumeSnapshotContentInterface +} + +// VolumeSnapshotContentInterface has methods to work with VolumeSnapshotContent resources. +type VolumeSnapshotContentInterface interface { + Create(ctx context.Context, volumeSnapshotContent *v1beta1.VolumeSnapshotContent, opts v1.CreateOptions) (*v1beta1.VolumeSnapshotContent, error) + Update(ctx context.Context, volumeSnapshotContent *v1beta1.VolumeSnapshotContent, opts v1.UpdateOptions) (*v1beta1.VolumeSnapshotContent, error) + UpdateStatus(ctx context.Context, volumeSnapshotContent *v1beta1.VolumeSnapshotContent, opts v1.UpdateOptions) (*v1beta1.VolumeSnapshotContent, error) + Delete(ctx context.Context, name string, opts v1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error + Get(ctx context.Context, name string, opts v1.GetOptions) (*v1beta1.VolumeSnapshotContent, error) + List(ctx context.Context, opts v1.ListOptions) (*v1beta1.VolumeSnapshotContentList, error) + Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeSnapshotContent, err error) + VolumeSnapshotContentExpansion +} + +// volumeSnapshotContents implements VolumeSnapshotContentInterface +type volumeSnapshotContents struct { + client rest.Interface +} + +// newVolumeSnapshotContents returns a VolumeSnapshotContents +func newVolumeSnapshotContents(c *SnapshotV1beta1Client) *volumeSnapshotContents { + return &volumeSnapshotContents{ + client: c.RESTClient(), + } +} + +// Get takes name of the volumeSnapshotContent, and returns the corresponding volumeSnapshotContent object, and an error if there is any. +func (c *volumeSnapshotContents) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1beta1.VolumeSnapshotContent, err error) { + result = &v1beta1.VolumeSnapshotContent{} + err = c.client.Get(). + Resource("volumesnapshotcontents"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of VolumeSnapshotContents that match those selectors. +func (c *volumeSnapshotContents) List(ctx context.Context, opts v1.ListOptions) (result *v1beta1.VolumeSnapshotContentList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1beta1.VolumeSnapshotContentList{} + err = c.client.Get(). + Resource("volumesnapshotcontents"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested volumeSnapshotContents. +func (c *volumeSnapshotContents) Watch(ctx context.Context, 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(). + Resource("volumesnapshotcontents"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a volumeSnapshotContent and creates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. +func (c *volumeSnapshotContents) Create(ctx context.Context, volumeSnapshotContent *v1beta1.VolumeSnapshotContent, opts v1.CreateOptions) (result *v1beta1.VolumeSnapshotContent, err error) { + result = &v1beta1.VolumeSnapshotContent{} + err = c.client.Post(). + Resource("volumesnapshotcontents"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volumeSnapshotContent). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a volumeSnapshotContent and updates it. Returns the server's representation of the volumeSnapshotContent, and an error, if there is any. +func (c *volumeSnapshotContents) Update(ctx context.Context, volumeSnapshotContent *v1beta1.VolumeSnapshotContent, opts v1.UpdateOptions) (result *v1beta1.VolumeSnapshotContent, err error) { + result = &v1beta1.VolumeSnapshotContent{} + err = c.client.Put(). + Resource("volumesnapshotcontents"). + Name(volumeSnapshotContent.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volumeSnapshotContent). + Do(ctx). + 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 *volumeSnapshotContents) UpdateStatus(ctx context.Context, volumeSnapshotContent *v1beta1.VolumeSnapshotContent, opts v1.UpdateOptions) (result *v1beta1.VolumeSnapshotContent, err error) { + result = &v1beta1.VolumeSnapshotContent{} + err = c.client.Put(). + Resource("volumesnapshotcontents"). + Name(volumeSnapshotContent.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(volumeSnapshotContent). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the volumeSnapshotContent and deletes it. Returns an error if one occurs. +func (c *volumeSnapshotContents) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + return c.client.Delete(). + Resource("volumesnapshotcontents"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *volumeSnapshotContents) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Resource("volumesnapshotcontents"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched volumeSnapshotContent. +func (c *volumeSnapshotContents) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1beta1.VolumeSnapshotContent, err error) { + result = &v1beta1.VolumeSnapshotContent{} + err = c.client.Patch(pt). + Resource("volumesnapshotcontents"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/doc.go new file mode 100644 index 00000000..5e9c88f0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// This package has the automatically generated typed clients. +package v1 diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake/doc.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake/doc.go new file mode 100644 index 00000000..85a29879 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake/doc.go @@ -0,0 +1,20 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +// Package fake has the automatically generated clients. +package fake diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake/fake_plan.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake/fake_plan.go new file mode 100644 index 00000000..2dc7b798 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake/fake_plan.go @@ -0,0 +1,142 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + "context" + + upgradecattleiov1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakePlans implements PlanInterface +type FakePlans struct { + Fake *FakeUpgradeV1 + ns string +} + +var plansResource = schema.GroupVersionResource{Group: "upgrade.cattle.io", Version: "v1", Resource: "plans"} + +var plansKind = schema.GroupVersionKind{Group: "upgrade.cattle.io", Version: "v1", Kind: "Plan"} + +// Get takes name of the plan, and returns the corresponding plan object, and an error if there is any. +func (c *FakePlans) Get(ctx context.Context, name string, options v1.GetOptions) (result *upgradecattleiov1.Plan, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(plansResource, c.ns, name), &upgradecattleiov1.Plan{}) + + if obj == nil { + return nil, err + } + return obj.(*upgradecattleiov1.Plan), err +} + +// List takes label and field selectors, and returns the list of Plans that match those selectors. +func (c *FakePlans) List(ctx context.Context, opts v1.ListOptions) (result *upgradecattleiov1.PlanList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(plansResource, plansKind, c.ns, opts), &upgradecattleiov1.PlanList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &upgradecattleiov1.PlanList{ListMeta: obj.(*upgradecattleiov1.PlanList).ListMeta} + for _, item := range obj.(*upgradecattleiov1.PlanList).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 plans. +func (c *FakePlans) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(plansResource, c.ns, opts)) + +} + +// Create takes the representation of a plan and creates it. Returns the server's representation of the plan, and an error, if there is any. +func (c *FakePlans) Create(ctx context.Context, plan *upgradecattleiov1.Plan, opts v1.CreateOptions) (result *upgradecattleiov1.Plan, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(plansResource, c.ns, plan), &upgradecattleiov1.Plan{}) + + if obj == nil { + return nil, err + } + return obj.(*upgradecattleiov1.Plan), err +} + +// Update takes the representation of a plan and updates it. Returns the server's representation of the plan, and an error, if there is any. +func (c *FakePlans) Update(ctx context.Context, plan *upgradecattleiov1.Plan, opts v1.UpdateOptions) (result *upgradecattleiov1.Plan, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(plansResource, c.ns, plan), &upgradecattleiov1.Plan{}) + + if obj == nil { + return nil, err + } + return obj.(*upgradecattleiov1.Plan), err +} + +// UpdateStatus was generated because the type contains a Status member. +// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus(). +func (c *FakePlans) UpdateStatus(ctx context.Context, plan *upgradecattleiov1.Plan, opts v1.UpdateOptions) (*upgradecattleiov1.Plan, error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateSubresourceAction(plansResource, "status", c.ns, plan), &upgradecattleiov1.Plan{}) + + if obj == nil { + return nil, err + } + return obj.(*upgradecattleiov1.Plan), err +} + +// Delete takes name of the plan and deletes it. Returns an error if one occurs. +func (c *FakePlans) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteActionWithOptions(plansResource, c.ns, name, opts), &upgradecattleiov1.Plan{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakePlans) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(plansResource, c.ns, listOpts) + + _, err := c.Fake.Invokes(action, &upgradecattleiov1.PlanList{}) + return err +} + +// Patch applies the patch and returns the patched plan. +func (c *FakePlans) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *upgradecattleiov1.Plan, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(plansResource, c.ns, name, pt, data, subresources...), &upgradecattleiov1.Plan{}) + + if obj == nil { + return nil, err + } + return obj.(*upgradecattleiov1.Plan), err +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake/fake_upgrade.cattle.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake/fake_upgrade.cattle.io_client.go new file mode 100644 index 00000000..86759a27 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/fake/fake_upgrade.cattle.io_client.go @@ -0,0 +1,40 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package fake + +import ( + v1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1" + rest "k8s.io/client-go/rest" + testing "k8s.io/client-go/testing" +) + +type FakeUpgradeV1 struct { + *testing.Fake +} + +func (c *FakeUpgradeV1) Plans(namespace string) v1.PlanInterface { + return &FakePlans{c, namespace} +} + +// RESTClient returns a RESTClient that is used to communicate +// with API server by this client implementation. +func (c *FakeUpgradeV1) RESTClient() rest.Interface { + var ret *rest.RESTClient + return ret +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/generated_expansion.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/generated_expansion.go new file mode 100644 index 00000000..ae48534e --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/generated_expansion.go @@ -0,0 +1,21 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +type PlanExpansion interface{} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/plan.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/plan.go new file mode 100644 index 00000000..16b9ba21 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/plan.go @@ -0,0 +1,195 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "context" + "time" + + scheme "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1" + metav1 "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" +) + +// PlansGetter has a method to return a PlanInterface. +// A group's client should implement this interface. +type PlansGetter interface { + Plans(namespace string) PlanInterface +} + +// PlanInterface has methods to work with Plan resources. +type PlanInterface interface { + Create(ctx context.Context, plan *v1.Plan, opts metav1.CreateOptions) (*v1.Plan, error) + Update(ctx context.Context, plan *v1.Plan, opts metav1.UpdateOptions) (*v1.Plan, error) + UpdateStatus(ctx context.Context, plan *v1.Plan, opts metav1.UpdateOptions) (*v1.Plan, error) + Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error + DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error + Get(ctx context.Context, name string, opts metav1.GetOptions) (*v1.Plan, error) + List(ctx context.Context, opts metav1.ListOptions) (*v1.PlanList, error) + Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) + Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Plan, err error) + PlanExpansion +} + +// plans implements PlanInterface +type plans struct { + client rest.Interface + ns string +} + +// newPlans returns a Plans +func newPlans(c *UpgradeV1Client, namespace string) *plans { + return &plans{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the plan, and returns the corresponding plan object, and an error if there is any. +func (c *plans) Get(ctx context.Context, name string, options metav1.GetOptions) (result *v1.Plan, err error) { + result = &v1.Plan{} + err = c.client.Get(). + Namespace(c.ns). + Resource("plans"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(ctx). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of Plans that match those selectors. +func (c *plans) List(ctx context.Context, opts metav1.ListOptions) (result *v1.PlanList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1.PlanList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("plans"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(ctx). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested plans. +func (c *plans) Watch(ctx context.Context, opts metav1.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("plans"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch(ctx) +} + +// Create takes the representation of a plan and creates it. Returns the server's representation of the plan, and an error, if there is any. +func (c *plans) Create(ctx context.Context, plan *v1.Plan, opts metav1.CreateOptions) (result *v1.Plan, err error) { + result = &v1.Plan{} + err = c.client.Post(). + Namespace(c.ns). + Resource("plans"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(plan). + Do(ctx). + Into(result) + return +} + +// Update takes the representation of a plan and updates it. Returns the server's representation of the plan, and an error, if there is any. +func (c *plans) Update(ctx context.Context, plan *v1.Plan, opts metav1.UpdateOptions) (result *v1.Plan, err error) { + result = &v1.Plan{} + err = c.client.Put(). + Namespace(c.ns). + Resource("plans"). + Name(plan.Name). + VersionedParams(&opts, scheme.ParameterCodec). + Body(plan). + Do(ctx). + 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 *plans) UpdateStatus(ctx context.Context, plan *v1.Plan, opts metav1.UpdateOptions) (result *v1.Plan, err error) { + result = &v1.Plan{} + err = c.client.Put(). + Namespace(c.ns). + Resource("plans"). + Name(plan.Name). + SubResource("status"). + VersionedParams(&opts, scheme.ParameterCodec). + Body(plan). + Do(ctx). + Into(result) + return +} + +// Delete takes name of the plan and deletes it. Returns an error if one occurs. +func (c *plans) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("plans"). + Name(name). + Body(&opts). + Do(ctx). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *plans) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { + var timeout time.Duration + if listOpts.TimeoutSeconds != nil { + timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("plans"). + VersionedParams(&listOpts, scheme.ParameterCodec). + Timeout(timeout). + Body(&opts). + Do(ctx). + Error() +} + +// Patch applies the patch and returns the patched plan. +func (c *plans) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *v1.Plan, err error) { + result = &v1.Plan{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("plans"). + Name(name). + SubResource(subresources...). + VersionedParams(&opts, scheme.ParameterCodec). + Body(data). + Do(ctx). + Into(result) + return +} diff --git a/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/upgrade.cattle.io_client.go b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/upgrade.cattle.io_client.go new file mode 100644 index 00000000..5f8b7aea --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1/upgrade.cattle.io_client.go @@ -0,0 +1,107 @@ +/* +Copyright 2023 Rancher Labs, Inc. + +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. +*/ + +// Code generated by main. DO NOT EDIT. + +package v1 + +import ( + "net/http" + + "github.com/harvester/harvester/pkg/generated/clientset/versioned/scheme" + v1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1" + rest "k8s.io/client-go/rest" +) + +type UpgradeV1Interface interface { + RESTClient() rest.Interface + PlansGetter +} + +// UpgradeV1Client is used to interact with features provided by the upgrade.cattle.io group. +type UpgradeV1Client struct { + restClient rest.Interface +} + +func (c *UpgradeV1Client) Plans(namespace string) PlanInterface { + return newPlans(c, namespace) +} + +// NewForConfig creates a new UpgradeV1Client for the given config. +// NewForConfig is equivalent to NewForConfigAndClient(c, httpClient), +// where httpClient was generated with rest.HTTPClientFor(c). +func NewForConfig(c *rest.Config) (*UpgradeV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + httpClient, err := rest.HTTPClientFor(&config) + if err != nil { + return nil, err + } + return NewForConfigAndClient(&config, httpClient) +} + +// NewForConfigAndClient creates a new UpgradeV1Client for the given config and http client. +// Note the http client provided takes precedence over the configured transport values. +func NewForConfigAndClient(c *rest.Config, h *http.Client) (*UpgradeV1Client, error) { + config := *c + if err := setConfigDefaults(&config); err != nil { + return nil, err + } + client, err := rest.RESTClientForConfigAndClient(&config, h) + if err != nil { + return nil, err + } + return &UpgradeV1Client{client}, nil +} + +// NewForConfigOrDie creates a new UpgradeV1Client for the given config and +// panics if there is an error in the config. +func NewForConfigOrDie(c *rest.Config) *UpgradeV1Client { + client, err := NewForConfig(c) + if err != nil { + panic(err) + } + return client +} + +// New creates a new UpgradeV1Client for the given RESTClient. +func New(c rest.Interface) *UpgradeV1Client { + return &UpgradeV1Client{c} +} + +func setConfigDefaults(config *rest.Config) error { + gv := v1.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 *UpgradeV1Client) RESTClient() rest.Interface { + if c == nil { + return nil + } + return c.restClient +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/addon.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/addon.go new file mode 100644 index 00000000..c6d12669 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/addon.go @@ -0,0 +1,35 @@ +package fakeclients + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + + harvesterv1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + harv1type "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + ctlharvesterv1 "github.com/harvester/harvester/pkg/generated/controllers/harvesterhci.io/v1beta1" +) + +type AddonCache func(string) harv1type.AddonInterface + +func (c AddonCache) Get(namespace, name string) (*harvesterv1.Addon, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c AddonCache) List(namespace string, selector labels.Selector) ([]*harvesterv1.Addon, error) { + list, err := c(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: selector.String()}) + if err != nil { + return nil, err + } + result := make([]*harvesterv1.Addon, 0, len(list.Items)) + for i := range list.Items { + result = append(result, &list.Items[i]) + } + return result, err +} +func (c AddonCache) AddIndexer(indexName string, indexer ctlharvesterv1.AddonIndexer) { + panic("implement me") +} +func (c AddonCache) GetByIndex(indexName, key string) ([]*harvesterv1.Addon, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/clusterflow.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/clusterflow.go new file mode 100644 index 00000000..371f7c89 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/clusterflow.go @@ -0,0 +1,57 @@ +package fakeclients + +import ( + "context" + + loggingv1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + loggingv1type "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1" + ctlloggingv1 "github.com/harvester/harvester/pkg/generated/controllers/logging.banzaicloud.io/v1beta1" +) + +type ClusterFlowClient func() loggingv1type.ClusterFlowInterface + +func (c ClusterFlowClient) Create(clusterFlow *loggingv1.ClusterFlow) (*loggingv1.ClusterFlow, error) { + clusterFlow.Namespace = "" + return c().Create(context.TODO(), clusterFlow, metav1.CreateOptions{}) +} +func (c ClusterFlowClient) Update(clusterFlow *loggingv1.ClusterFlow) (*loggingv1.ClusterFlow, error) { + panic("implement me") +} +func (c ClusterFlowClient) UpdateStatus(clusterFlow *loggingv1.ClusterFlow) (*loggingv1.ClusterFlow, error) { + panic("implement me") +} +func (c ClusterFlowClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c().Delete(context.TODO(), name, metav1.DeleteOptions{}) +} +func (c ClusterFlowClient) Get(namespace, name string, options metav1.GetOptions) (*loggingv1.ClusterFlow, error) { + return c().Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c ClusterFlowClient) List(namespace string, opts metav1.ListOptions) (*loggingv1.ClusterFlowList, error) { + panic("implement me") +} +func (c ClusterFlowClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c ClusterFlowClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *loggingv1.ClusterFlow, err error) { + panic("implement me") +} + +type ClusterFlowCache func() loggingv1type.ClusterFlowInterface + +func (c ClusterFlowCache) Get(namespace, name string) (*loggingv1.ClusterFlow, error) { + panic("implement me") +} +func (c ClusterFlowCache) List(namespace string, selector labels.Selector) ([]*loggingv1.ClusterFlow, error) { + panic("implement me") +} +func (c ClusterFlowCache) AddIndexer(indexName string, indexer ctlloggingv1.ClusterFlowIndexer) { + panic("implement me") +} +func (c ClusterFlowCache) GetByIndex(indexName, key string) ([]*loggingv1.ClusterFlow, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/clusteroutput.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/clusteroutput.go new file mode 100644 index 00000000..2276cec4 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/clusteroutput.go @@ -0,0 +1,57 @@ +package fakeclients + +import ( + "context" + + loggingv1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + loggingv1type "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1" + ctlloggingv1 "github.com/harvester/harvester/pkg/generated/controllers/logging.banzaicloud.io/v1beta1" +) + +type ClusterOutputClient func() loggingv1type.ClusterOutputInterface + +func (c ClusterOutputClient) Create(clusterOutput *loggingv1.ClusterOutput) (*loggingv1.ClusterOutput, error) { + clusterOutput.Namespace = "" + return c().Create(context.TODO(), clusterOutput, metav1.CreateOptions{}) +} +func (c ClusterOutputClient) Update(clusterOutput *loggingv1.ClusterOutput) (*loggingv1.ClusterOutput, error) { + panic("implement me") +} +func (c ClusterOutputClient) UpdateStatus(clusterOutput *loggingv1.ClusterOutput) (*loggingv1.ClusterOutput, error) { + panic("implement me") +} +func (c ClusterOutputClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c().Delete(context.TODO(), name, metav1.DeleteOptions{}) +} +func (c ClusterOutputClient) Get(namespace, name string, options metav1.GetOptions) (*loggingv1.ClusterOutput, error) { + return c().Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c ClusterOutputClient) List(namespace string, opts metav1.ListOptions) (*loggingv1.ClusterOutputList, error) { + panic("implement me") +} +func (c ClusterOutputClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c ClusterOutputClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *loggingv1.ClusterOutput, err error) { + panic("implement me") +} + +type ClusterOutputCache func() loggingv1type.ClusterOutputInterface + +func (c ClusterOutputCache) Get(namespace, name string) (*loggingv1.ClusterOutput, error) { + panic("implement me") +} +func (c ClusterOutputCache) List(namespace string, selector labels.Selector) ([]*loggingv1.ClusterOutput, error) { + panic("implement me") +} +func (c ClusterOutputCache) AddIndexer(indexName string, indexer ctlloggingv1.ClusterOutputIndexer) { + panic("implement me") +} +func (c ClusterOutputCache) GetByIndex(indexName, key string) ([]*loggingv1.ClusterOutput, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/configmap.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/configmap.go new file mode 100644 index 00000000..e253ca61 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/configmap.go @@ -0,0 +1,63 @@ +package fakeclients + +import ( + "context" + + ctlcorev1 "github.com/rancher/wrangler/pkg/generated/controllers/core/v1" + "k8s.io/apimachinery/pkg/labels" + + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + corev1type "k8s.io/client-go/kubernetes/typed/core/v1" +) + +type ConfigmapClient func(namespace string) corev1type.ConfigMapInterface + +func (c ConfigmapClient) Create(configMap *v1.ConfigMap) (*v1.ConfigMap, error) { + return c(configMap.Namespace).Create(context.TODO(), configMap, metav1.CreateOptions{}) +} + +func (c ConfigmapClient) Update(configMap *v1.ConfigMap) (*v1.ConfigMap, error) { + return c(configMap.Namespace).Update(context.TODO(), configMap, metav1.UpdateOptions{}) +} + +func (c ConfigmapClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + panic("implement me") +} + +func (c ConfigmapClient) Get(namespace, name string, opts metav1.GetOptions) (*v1.ConfigMap, error) { + return c(namespace).Get(context.TODO(), name, opts) +} + +func (c ConfigmapClient) List(namespace string, opts metav1.ListOptions) (*v1.ConfigMapList, error) { + return c(namespace).List(context.TODO(), opts) +} + +func (c ConfigmapClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} + +func (c ConfigmapClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) { + panic("implement me") +} + +type ConfigmapCache func(namespace string) corev1type.ConfigMapInterface + +func (c ConfigmapCache) Get(namespace, name string) (*v1.ConfigMap, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c ConfigmapCache) List(namespace string, selector labels.Selector) ([]*v1.ConfigMap, error) { + panic("implement me") +} + +func (c ConfigmapCache) AddIndexer(indexName string, indexer ctlcorev1.ConfigMapIndexer) { + panic("implement me") +} + +func (c ConfigmapCache) GetByIndex(indexName, key string) ([]*v1.ConfigMap, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/deployment.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/deployment.go new file mode 100644 index 00000000..d56350c1 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/deployment.go @@ -0,0 +1,38 @@ +package fakeclients + +import ( + "context" + + appsv1 "k8s.io/api/apps/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + appsv1type "k8s.io/client-go/kubernetes/typed/apps/v1" +) + +type DeploymentClient func(string) appsv1type.DeploymentInterface + +func (c DeploymentClient) Update(deployment *appsv1.Deployment) (*appsv1.Deployment, error) { + panic("implement me") +} +func (c DeploymentClient) Get(namespace, name string, options metav1.GetOptions) (*appsv1.Deployment, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c DeploymentClient) Create(deployment *appsv1.Deployment) (*appsv1.Deployment, error) { + return c(deployment.Namespace).Create(context.TODO(), deployment, metav1.CreateOptions{}) +} +func (c DeploymentClient) UpdateStatus(*appsv1.Deployment) (*appsv1.Deployment, error) { + panic("implement me") +} +func (c DeploymentClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + panic("implement me") +} +func (c DeploymentClient) List(namespace string, opts metav1.ListOptions) (*appsv1.DeploymentList, error) { + panic("implement me") +} +func (c DeploymentClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c DeploymentClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *appsv1.Deployment, err error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/harvestersetting.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/harvestersetting.go new file mode 100644 index 00000000..60bee779 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/harvestersetting.go @@ -0,0 +1,66 @@ +package fakeclients + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + harvestertype "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + harvesterv1ctl "github.com/harvester/harvester/pkg/generated/controllers/harvesterhci.io/v1beta1" +) + +type HarvesterSettingClient func() harvestertype.SettingInterface + +func (c HarvesterSettingClient) Create(s *v1beta1.Setting) (*v1beta1.Setting, error) { + return c().Create(context.TODO(), s, metav1.CreateOptions{}) +} + +func (c HarvesterSettingClient) Update(s *v1beta1.Setting) (*v1beta1.Setting, error) { + return c().Update(context.TODO(), s, metav1.UpdateOptions{}) +} + +func (c HarvesterSettingClient) UpdateStatus(s *v1beta1.Setting) (*v1beta1.Setting, error) { + panic("implement me") +} + +func (c HarvesterSettingClient) Delete(name string, options *metav1.DeleteOptions) error { + return c().Delete(context.TODO(), name, *options) +} + +func (c HarvesterSettingClient) Get(name string, options metav1.GetOptions) (*v1beta1.Setting, error) { + return c().Get(context.TODO(), name, options) +} + +func (c HarvesterSettingClient) List(opts metav1.ListOptions) (*v1beta1.SettingList, error) { + return c().List(context.TODO(), opts) +} + +func (c HarvesterSettingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return c().Watch(context.TODO(), opts) +} + +func (c HarvesterSettingClient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Setting, err error) { + return c().Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) +} + +type HarvesterSettingCache func() harvestertype.SettingInterface + +func (c HarvesterSettingCache) Get(name string) (*v1beta1.Setting, error) { + return c().Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c HarvesterSettingCache) List(selector labels.Selector) ([]*v1beta1.Setting, error) { + panic("implement me") +} + +func (c HarvesterSettingCache) AddIndexer(indexName string, indexer harvesterv1ctl.SettingIndexer) { + panic("implement me") +} + +func (c HarvesterSettingCache) GetByIndex(indexName, key string) ([]*v1beta1.Setting, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/job.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/job.go new file mode 100644 index 00000000..123bce6c --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/job.go @@ -0,0 +1,38 @@ +package fakeclients + +import ( + "context" + + batchv1 "k8s.io/api/batch/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + batchv1type "k8s.io/client-go/kubernetes/typed/batch/v1" +) + +type JobClient func(string) batchv1type.JobInterface + +func (c JobClient) Update(job *batchv1.Job) (*batchv1.Job, error) { + return c(job.Namespace).Update(context.TODO(), job, metav1.UpdateOptions{}) +} +func (c JobClient) Get(namespace, name string, options metav1.GetOptions) (*batchv1.Job, error) { + panic("implement me") +} +func (c JobClient) Create(*batchv1.Job) (*batchv1.Job, error) { + panic("implement me") +} +func (c JobClient) UpdateStatus(*batchv1.Job) (*batchv1.Job, error) { + panic("implement me") +} +func (c JobClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + panic("implement me") +} +func (c JobClient) List(namespace string, opts metav1.ListOptions) (*batchv1.Job, error) { + panic("implement me") +} +func (c JobClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c JobClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *batchv1.Job, err error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/logging.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/logging.go new file mode 100644 index 00000000..b6e137e3 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/logging.go @@ -0,0 +1,57 @@ +package fakeclients + +import ( + "context" + + loggingv1 "github.com/banzaicloud/logging-operator/pkg/sdk/logging/api/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + loggingv1type "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/logging.banzaicloud.io/v1beta1" + ctlloggingv1 "github.com/harvester/harvester/pkg/generated/controllers/logging.banzaicloud.io/v1beta1" +) + +type LoggingClient func() loggingv1type.LoggingInterface + +func (c LoggingClient) Create(logging *loggingv1.Logging) (*loggingv1.Logging, error) { + return c().Create(context.TODO(), logging, metav1.CreateOptions{}) +} +func (c LoggingClient) Update(logging *loggingv1.Logging) (*loggingv1.Logging, error) { + panic("implement me") +} +func (c LoggingClient) UpdateStatus(logging *loggingv1.Logging) (*loggingv1.Logging, error) { + panic("implement me") +} +func (c LoggingClient) Delete(name string, options *metav1.DeleteOptions) error { + return c().Delete(context.TODO(), name, metav1.DeleteOptions{}) +} +func (c LoggingClient) Get(name string, options metav1.GetOptions) (*loggingv1.Logging, error) { + return c().Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c LoggingClient) List(opts metav1.ListOptions) (*loggingv1.LoggingList, error) { + panic("implement me") +} + +func (c LoggingClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c LoggingClient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *loggingv1.Logging, err error) { + panic("implement me") +} + +type LoggingCache func() loggingv1type.LoggingInterface + +func (c LoggingCache) Get(name string) (*loggingv1.Logging, error) { + return c().Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c LoggingCache) List(selector labels.Selector) ([]*loggingv1.Logging, error) { + panic("implement me") +} +func (c LoggingCache) AddIndexer(indexName string, indexer ctlloggingv1.LoggingIndexer) { + panic("implement me") +} +func (c LoggingCache) GetByIndex(indexName, key string) ([]*loggingv1.Logging, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/longhornreplica.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/longhornreplica.go new file mode 100644 index 00000000..57d03362 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/longhornreplica.go @@ -0,0 +1,77 @@ +package fakeclients + +import ( + "context" + + longhornv1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + lhtype "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1" + longhornv1ctl "github.com/harvester/harvester/pkg/generated/controllers/longhorn.io/v1beta1" +) + +type LonghornReplicaClient func(string) lhtype.ReplicaInterface + +func (c LonghornReplicaClient) Create(replica *longhornv1.Replica) (*longhornv1.Replica, error) { + return c(replica.Namespace).Create(context.TODO(), replica, metav1.CreateOptions{}) +} + +func (c LonghornReplicaClient) Update(replica *longhornv1.Replica) (*longhornv1.Replica, error) { + return c(replica.Namespace).Update(context.TODO(), replica, metav1.UpdateOptions{}) +} + +func (c LonghornReplicaClient) UpdateStatus(replica *longhornv1.Replica) (*longhornv1.Replica, error) { + panic("implement me") +} + +func (c LonghornReplicaClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c(namespace).Delete(context.TODO(), name, *options) +} + +func (c LonghornReplicaClient) Get(namespace, name string, options metav1.GetOptions) (*longhornv1.Replica, error) { + return c(namespace).Get(context.TODO(), name, options) +} + +func (c LonghornReplicaClient) List(namespace string, opts metav1.ListOptions) (*longhornv1.ReplicaList, error) { + return c(namespace).List(context.TODO(), opts) +} + +func (c LonghornReplicaClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + return c(namespace).Watch(context.TODO(), opts) +} + +func (c LonghornReplicaClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *longhornv1.Replica, err error) { + return c(namespace).Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) +} + +type LonghornReplicaCache func(string) lhtype.ReplicaInterface + +func (c LonghornReplicaCache) Get(namespace, name string) (*longhornv1.Replica, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c LonghornReplicaCache) List(namespace string, selector labels.Selector) ([]*longhornv1.Replica, error) { + replicaList, err := c(namespace).List(context.TODO(), metav1.ListOptions{ + LabelSelector: selector.String(), + }) + if err != nil { + return nil, err + } + returnReplicas := make([]*longhornv1.Replica, 0, len(replicaList.Items)) + for i := range replicaList.Items { + returnReplicas = append(returnReplicas, &replicaList.Items[i]) + } + + return returnReplicas, nil +} + +func (c LonghornReplicaCache) AddIndexer(indexName string, indexer longhornv1ctl.ReplicaIndexer) { + panic("implement me") +} + +func (c LonghornReplicaCache) GetByIndex(indexName, key string) ([]*longhornv1.Replica, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/longhornsetting.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/longhornsetting.go new file mode 100644 index 00000000..6e55fabd --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/longhornsetting.go @@ -0,0 +1,66 @@ +package fakeclients + +import ( + "context" + + longhornv1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + lhtype "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1" + longhornv1ctl "github.com/harvester/harvester/pkg/generated/controllers/longhorn.io/v1beta1" +) + +type LonghornSettingClient func(string) lhtype.SettingInterface + +func (c LonghornSettingClient) Create(setting *longhornv1.Setting) (*longhornv1.Setting, error) { + return c(setting.Namespace).Create(context.TODO(), setting, metav1.CreateOptions{}) +} + +func (c LonghornSettingClient) Update(setting *longhornv1.Setting) (*longhornv1.Setting, error) { + return c(setting.Namespace).Update(context.TODO(), setting, metav1.UpdateOptions{}) +} + +func (c LonghornSettingClient) UpdateStatus(setting *longhornv1.Setting) (*longhornv1.Setting, error) { + panic("implement me") +} + +func (c LonghornSettingClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c(namespace).Delete(context.TODO(), name, *options) +} + +func (c LonghornSettingClient) Get(namespace, name string, options metav1.GetOptions) (*longhornv1.Setting, error) { + return c(namespace).Get(context.TODO(), name, options) +} + +func (c LonghornSettingClient) List(namespace string, opts metav1.ListOptions) (*longhornv1.SettingList, error) { + return c(namespace).List(context.TODO(), opts) +} + +func (c LonghornSettingClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + return c(namespace).Watch(context.TODO(), opts) +} + +func (c LonghornSettingClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *longhornv1.Setting, err error) { + return c(namespace).Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) +} + +type LonghornSettingCache func(string) lhtype.SettingInterface + +func (c LonghornSettingCache) Get(namespace, name string) (*longhornv1.Setting, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c LonghornSettingCache) List(namespace string, selector labels.Selector) ([]*longhornv1.Setting, error) { + panic("implement me") +} + +func (c LonghornSettingCache) AddIndexer(indexName string, indexer longhornv1ctl.SettingIndexer) { + panic("implement me") +} + +func (c LonghornSettingCache) GetByIndex(indexName, key string) ([]*longhornv1.Setting, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/longhornvolume.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/longhornvolume.go new file mode 100644 index 00000000..fa1a722b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/longhornvolume.go @@ -0,0 +1,77 @@ +package fakeclients + +import ( + "context" + + longhornv1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + lhtype "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/longhorn.io/v1beta1" + longhornv1ctl "github.com/harvester/harvester/pkg/generated/controllers/longhorn.io/v1beta1" +) + +type LonghornVolumeClient func(string) lhtype.VolumeInterface + +func (c LonghornVolumeClient) Create(volume *longhornv1.Volume) (*longhornv1.Volume, error) { + return c(volume.Namespace).Create(context.TODO(), volume, metav1.CreateOptions{}) +} + +func (c LonghornVolumeClient) Update(volume *longhornv1.Volume) (*longhornv1.Volume, error) { + return c(volume.Namespace).Update(context.TODO(), volume, metav1.UpdateOptions{}) +} + +func (c LonghornVolumeClient) UpdateStatus(volume *longhornv1.Volume) (*longhornv1.Volume, error) { + panic("implement me") +} + +func (c LonghornVolumeClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c(namespace).Delete(context.TODO(), name, *options) +} + +func (c LonghornVolumeClient) Get(namespace, name string, options metav1.GetOptions) (*longhornv1.Volume, error) { + return c(namespace).Get(context.TODO(), name, options) +} + +func (c LonghornVolumeClient) List(namespace string, opts metav1.ListOptions) (*longhornv1.VolumeList, error) { + return c(namespace).List(context.TODO(), opts) +} + +func (c LonghornVolumeClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + return c(namespace).Watch(context.TODO(), opts) +} + +func (c LonghornVolumeClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *longhornv1.Volume, err error) { + return c(namespace).Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) +} + +type LonghornVolumeCache func(string) lhtype.VolumeInterface + +func (c LonghornVolumeCache) Get(namespace, name string) (*longhornv1.Volume, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c LonghornVolumeCache) List(namespace string, selector labels.Selector) ([]*longhornv1.Volume, error) { + volumeList, err := c(namespace).List(context.TODO(), metav1.ListOptions{ + LabelSelector: selector.String(), + }) + if err != nil { + return nil, err + } + returnVolumes := make([]*longhornv1.Volume, 0, len(volumeList.Items)) + for i := range volumeList.Items { + returnVolumes = append(returnVolumes, &volumeList.Items[i]) + } + + return returnVolumes, nil +} + +func (c LonghornVolumeCache) AddIndexer(indexName string, indexer longhornv1ctl.VolumeIndexer) { + panic("implement me") +} + +func (c LonghornVolumeCache) GetByIndex(indexName, key string) ([]*longhornv1.Volume, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/managedchart.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/managedchart.go new file mode 100644 index 00000000..6ea1c174 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/managedchart.go @@ -0,0 +1,69 @@ +package fakeclients + +import ( + "context" + "fmt" + + mgmtv3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" + ctlmgmtv3 "github.com/rancher/rancher/pkg/generated/controllers/management.cattle.io/v3" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + mgmtv3type "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/management.cattle.io/v3" + "github.com/harvester/harvester/tests/framework/fuzz" +) + +type ManagedChartClient func(string) mgmtv3type.ManagedChartInterface + +func (c ManagedChartClient) Update(managedChart *mgmtv3.ManagedChart) (*mgmtv3.ManagedChart, error) { + return c(managedChart.Namespace).Update(context.TODO(), managedChart, metav1.UpdateOptions{}) +} +func (c ManagedChartClient) Get(namespace, name string, options metav1.GetOptions) (*mgmtv3.ManagedChart, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c ManagedChartClient) Create(managedChart *mgmtv3.ManagedChart) (*mgmtv3.ManagedChart, error) { + if managedChart.GenerateName != "" { + managedChart.Name = fmt.Sprintf("%s%s", managedChart.GenerateName, fuzz.String(5)) + } + return c(managedChart.Namespace).Create(context.TODO(), managedChart, metav1.CreateOptions{}) +} +func (c ManagedChartClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c(namespace).Delete(context.TODO(), name, metav1.DeleteOptions{}) +} +func (c ManagedChartClient) List(namespace string, opts metav1.ListOptions) (*mgmtv3.ManagedChartList, error) { + panic("implement me") +} +func (c ManagedChartClient) UpdateStatus(*mgmtv3.ManagedChart) (*mgmtv3.ManagedChart, error) { + panic("implement me") +} +func (c ManagedChartClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c ManagedChartClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *mgmtv3.ManagedChart, err error) { + panic("implement me") +} + +type ManagedChartCache func(string) mgmtv3type.ManagedChartInterface + +func (c ManagedChartCache) Get(namespace, name string) (*mgmtv3.ManagedChart, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c ManagedChartCache) List(namespace string, selector labels.Selector) ([]*mgmtv3.ManagedChart, error) { + list, err := c(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: selector.String()}) + if err != nil { + return nil, err + } + result := make([]*mgmtv3.ManagedChart, 0, len(list.Items)) + for i := range list.Items { + result = append(result, &list.Items[i]) + } + return result, err +} +func (c ManagedChartCache) AddIndexer(indexName string, indexer ctlmgmtv3.ManagedChartIndexer) { + panic("implement me") +} +func (c ManagedChartCache) GetByIndex(indexName, key string) ([]*mgmtv3.ManagedChart, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/networkattachmentdefinition.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/networkattachmentdefinition.go new file mode 100644 index 00000000..25b3b0bb --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/networkattachmentdefinition.go @@ -0,0 +1,42 @@ +package fakeclients + +import ( + "context" + + cniv1 "github.com/k8snetworkplumbingwg/network-attachment-definition-client/pkg/apis/k8s.cni.cncf.io/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + + cnitype "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/k8s.cni.cncf.io/v1" + ctlcniv1 "github.com/harvester/harvester/pkg/generated/controllers/k8s.cni.cncf.io/v1" +) + +type NetworkAttachmentDefinitionCache func(namespace string) cnitype.NetworkAttachmentDefinitionInterface + +func (c NetworkAttachmentDefinitionCache) Get(namespace, name string) (*cniv1.NetworkAttachmentDefinition, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c NetworkAttachmentDefinitionCache) List(namespace string, selector labels.Selector) ([]*cniv1.NetworkAttachmentDefinition, error) { + nadList, err := c(namespace).List(context.TODO(), metav1.ListOptions{ + LabelSelector: selector.String(), + }) + if err != nil { + return nil, err + } + + nads := []*cniv1.NetworkAttachmentDefinition{} + for _, item := range nadList.Items { + nads = append(nads, &item) + } + + return nads, nil +} + +func (c NetworkAttachmentDefinitionCache) AddIndexer(indexName string, indexer ctlcniv1.NetworkAttachmentDefinitionIndexer) { + panic("implement me") +} + +func (c NetworkAttachmentDefinitionCache) GetByIndex(indexName, key string) ([]*cniv1.NetworkAttachmentDefinition, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/node.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/node.go new file mode 100644 index 00000000..9e3edb63 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/node.go @@ -0,0 +1,76 @@ +package fakeclients + +import ( + "context" + + ctlcorev1 "github.com/rancher/wrangler/pkg/generated/controllers/core/v1" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + corev1type "k8s.io/client-go/kubernetes/typed/core/v1" +) + +type NodeCache func() corev1type.NodeInterface + +func (c NodeCache) Get(name string) (*v1.Node, error) { + return c().Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c NodeCache) List(selector labels.Selector) ([]*v1.Node, error) { + list, err := c().List(context.TODO(), metav1.ListOptions{ + LabelSelector: selector.String(), + }) + if err != nil { + return nil, err + } + result := make([]*v1.Node, 0, len(list.Items)) + for _, node := range list.Items { + obj := node + result = append(result, &obj) + } + return result, err +} + +func (c NodeCache) AddIndexer(indexName string, indexer ctlcorev1.NodeIndexer) { + panic("implement me") +} + +func (c NodeCache) GetByIndex(indexName, key string) ([]*v1.Node, error) { + panic("implement me") +} + +type NodeClient func() corev1type.NodeInterface + +func (c NodeClient) Update(node *v1.Node) (*v1.Node, error) { + return c().Update(context.TODO(), node, metav1.UpdateOptions{}) +} + +func (c NodeClient) Get(name string, options metav1.GetOptions) (*v1.Node, error) { + return c().Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c NodeClient) Create(node *v1.Node) (*v1.Node, error) { + return c().Create(context.TODO(), node, metav1.CreateOptions{}) +} + +func (c NodeClient) Delete(name string, options *metav1.DeleteOptions) error { + panic("implement me") +} + +func (c NodeClient) List(opts metav1.ListOptions) (*v1.NodeList, error) { + panic("implement me") +} + +func (c NodeClient) UpdateStatus(*v1.Node) (*v1.Node, error) { + panic("implement me") +} + +func (c NodeClient) Watch(pts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} + +func (c NodeClient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Node, err error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/plan.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/plan.go new file mode 100644 index 00000000..60c9d596 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/plan.go @@ -0,0 +1,59 @@ +package fakeclients + +import ( + "context" + + upgradeapiv1 "github.com/rancher/system-upgrade-controller/pkg/apis/upgrade.cattle.io/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + upgradev1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/upgrade.cattle.io/v1" + upgradectlv1 "github.com/harvester/harvester/pkg/generated/controllers/upgrade.cattle.io/v1" +) + +type PlanClient func(string) upgradev1.PlanInterface + +func (c PlanClient) Update(plan *upgradeapiv1.Plan) (*upgradeapiv1.Plan, error) { + return c(plan.Namespace).Update(context.TODO(), plan, metav1.UpdateOptions{}) +} +func (c PlanClient) Get(namespace, name string, options metav1.GetOptions) (*upgradeapiv1.Plan, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c PlanClient) Create(plan *upgradeapiv1.Plan) (*upgradeapiv1.Plan, error) { + return c(plan.Namespace).Create(context.TODO(), plan, metav1.CreateOptions{}) +} +func (c PlanClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + panic("implement me") +} +func (c PlanClient) List(namespace string, opts metav1.ListOptions) (*upgradeapiv1.PlanList, error) { + panic("implement me") +} +func (c PlanClient) UpdateStatus(*upgradeapiv1.Plan) (*upgradeapiv1.Plan, error) { + panic("implement me") +} +func (c PlanClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c PlanClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *upgradeapiv1.Plan, err error) { + panic("implement me") +} + +type PlanCache func(string) upgradev1.PlanInterface + +func (c PlanCache) Get(namespace, name string) (*upgradeapiv1.Plan, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c PlanCache) List(namespace string, selector labels.Selector) ([]*upgradeapiv1.Plan, error) { + panic("implement me") +} + +func (c PlanCache) AddIndexer(indexName string, indexer upgradectlv1.PlanIndexer) { + panic("implement me") +} + +func (c PlanCache) GetByIndex(indexName, key string) ([]*upgradeapiv1.Plan, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/pvc.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/pvc.go new file mode 100644 index 00000000..8d326791 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/pvc.go @@ -0,0 +1,82 @@ +package fakeclients + +import ( + "context" + + ctlv1 "github.com/rancher/wrangler/pkg/generated/controllers/core/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + v1 "k8s.io/client-go/kubernetes/typed/core/v1" + + "github.com/harvester/harvester/pkg/indexeres" + "github.com/harvester/harvester/pkg/ref" +) + +type PersistentVolumeClaimClient func(string) v1.PersistentVolumeClaimInterface + +func (c PersistentVolumeClaimClient) Create(volume *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error) { + return c(volume.Namespace).Create(context.TODO(), volume, metav1.CreateOptions{}) +} + +func (c PersistentVolumeClaimClient) Update(volume *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error) { + return c(volume.Namespace).Update(context.TODO(), volume, metav1.UpdateOptions{}) +} + +func (c PersistentVolumeClaimClient) UpdateStatus(volume *corev1.PersistentVolumeClaim) (*corev1.PersistentVolumeClaim, error) { + panic("implement me") +} + +func (c PersistentVolumeClaimClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c(namespace).Delete(context.TODO(), name, *options) +} + +func (c PersistentVolumeClaimClient) Get(namespace, name string, options metav1.GetOptions) (*corev1.PersistentVolumeClaim, error) { + return c(namespace).Get(context.TODO(), name, options) +} + +func (c PersistentVolumeClaimClient) List(namespace string, opts metav1.ListOptions) (*corev1.PersistentVolumeClaimList, error) { + return c(namespace).List(context.TODO(), opts) +} + +func (c PersistentVolumeClaimClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + return c(namespace).Watch(context.TODO(), opts) +} + +func (c PersistentVolumeClaimClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *corev1.PersistentVolumeClaim, err error) { + return c(namespace).Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) +} + +type PersistentVolumeClaimCache func(string) v1.PersistentVolumeClaimInterface + +func (c PersistentVolumeClaimCache) Get(namespace, name string) (*corev1.PersistentVolumeClaim, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c PersistentVolumeClaimCache) List(namespace string, selector labels.Selector) ([]*corev1.PersistentVolumeClaim, error) { + panic("implement me") +} + +func (c PersistentVolumeClaimCache) AddIndexer(indexName string, indexer ctlv1.PersistentVolumeClaimIndexer) { + panic("implement me") +} + +func (c PersistentVolumeClaimCache) GetByIndex(indexName, key string) ([]*corev1.PersistentVolumeClaim, error) { + switch indexName { + case indexeres.PVCByVMIndex: + vmNamespace, _ := ref.Parse(key) + pvcList, err := c(vmNamespace).List(context.TODO(), metav1.ListOptions{}) + if err != nil { + return nil, err + } + var pvcs []*corev1.PersistentVolumeClaim + for _, pvc := range pvcList.Items { + pvcs = append(pvcs, &pvc) + } + return pvcs, nil + default: + return nil, nil + } +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/service.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/service.go new file mode 100644 index 00000000..e0b361fc --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/service.go @@ -0,0 +1,65 @@ +package fakeclients + +import ( + "context" + + ctlv1 "github.com/rancher/wrangler/pkg/generated/controllers/core/v1" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + v1 "k8s.io/client-go/kubernetes/typed/core/v1" +) + +type ServiceClient func(string) v1.ServiceInterface + +func (c ServiceClient) Create(service *corev1.Service) (*corev1.Service, error) { + return c(service.Namespace).Create(context.TODO(), service, metav1.CreateOptions{}) +} + +func (c ServiceClient) Update(service *corev1.Service) (*corev1.Service, error) { + return c(service.Namespace).Update(context.TODO(), service, metav1.UpdateOptions{}) +} + +func (c ServiceClient) UpdateStatus(service *corev1.Service) (*corev1.Service, error) { + panic("implement me") +} + +func (c ServiceClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c(namespace).Delete(context.TODO(), name, *options) +} + +func (c ServiceClient) Get(namespace, name string, options metav1.GetOptions) (*corev1.Service, error) { + return c(namespace).Get(context.TODO(), name, options) +} + +func (c ServiceClient) List(namespace string, opts metav1.ListOptions) (*corev1.ServiceList, error) { + return c(namespace).List(context.TODO(), opts) +} + +func (c ServiceClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + return c(namespace).Watch(context.TODO(), opts) +} + +func (c ServiceClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *corev1.Service, err error) { + return c(namespace).Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) +} + +type ServiceCache func(string) v1.ServiceInterface + +func (c ServiceCache) Get(namespace, name string) (*corev1.Service, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c ServiceCache) List(namespace string, selector labels.Selector) ([]*corev1.Service, error) { + panic("implement me") +} + +func (c ServiceCache) AddIndexer(indexName string, indexer ctlv1.ServiceIndexer) { + panic("implement me") +} + +func (c ServiceCache) GetByIndex(indexName, key string) ([]*corev1.Service, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/storageclass.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/storageclass.go new file mode 100644 index 00000000..31896f0a --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/storageclass.go @@ -0,0 +1,73 @@ +package fakeclients + +import ( + "context" + + ctlstoragev1 "github.com/rancher/wrangler/pkg/generated/controllers/storage/v1" + storagev1 "k8s.io/api/storage/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + storagev1type "k8s.io/client-go/kubernetes/typed/storage/v1" +) + +type StorageClassClient func() storagev1type.StorageClassInterface + +func (c StorageClassClient) Create(s *storagev1.StorageClass) (*storagev1.StorageClass, error) { + return c().Create(context.TODO(), s, metav1.CreateOptions{}) +} + +func (c StorageClassClient) Update(s *storagev1.StorageClass) (*storagev1.StorageClass, error) { + return c().Update(context.TODO(), s, metav1.UpdateOptions{}) +} + +func (c StorageClassClient) UpdateStatus(s *storagev1.StorageClass) (*storagev1.StorageClass, error) { + panic("implement me") +} + +func (c StorageClassClient) Delete(name string, options *metav1.DeleteOptions) error { + return c().Delete(context.TODO(), name, *options) +} + +func (c StorageClassClient) Get(name string, options metav1.GetOptions) (*storagev1.StorageClass, error) { + return c().Get(context.TODO(), name, options) +} + +func (c StorageClassClient) List(opts metav1.ListOptions) (*storagev1.StorageClassList, error) { + return c().List(context.TODO(), opts) +} + +func (c StorageClassClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { + return c().Watch(context.TODO(), opts) +} + +func (c StorageClassClient) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *storagev1.StorageClass, err error) { + return c().Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) +} + +type StorageClassCache func() storagev1type.StorageClassInterface + +func (c StorageClassCache) Get(name string) (*storagev1.StorageClass, error) { + return c().Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c StorageClassCache) List(selector labels.Selector) ([]*storagev1.StorageClass, error) { + list, err := c().List(context.TODO(), metav1.ListOptions{LabelSelector: selector.String()}) + if err != nil { + return nil, err + } + result := make([]*storagev1.StorageClass, 0, len(list.Items)) + for i := range list.Items { + result = append(result, &list.Items[i]) + } + return result, err +} + +func (c StorageClassCache) AddIndexer(indexName string, indexer ctlstoragev1.StorageClassIndexer) { + panic("implement me") +} + +func (c StorageClassCache) GetByIndex(indexName, key string) ([]*storagev1.StorageClass, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/upgrade.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/upgrade.go new file mode 100644 index 00000000..9b99e2a0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/upgrade.go @@ -0,0 +1,64 @@ +package fakeclients + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + harvesterv1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + harv1type "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + ctlharvesterv1 "github.com/harvester/harvester/pkg/generated/controllers/harvesterhci.io/v1beta1" +) + +type UpgradeClient func(string) harv1type.UpgradeInterface + +func (c UpgradeClient) Update(upgrade *harvesterv1.Upgrade) (*harvesterv1.Upgrade, error) { + return c(upgrade.Namespace).Update(context.TODO(), upgrade, metav1.UpdateOptions{}) +} +func (c UpgradeClient) Get(namespace, name string, options metav1.GetOptions) (*harvesterv1.Upgrade, error) { + panic("implement me") +} +func (c UpgradeClient) Create(*harvesterv1.Upgrade) (*harvesterv1.Upgrade, error) { + panic("implement me") +} +func (c UpgradeClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + panic("implement me") +} +func (c UpgradeClient) List(namespace string, opts metav1.ListOptions) (*harvesterv1.UpgradeList, error) { + panic("implement me") +} +func (c UpgradeClient) UpdateStatus(*harvesterv1.Upgrade) (*harvesterv1.Upgrade, error) { + panic("implement me") +} +func (c UpgradeClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c UpgradeClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *harvesterv1.Upgrade, err error) { + panic("implement me") +} + +type UpgradeCache func(string) harv1type.UpgradeInterface + +func (c UpgradeCache) Get(namespace, name string) (*harvesterv1.Upgrade, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c UpgradeCache) List(namespace string, selector labels.Selector) ([]*harvesterv1.Upgrade, error) { + list, err := c(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: selector.String()}) + if err != nil { + return nil, err + } + result := make([]*harvesterv1.Upgrade, 0, len(list.Items)) + for i := range list.Items { + result = append(result, &list.Items[i]) + } + return result, err +} +func (c UpgradeCache) AddIndexer(indexName string, indexer ctlharvesterv1.UpgradeIndexer) { + panic("implement me") +} +func (c UpgradeCache) GetByIndex(indexName, key string) ([]*harvesterv1.Upgrade, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/upgradelog.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/upgradelog.go new file mode 100644 index 00000000..4ab82d7b --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/upgradelog.go @@ -0,0 +1,56 @@ +package fakeclients + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + harvesterv1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + harv1type "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + ctlharvesterv1 "github.com/harvester/harvester/pkg/generated/controllers/harvesterhci.io/v1beta1" +) + +type UpgradeLogClient func(string) harv1type.UpgradeLogInterface + +func (c UpgradeLogClient) Create(upgradeLog *harvesterv1.UpgradeLog) (*harvesterv1.UpgradeLog, error) { + return c(upgradeLog.Namespace).Create(context.TODO(), upgradeLog, metav1.CreateOptions{}) +} +func (c UpgradeLogClient) Update(upgradeLog *harvesterv1.UpgradeLog) (*harvesterv1.UpgradeLog, error) { + return c(upgradeLog.Namespace).Update(context.TODO(), upgradeLog, metav1.UpdateOptions{}) +} +func (c UpgradeLogClient) UpdateStatus(upgradeLog *harvesterv1.UpgradeLog) (*harvesterv1.UpgradeLog, error) { + panic("implement me") +} +func (c UpgradeLogClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c(namespace).Delete(context.TODO(), name, *options) +} +func (c UpgradeLogClient) Get(namespace, name string, options metav1.GetOptions) (*harvesterv1.UpgradeLog, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c UpgradeLogClient) List(namespace string, opts metav1.ListOptions) (*harvesterv1.UpgradeLogList, error) { + panic("implement me") +} +func (c UpgradeLogClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c UpgradeLogClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *harvesterv1.UpgradeLog, err error) { + panic("implement me") +} + +type UpgradeLogCache func(string) harv1type.UpgradeLogInterface + +func (c UpgradeLogCache) Get(namespace, name string) (*harvesterv1.UpgradeLog, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c UpgradeLogCache) List(namespace string, selector labels.Selector) ([]*harvesterv1.UpgradeLog, error) { + panic("implement me") +} +func (c UpgradeLogCache) AddIndexer(indexName string, indexer ctlharvesterv1.UpgradeLogIndexer) { + panic("implement me") +} +func (c UpgradeLogCache) GetByIndex(indexName, key string) ([]*harvesterv1.UpgradeLog, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/version.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/version.go new file mode 100644 index 00000000..41a144e0 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/version.go @@ -0,0 +1,27 @@ +package fakeclients + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + + harvesterv1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + harv1type "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + ctlharvesterv1 "github.com/harvester/harvester/pkg/generated/controllers/harvesterhci.io/v1beta1" +) + +type VersionCache func(string) harv1type.VersionInterface + +func (c VersionCache) Get(namespace, name string) (*harvesterv1.Version, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c VersionCache) List(namespace string, selector labels.Selector) ([]*harvesterv1.Version, error) { + panic("implement me") +} +func (c VersionCache) AddIndexer(indexName string, indexer ctlharvesterv1.VersionIndexer) { + panic("implement me") +} +func (c VersionCache) GetByIndex(indexName, key string) ([]*harvesterv1.Version, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/virtualmachine.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/virtualmachine.go new file mode 100644 index 00000000..c566935d --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/virtualmachine.go @@ -0,0 +1,66 @@ +package fakeclients + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + kubevirtv1api "kubevirt.io/api/core/v1" + + kubevirtv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1" + kubevirtctlv1 "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io/v1" +) + +type VirtualMachineClient func(string) kubevirtv1.VirtualMachineInterface + +func (c VirtualMachineClient) Update(virtualMachine *kubevirtv1api.VirtualMachine) (*kubevirtv1api.VirtualMachine, error) { + return c(virtualMachine.Namespace).Update(context.TODO(), virtualMachine, metav1.UpdateOptions{}) +} + +func (c VirtualMachineClient) Get(namespace, name string, options metav1.GetOptions) (*kubevirtv1api.VirtualMachine, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c VirtualMachineClient) Create(virtualMachine *kubevirtv1api.VirtualMachine) (*kubevirtv1api.VirtualMachine, error) { + return c(virtualMachine.Namespace).Create(context.TODO(), virtualMachine, metav1.CreateOptions{}) +} + +func (c VirtualMachineClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + panic("implement me") +} + +func (c VirtualMachineClient) List(namespace string, opts metav1.ListOptions) (*kubevirtv1api.VirtualMachineList, error) { + panic("implement me") +} + +func (c VirtualMachineClient) UpdateStatus(*kubevirtv1api.VirtualMachine) (*kubevirtv1api.VirtualMachine, error) { + panic("implement me") +} + +func (c VirtualMachineClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} + +func (c VirtualMachineClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *kubevirtv1api.VirtualMachine, err error) { + panic("implement me") +} + +type VirtualMachineCache func(string) kubevirtv1.VirtualMachineInterface + +func (c VirtualMachineCache) Get(namespace, name string) (*kubevirtv1api.VirtualMachine, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c VirtualMachineCache) List(namespace string, selector labels.Selector) ([]*kubevirtv1api.VirtualMachine, error) { + panic("implement me") +} + +func (c VirtualMachineCache) AddIndexer(indexName string, indexer kubevirtctlv1.VirtualMachineIndexer) { + panic("implement me") +} + +func (c VirtualMachineCache) GetByIndex(indexName, key string) ([]*kubevirtv1api.VirtualMachine, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/virtualmachineimage.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/virtualmachineimage.go new file mode 100644 index 00000000..34ef7313 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/virtualmachineimage.go @@ -0,0 +1,69 @@ +package fakeclients + +import ( + "context" + "fmt" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + harvesterv1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + harv1type "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + ctlharvesterv1 "github.com/harvester/harvester/pkg/generated/controllers/harvesterhci.io/v1beta1" + "github.com/harvester/harvester/tests/framework/fuzz" +) + +type VirtualMachineImageClient func(string) harv1type.VirtualMachineImageInterface + +func (c VirtualMachineImageClient) Update(virtualMachineImage *harvesterv1.VirtualMachineImage) (*harvesterv1.VirtualMachineImage, error) { + return c(virtualMachineImage.Namespace).Update(context.TODO(), virtualMachineImage, metav1.UpdateOptions{}) +} +func (c VirtualMachineImageClient) Get(namespace, name string, options metav1.GetOptions) (*harvesterv1.VirtualMachineImage, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c VirtualMachineImageClient) Create(virtualMachineImage *harvesterv1.VirtualMachineImage) (*harvesterv1.VirtualMachineImage, error) { + if virtualMachineImage.GenerateName != "" { + virtualMachineImage.Name = fmt.Sprintf("%s%s", virtualMachineImage.GenerateName, fuzz.String(5)) + } + return c(virtualMachineImage.Namespace).Create(context.TODO(), virtualMachineImage, metav1.CreateOptions{}) +} +func (c VirtualMachineImageClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + panic("implement me") +} +func (c VirtualMachineImageClient) List(namespace string, opts metav1.ListOptions) (*harvesterv1.VirtualMachineImageList, error) { + panic("implement me") +} +func (c VirtualMachineImageClient) UpdateStatus(*harvesterv1.VirtualMachineImage) (*harvesterv1.VirtualMachineImage, error) { + panic("implement me") +} +func (c VirtualMachineImageClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} +func (c VirtualMachineImageClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *harvesterv1.VirtualMachineImage, err error) { + panic("implement me") +} + +type VirtualMachineImageCache func(string) harv1type.VirtualMachineImageInterface + +func (c VirtualMachineImageCache) Get(namespace, name string) (*harvesterv1.VirtualMachineImage, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} +func (c VirtualMachineImageCache) List(namespace string, selector labels.Selector) ([]*harvesterv1.VirtualMachineImage, error) { + list, err := c(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: selector.String()}) + if err != nil { + return nil, err + } + result := make([]*harvesterv1.VirtualMachineImage, 0, len(list.Items)) + for i := range list.Items { + result = append(result, &list.Items[i]) + } + return result, err +} +func (c VirtualMachineImageCache) AddIndexer(indexName string, indexer ctlharvesterv1.VirtualMachineImageIndexer) { + panic("implement me") +} +func (c VirtualMachineImageCache) GetByIndex(indexName, key string) ([]*harvesterv1.VirtualMachineImage, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/virtualmachineinstance.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/virtualmachineinstance.go new file mode 100644 index 00000000..80f22a57 --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/virtualmachineinstance.go @@ -0,0 +1,66 @@ +package fakeclients + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + kubevirtv1api "kubevirt.io/api/core/v1" + + kubevirtv1 "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/kubevirt.io/v1" + kubevirtctlv1 "github.com/harvester/harvester/pkg/generated/controllers/kubevirt.io/v1" +) + +type VirtualMachineInstanceClient func(string) kubevirtv1.VirtualMachineInstanceInterface + +func (c VirtualMachineInstanceClient) Update(vmi *kubevirtv1api.VirtualMachineInstance) (*kubevirtv1api.VirtualMachineInstance, error) { + return c(vmi.Namespace).Update(context.TODO(), vmi, metav1.UpdateOptions{}) +} + +func (c VirtualMachineInstanceClient) Get(namespace, name string, options metav1.GetOptions) (*kubevirtv1api.VirtualMachineInstance, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c VirtualMachineInstanceClient) Create(vmi *kubevirtv1api.VirtualMachineInstance) (*kubevirtv1api.VirtualMachineInstance, error) { + return c(vmi.Namespace).Create(context.TODO(), vmi, metav1.CreateOptions{}) +} + +func (c VirtualMachineInstanceClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + panic("implement me") +} + +func (c VirtualMachineInstanceClient) List(namespace string, opts metav1.ListOptions) (*kubevirtv1api.VirtualMachineInstanceList, error) { + panic("implement me") +} + +func (c VirtualMachineInstanceClient) UpdateStatus(*kubevirtv1api.VirtualMachineInstance) (*kubevirtv1api.VirtualMachineInstance, error) { + panic("implement me") +} + +func (c VirtualMachineInstanceClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + panic("implement me") +} + +func (c VirtualMachineInstanceClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *kubevirtv1api.VirtualMachineInstance, err error) { + panic("implement me") +} + +type VirtualMachineInstanceCache func(string) kubevirtv1.VirtualMachineInstanceInterface + +func (c VirtualMachineInstanceCache) Get(namespace, name string) (*kubevirtv1api.VirtualMachineInstance, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c VirtualMachineInstanceCache) List(namespace string, selector labels.Selector) ([]*kubevirtv1api.VirtualMachineInstance, error) { + panic("implement me") +} + +func (c VirtualMachineInstanceCache) AddIndexer(indexName string, indexer kubevirtctlv1.VirtualMachineInstanceIndexer) { + panic("implement me") +} + +func (c VirtualMachineInstanceCache) GetByIndex(indexName, key string) ([]*kubevirtv1api.VirtualMachineInstance, error) { + panic("implement me") +} diff --git a/vendor/github.com/harvester/harvester/pkg/util/fakeclients/vmbackup.go b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/vmbackup.go new file mode 100644 index 00000000..84c5464e --- /dev/null +++ b/vendor/github.com/harvester/harvester/pkg/util/fakeclients/vmbackup.go @@ -0,0 +1,84 @@ +package fakeclients + +import ( + "context" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/apimachinery/pkg/types" + "k8s.io/apimachinery/pkg/watch" + + harvesterv1beta1 "github.com/harvester/harvester/pkg/apis/harvesterhci.io/v1beta1" + harvestertype "github.com/harvester/harvester/pkg/generated/clientset/versioned/typed/harvesterhci.io/v1beta1" + harvesterv1ctl "github.com/harvester/harvester/pkg/generated/controllers/harvesterhci.io/v1beta1" + "github.com/harvester/harvester/pkg/indexeres" + "github.com/harvester/harvester/pkg/ref" +) + +type VMBackupClient func(string) harvestertype.VirtualMachineBackupInterface + +func (c VMBackupClient) Create(vmBackup *harvesterv1beta1.VirtualMachineBackup) (*harvesterv1beta1.VirtualMachineBackup, error) { + return c(vmBackup.Namespace).Create(context.TODO(), vmBackup, metav1.CreateOptions{}) +} + +func (c VMBackupClient) Update(volume *harvesterv1beta1.VirtualMachineBackup) (*harvesterv1beta1.VirtualMachineBackup, error) { + return c(volume.Namespace).Update(context.TODO(), volume, metav1.UpdateOptions{}) +} + +func (c VMBackupClient) UpdateStatus(volume *harvesterv1beta1.VirtualMachineBackup) (*harvesterv1beta1.VirtualMachineBackup, error) { + panic("implement me") +} + +func (c VMBackupClient) Delete(namespace, name string, options *metav1.DeleteOptions) error { + return c(namespace).Delete(context.TODO(), name, *options) +} + +func (c VMBackupClient) Get(namespace, name string, options metav1.GetOptions) (*harvesterv1beta1.VirtualMachineBackup, error) { + return c(namespace).Get(context.TODO(), name, options) +} + +func (c VMBackupClient) List(namespace string, opts metav1.ListOptions) (*harvesterv1beta1.VirtualMachineBackupList, error) { + return c(namespace).List(context.TODO(), opts) +} + +func (c VMBackupClient) Watch(namespace string, opts metav1.ListOptions) (watch.Interface, error) { + return c(namespace).Watch(context.TODO(), opts) +} + +func (c VMBackupClient) Patch(namespace, name string, pt types.PatchType, data []byte, subresources ...string) (result *harvesterv1beta1.VirtualMachineBackup, err error) { + return c(namespace).Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) +} + +type VMBackupCache func(string) harvestertype.VirtualMachineBackupInterface + +func (c VMBackupCache) Get(namespace, name string) (*harvesterv1beta1.VirtualMachineBackup, error) { + return c(namespace).Get(context.TODO(), name, metav1.GetOptions{}) +} + +func (c VMBackupCache) List(namespace string, selector labels.Selector) ([]*harvesterv1beta1.VirtualMachineBackup, error) { + panic("implement me") +} + +func (c VMBackupCache) AddIndexer(indexName string, indexer harvesterv1ctl.VirtualMachineBackupIndexer) { + panic("implement me") +} + +func (c VMBackupCache) GetByIndex(indexName, key string) ([]*harvesterv1beta1.VirtualMachineBackup, error) { + switch indexName { + case indexeres.VMBackupBySourceVMNameIndex: + vmNamespace, _ := ref.Parse(key) + backupList, err := c(vmNamespace).List(context.TODO(), metav1.ListOptions{}) + if err != nil { + return nil, err + } + var backups []*harvesterv1beta1.VirtualMachineBackup + for _, b := range backupList.Items { + if b.Spec.Source.Name == key { + backups = append(backups, &b) + } + } + return backups, nil + default: + return nil, nil + } +} diff --git a/vendor/github.com/harvester/harvester/tests/framework/fuzz/file.go b/vendor/github.com/harvester/harvester/tests/framework/fuzz/file.go new file mode 100644 index 00000000..877f09a6 --- /dev/null +++ b/vendor/github.com/harvester/harvester/tests/framework/fuzz/file.go @@ -0,0 +1,43 @@ +package fuzz + +import ( + "crypto/rand" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "io/ioutil" + "os" +) + +type FileByteSize int64 + +const ( + B FileByteSize = 1 << (10 * iota) + KB + MB + GB +) + +// File tries to create a file with given size and returns the path and the SHA256 checksum or error. +func File(size FileByteSize) (path string, checksum string, berr error) { + tempFile, err := ioutil.TempFile("", "rand-") + if err != nil { + return "", "", fmt.Errorf("failed to create temp file: %w", err) + } + defer func() { + _ = tempFile.Close() + if berr != nil { + _ = os.Remove(tempFile.Name()) + } + }() + + sha256Hasher := sha256.New() + + _, err = io.CopyN(io.MultiWriter(tempFile, sha256Hasher), rand.Reader, int64(size)) + if err != nil { + return "", "", fmt.Errorf("failed to create random file: %w", err) + } + + return tempFile.Name(), hex.EncodeToString(sha256Hasher.Sum(nil)), nil +} diff --git a/vendor/github.com/harvester/harvester/tests/framework/fuzz/port.go b/vendor/github.com/harvester/harvester/tests/framework/fuzz/port.go new file mode 100644 index 00000000..221b60a7 --- /dev/null +++ b/vendor/github.com/harvester/harvester/tests/framework/fuzz/port.go @@ -0,0 +1,34 @@ +package fuzz + +import ( + "errors" + "fmt" + "net" + + "k8s.io/apimachinery/pkg/util/sets" +) + +// FreePorts tries to find the free ports and returns them or error. +func FreePorts(amount int) ([]int, error) { + set := sets.NewInt() + + for { + if set.Len() >= amount { + break + } + lis, err := net.Listen("tcp", ":0") + if err != nil { + return nil, fmt.Errorf("failed to get free ports, %v", err) + } + + addr, ok := lis.Addr().(*net.TCPAddr) + if !ok { + _ = lis.Close() + return nil, errors.New("failed to get a TCP address") + } + set.Insert(addr.Port) + _ = lis.Close() + } + + return set.List(), nil +} diff --git a/vendor/github.com/harvester/harvester/tests/framework/fuzz/string.go b/vendor/github.com/harvester/harvester/tests/framework/fuzz/string.go new file mode 100644 index 00000000..336804e2 --- /dev/null +++ b/vendor/github.com/harvester/harvester/tests/framework/fuzz/string.go @@ -0,0 +1,10 @@ +package fuzz + +import ( + "k8s.io/apimachinery/pkg/util/rand" +) + +// String returns a random string with given size. +func String(size int) string { + return rand.String(size) +} diff --git a/vendor/github.com/pmezard/go-difflib/LICENSE b/vendor/github.com/pmezard/go-difflib/LICENSE new file mode 100644 index 00000000..c67dad61 --- /dev/null +++ b/vendor/github.com/pmezard/go-difflib/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2013, Patrick Mezard +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + The names of its contributors may not be used to endorse or promote +products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED +TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/pmezard/go-difflib/difflib/difflib.go b/vendor/github.com/pmezard/go-difflib/difflib/difflib.go new file mode 100644 index 00000000..003e99fa --- /dev/null +++ b/vendor/github.com/pmezard/go-difflib/difflib/difflib.go @@ -0,0 +1,772 @@ +// Package difflib is a partial port of Python difflib module. +// +// It provides tools to compare sequences of strings and generate textual diffs. +// +// The following class and functions have been ported: +// +// - SequenceMatcher +// +// - unified_diff +// +// - context_diff +// +// Getting unified diffs was the main goal of the port. Keep in mind this code +// is mostly suitable to output text differences in a human friendly way, there +// are no guarantees generated diffs are consumable by patch(1). +package difflib + +import ( + "bufio" + "bytes" + "fmt" + "io" + "strings" +) + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} + +func calculateRatio(matches, length int) float64 { + if length > 0 { + return 2.0 * float64(matches) / float64(length) + } + return 1.0 +} + +type Match struct { + A int + B int + Size int +} + +type OpCode struct { + Tag byte + I1 int + I2 int + J1 int + J2 int +} + +// SequenceMatcher compares sequence of strings. The basic +// algorithm predates, and is a little fancier than, an algorithm +// published in the late 1980's by Ratcliff and Obershelp under the +// hyperbolic name "gestalt pattern matching". The basic idea is to find +// the longest contiguous matching subsequence that contains no "junk" +// elements (R-O doesn't address junk). The same idea is then applied +// recursively to the pieces of the sequences to the left and to the right +// of the matching subsequence. This does not yield minimal edit +// sequences, but does tend to yield matches that "look right" to people. +// +// SequenceMatcher tries to compute a "human-friendly diff" between two +// sequences. Unlike e.g. UNIX(tm) diff, the fundamental notion is the +// longest *contiguous* & junk-free matching subsequence. That's what +// catches peoples' eyes. The Windows(tm) windiff has another interesting +// notion, pairing up elements that appear uniquely in each sequence. +// That, and the method here, appear to yield more intuitive difference +// reports than does diff. This method appears to be the least vulnerable +// to synching up on blocks of "junk lines", though (like blank lines in +// ordinary text files, or maybe "
" lines in HTML files). That may be
+// because this is the only method of the 3 that has a *concept* of
+// "junk"