當前位置: 首頁>>代碼示例>>Golang>>正文


Golang testing.NewRootCreateAction函數代碼示例

本文整理匯總了Golang中k8s/io/client-go/testing.NewRootCreateAction函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewRootCreateAction函數的具體用法?Golang NewRootCreateAction怎麽用?Golang NewRootCreateAction使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了NewRootCreateAction函數的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: Create

func (c *FakeCertificateSigningRequests) Create(certificateSigningRequest *v1alpha1.CertificateSigningRequest) (result *v1alpha1.CertificateSigningRequest, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(certificatesigningrequestsResource, certificateSigningRequest), &v1alpha1.CertificateSigningRequest{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.CertificateSigningRequest), err
}
開發者ID:alex-mohr,項目名稱:kubernetes,代碼行數:8,代碼來源:fake_certificatesigningrequest.go

示例2: Create

func (c *FakeNamespaces) Create(namespace *v1.Namespace) (result *v1.Namespace, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(namespacesResource, namespace), &v1.Namespace{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1.Namespace), err
}
開發者ID:alex-mohr,項目名稱:kubernetes,代碼行數:8,代碼來源:fake_namespace.go

示例3: Create

func (c *FakePodSecurityPolicies) Create(podSecurityPolicy *v1beta1.PodSecurityPolicy) (result *v1beta1.PodSecurityPolicy, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(podsecuritypoliciesResource, podSecurityPolicy), &v1beta1.PodSecurityPolicy{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.PodSecurityPolicy), err
}
開發者ID:alex-mohr,項目名稱:kubernetes,代碼行數:8,代碼來源:fake_podsecuritypolicy.go

示例4: Create

func (c *FakeClusterRoleBindings) Create(clusterRoleBinding *v1alpha1.ClusterRoleBinding) (result *v1alpha1.ClusterRoleBinding, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(clusterrolebindingsResource, clusterRoleBinding), &v1alpha1.ClusterRoleBinding{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.ClusterRoleBinding), err
}
開發者ID:maisem,項目名稱:kubernetes,代碼行數:8,代碼來源:fake_clusterrolebinding.go

示例5: Create

func (c *FakePersistentVolumes) Create(persistentVolume *v1.PersistentVolume) (result *v1.PersistentVolume, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(persistentvolumesResource, persistentVolume), &v1.PersistentVolume{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1.PersistentVolume), err
}
開發者ID:maisem,項目名稱:kubernetes,代碼行數:8,代碼來源:fake_persistentvolume.go

示例6: Create

func (c *FakeComponentStatuses) Create(componentStatus *v1.ComponentStatus) (result *v1.ComponentStatus, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(componentstatusesResource, componentStatus), &v1.ComponentStatus{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1.ComponentStatus), err
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:8,代碼來源:fake_componentstatus.go

示例7: Create

func (c *FakeStorageClasses) Create(storageClass *v1beta1.StorageClass) (result *v1beta1.StorageClass, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(storageclassesResource, storageClass), &v1beta1.StorageClass{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.StorageClass), err
}
開發者ID:maisem,項目名稱:kubernetes,代碼行數:8,代碼來源:fake_storageclass.go

示例8: Create

func (c *FakeClusterRoles) Create(clusterRole *v1beta1.ClusterRole) (result *v1beta1.ClusterRole, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(clusterrolesResource, clusterRole), &v1beta1.ClusterRole{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.ClusterRole), err
}
開發者ID:kubernetes,項目名稱:kubernetes,代碼行數:8,代碼來源:fake_clusterrole.go

示例9: Create

func (c *FakeThirdPartyResources) Create(thirdPartyResource *v1beta1.ThirdPartyResource) (result *v1beta1.ThirdPartyResource, err error) {
	obj, err := c.Fake.
		Invokes(testing.NewRootCreateAction(thirdpartyresourcesResource, thirdPartyResource), &v1beta1.ThirdPartyResource{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1beta1.ThirdPartyResource), err
}
開發者ID:maisem,項目名稱:kubernetes,代碼行數:8,代碼來源:fake_thirdpartyresource.go

示例10: CreateWithEventNamespace

func (c *FakeEvents) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) {
	action := testing.NewRootCreateAction(eventsResource, event)
	if c.ns != "" {
		action = testing.NewCreateAction(eventsResource, c.ns, event)
	}
	obj, err := c.Fake.Invokes(action, event)
	if obj == nil {
		return nil, err
	}

	return obj.(*v1.Event), err
}
開發者ID:eljefedelrodeodeljefe,項目名稱:kubernetes,代碼行數:12,代碼來源:fake_event_expansion.go

示例11: Create

func (c *FakeSubjectAccessReviews) Create(sar *authorizationapi.SubjectAccessReview) (result *authorizationapi.SubjectAccessReview, err error) {
	obj, err := c.Fake.Invokes(testing.NewRootCreateAction(authorizationapi.SchemeGroupVersion.WithResource("subjectaccessreviews"), sar), &authorizationapi.SubjectAccessReview{})
	return obj.(*authorizationapi.SubjectAccessReview), err
}
開發者ID:maisem,項目名稱:kubernetes,代碼行數:4,代碼來源:fake_subjectaccessreview_expansion.go

示例12: Create

func (c *FakeTokenReviews) Create(tokenReview *authenticationapi.TokenReview) (result *authenticationapi.TokenReview, err error) {
	obj, err := c.Fake.Invokes(testing.NewRootCreateAction(authenticationapi.SchemeGroupVersion.WithResource("tokenreviews"), tokenReview), &authenticationapi.TokenReview{})
	return obj.(*authenticationapi.TokenReview), err
}
開發者ID:Q-Lee,項目名稱:kubernetes,代碼行數:4,代碼來源:fake_tokenreview_expansion.go


注:本文中的k8s/io/client-go/testing.NewRootCreateAction函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。