mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-08-23 22:26:49 +00:00
* Move addon api to beta in registration Signed-off-by: Jian Qiu <jqiu@redhat.com> * Update conversion e2e tests Signed-off-by: Jian Qiu <jqiu@redhat.com> * Add addon v1beta1 to supported type in grpc Signed-off-by: Jian Qiu <jqiu@redhat.com> * Fix flaky e2e in addon conversion Signed-off-by: Jian Qiu <jqiu@redhat.com> * Set subject for registration configuration when it is not set Signed-off-by: Jian Qiu <jqiu@redhat.com> --------- Signed-off-by: Jian Qiu <jqiu@redhat.com>
37 lines
861 B
Go
37 lines
861 B
Go
package helpers
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
fakekube "k8s.io/client-go/kubernetes/fake"
|
|
)
|
|
|
|
// TODO: enhance the u-t in the future @xuezhaojun
|
|
func TestCreateBootStrapSelfSubjectAccessReviews(t *testing.T) {
|
|
kubeClient := fakekube.NewSimpleClientset()
|
|
ctx := context.TODO()
|
|
|
|
// Create sample selfSubjectAccessReviews
|
|
bootstrapSSARs := GetBootstrapSSARs()
|
|
|
|
// Call the function under test
|
|
_, _, err := CreateSelfSubjectAccessReviews(ctx, kubeClient, bootstrapSSARs)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
}
|
|
|
|
func TestCreateHubConfigpSelfSubjectAccessReviews(t *testing.T) {
|
|
kubeClient := fakekube.NewSimpleClientset()
|
|
ctx := context.TODO()
|
|
|
|
// Create sample selfSubjectAccessReviews
|
|
hubConfigSSARs := GetHubConfigSSARs("test-cluster")
|
|
|
|
_, _, err := CreateSelfSubjectAccessReviews(ctx, kubeClient, hubConfigSSARs)
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
}
|