-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jian Wang <[email protected]>
- Loading branch information
1 parent
1ae64ce
commit 5b393ff
Showing
377 changed files
with
54,923 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
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-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 ClusterNetworkClient func() networktype.ClusterNetworkInterface | ||
|
||
func (c ClusterNetworkClient) Create(s *v1beta1.ClusterNetwork) (*v1beta1.ClusterNetwork, error) { | ||
return c().Create(context.TODO(), s, metav1.CreateOptions{}) | ||
} | ||
|
||
func (c ClusterNetworkClient) Update(s *v1beta1.ClusterNetwork) (*v1beta1.ClusterNetwork, error) { | ||
return c().Update(context.TODO(), s, metav1.UpdateOptions{}) | ||
} | ||
|
||
func (c ClusterNetworkClient) UpdateStatus(_ *v1beta1.ClusterNetwork) (*v1beta1.ClusterNetwork, error) { | ||
panic("implement me") | ||
} | ||
|
||
func (c ClusterNetworkClient) Delete(name string, options *metav1.DeleteOptions) error { | ||
return c().Delete(context.TODO(), name, *options) | ||
} | ||
|
||
func (c ClusterNetworkClient) Get(name string, options metav1.GetOptions) (*v1beta1.ClusterNetwork, error) { | ||
return c().Get(context.TODO(), name, options) | ||
} | ||
|
||
func (c ClusterNetworkClient) List(opts metav1.ListOptions) (*v1beta1.ClusterNetworkList, error) { | ||
return c().List(context.TODO(), opts) | ||
} | ||
|
||
func (c ClusterNetworkClient) Watch(opts metav1.ListOptions) (watch.Interface, error) { | ||
return c().Watch(context.TODO(), opts) | ||
} | ||
|
||
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...) | ||
} | ||
|
||
type ClusterNetworkCache func() networktype.ClusterNetworkInterface | ||
|
||
func (c ClusterNetworkCache) Get(name string) (*v1beta1.ClusterNetwork, error) { | ||
return c().Get(context.TODO(), name, metav1.GetOptions{}) | ||
} | ||
|
||
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 ClusterNetworkCache) AddIndexer(_ string, _ networkctl.ClusterNetworkIndexer) { | ||
panic("implement me") | ||
} | ||
|
||
func (c ClusterNetworkCache) GetByIndex(_, _ string) ([]*v1beta1.ClusterNetwork, error) { | ||
panic("implement me") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
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-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 | ||
|
||
func (c VlanConfigClient) Create(s *v1beta1.VlanConfig) (*v1beta1.VlanConfig, error) { | ||
return c().Create(context.TODO(), s, metav1.CreateOptions{}) | ||
} | ||
|
||
func (c VlanConfigClient) Update(s *v1beta1.VlanConfig) (*v1beta1.VlanConfig, error) { | ||
return c().Update(context.TODO(), s, metav1.UpdateOptions{}) | ||
} | ||
|
||
func (c VlanConfigClient) UpdateStatus(_ *v1beta1.VlanConfig) (*v1beta1.VlanConfig, error) { | ||
panic("implement me") | ||
} | ||
|
||
func (c VlanConfigClient) 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) { | ||
return c().Get(context.TODO(), name, options) | ||
} | ||
|
||
func (c VlanConfigClient) List(opts metav1.ListOptions) (*v1beta1.VlanConfigList, error) { | ||
return c().List(context.TODO(), opts) | ||
} | ||
|
||
func (c VlanConfigClient) 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) { | ||
return c().Patch(context.TODO(), name, pt, data, metav1.PatchOptions{}, subresources...) | ||
} | ||
|
||
type VlanConfigCache func() networktype.VlanConfigInterface | ||
|
||
func (c VlanConfigCache) Get(name string) (*v1beta1.VlanConfig, error) { | ||
return c().Get(context.TODO(), name, metav1.GetOptions{}) | ||
} | ||
|
||
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, _ networkctl.VlanConfigIndexer) { | ||
panic("implement me") | ||
} | ||
|
||
func (c VlanConfigCache) GetByIndex(_, _ string) ([]*v1beta1.VlanConfig, error) { | ||
panic("implement me") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
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-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...) | ||
} | ||
|
||
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") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.