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


Golang core.NewRootPatchAction函數代碼示例

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


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

示例1: Patch

// Patch applies the patch and returns the patched clusterRoleBinding.
func (c *FakeClusterRoleBindings) Patch(name string, pt api.PatchType, data []byte) (result *rbac.ClusterRoleBinding, err error) {
	obj, err := c.Fake.
		Invokes(core.NewRootPatchAction(clusterrolebindingsResource, name, data), &rbac.ClusterRoleBinding{})
	if obj == nil {
		return nil, err
	}
	return obj.(*rbac.ClusterRoleBinding), err
}
開發者ID:cesardraw2,項目名稱:kubernetes,代碼行數:9,代碼來源:fake_clusterrolebinding.go

示例2: Patch

// Patch applies the patch and returns the patched cluster.
func (c *FakeClusters) Patch(name string, pt api.PatchType, data []byte) (result *v1alpha1.Cluster, err error) {
	obj, err := c.Fake.
		Invokes(core.NewRootPatchAction(clustersResource, name, data), &v1alpha1.Cluster{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1alpha1.Cluster), err
}
開發者ID:shmurata,項目名稱:kubernetes,代碼行數:9,代碼來源:fake_cluster.go

示例3: Patch

// Patch applies the patch and returns the patched node.
func (c *FakeNodes) Patch(name string, pt api.PatchType, data []byte) (result *v1.Node, err error) {
	obj, err := c.Fake.
		Invokes(core.NewRootPatchAction(nodesResource, name, data), &v1.Node{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1.Node), err
}
開發者ID:CodeJuan,項目名稱:kubernetes,代碼行數:9,代碼來源:fake_node.go

示例4: Patch

// Patch applies the patch and returns the patched componentStatus.
func (c *FakeComponentStatuses) Patch(name string, pt api.PatchType, data []byte) (result *v1.ComponentStatus, err error) {
	obj, err := c.Fake.
		Invokes(core.NewRootPatchAction(componentstatusesResource, name, data), &v1.ComponentStatus{})
	if obj == nil {
		return nil, err
	}
	return obj.(*v1.ComponentStatus), err
}
開發者ID:CodeJuan,項目名稱:kubernetes,代碼行數:9,代碼來源:fake_componentstatus.go

示例5: Patch

// Patch applies the patch and returns the patched thirdPartyResource.
func (c *FakeThirdPartyResources) Patch(name string, pt api.PatchType, data []byte) (result *extensions.ThirdPartyResource, err error) {
	obj, err := c.Fake.
		Invokes(core.NewRootPatchAction(thirdpartyresourcesResource, name, data), &extensions.ThirdPartyResource{})
	if obj == nil {
		return nil, err
	}
	return obj.(*extensions.ThirdPartyResource), err
}
開發者ID:XbinZh,項目名稱:kubernetes,代碼行數:9,代碼來源:fake_thirdpartyresource.go

示例6: Patch

// Patch applies the patch and returns the patched podSecurityPolicy.
func (c *FakePodSecurityPolicies) Patch(name string, pt api.PatchType, data []byte) (result *extensions.PodSecurityPolicy, err error) {
	obj, err := c.Fake.
		Invokes(core.NewRootPatchAction(podsecuritypoliciesResource, name, data), &extensions.PodSecurityPolicy{})
	if obj == nil {
		return nil, err
	}
	return obj.(*extensions.PodSecurityPolicy), err
}
開發者ID:XbinZh,項目名稱:kubernetes,代碼行數:9,代碼來源:fake_podsecuritypolicy.go

示例7: Patch

// Patch applies the patch and returns the patched certificateSigningRequest.
func (c *FakeCertificateSigningRequests) Patch(name string, pt api.PatchType, data []byte) (result *certificates.CertificateSigningRequest, err error) {
	obj, err := c.Fake.
		Invokes(core.NewRootPatchAction(certificatesigningrequestsResource, name, data), &certificates.CertificateSigningRequest{})
	if obj == nil {
		return nil, err
	}
	return obj.(*certificates.CertificateSigningRequest), err
}
開發者ID:cesardraw2,項目名稱:kubernetes,代碼行數:9,代碼來源:fake_certificatesigningrequest.go

示例8: Patch

// Patch applies the patch and returns the patched persistentVolume.
func (c *FakePersistentVolumes) Patch(name string, pt api.PatchType, data []byte) (result *api.PersistentVolume, err error) {
	obj, err := c.Fake.
		Invokes(core.NewRootPatchAction(persistentvolumesResource, name, data), &api.PersistentVolume{})
	if obj == nil {
		return nil, err
	}
	return obj.(*api.PersistentVolume), err
}
開發者ID:XbinZh,項目名稱:kubernetes,代碼行數:9,代碼來源:fake_persistentvolume.go

示例9: Patch

// Patch patches an existing event. Returns the copy of the event the server returns, or an error.
func (c *FakeEvents) Patch(event *v1.Event, data []byte) (*v1.Event, error) {
	action := core.NewRootPatchAction(eventsResource, event)
	if c.ns != "" {
		action = core.NewPatchAction(eventsResource, c.ns, event)
	}
	obj, err := c.Fake.Invokes(action, event)
	if obj == nil {
		return nil, err
	}

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


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