-
Notifications
You must be signed in to change notification settings - Fork 30
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 <jian.wang@suse.com>
- Loading branch information
1 parent
45e1d33
commit d5fd96c
Showing
381 changed files
with
55,324 additions
and
27 deletions.
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
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
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,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") | ||
} |
Oops, something went wrong.