k8s/io/kubernetes/pkg/api/rest.Update 示例代码

2022-03-03

以下示例是关于golang中包含rest.Update用法的示例代码,想了解rest.Update的具体用法?rest.Update怎么用?rest.Update使用的例子?那么可以参考以下10个相关示例代码来学习它的具体使用方法。

示例1:
rest_test.go开发语言: Go项目名称: kubernetes代码行数: 601
522
523	c, _ = rest.Update(ctx, update)
524	updated_svc := <-c
示例2:
etcd.go开发语言: Go项目名称: kubernetes代码行数: 253
1/*
2Copyright 2014 Google Inc. All rights reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
示例3:
rest.go开发语言: Go项目名称: kubernetes代码行数: 153
1/*
2Copyright 2014 Google Inc. All rights reserved.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8    http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
示例4:
rest.go开发语言: Go项目名称: ddysher代码行数: 649
347
348func (rs *REST) Update(ctx genericapirequest.Context, name string, objInfo rest.UpdatedObjectInfo) (runtime.Object, bool, error) {
349	oldService, err := rs.registry.GetService(ctx, name, &metav1.GetOptions{})
示例5:
rest_test.go开发语言: Go项目名称: amygdala代码行数: 823
747
748	updated_svc, _, _ := rest.Update(ctx, update)
749	updated_service := updated_svc.(*api.Service)
766
767	_, _, err := rest.Update(ctx, update)
768	if err == nil || !errors.IsInvalid(err) {
800
801	_, _, err := rest.Update(ctx, update)
802	if err != nil {
示例6:
rest_test.go开发语言: Go项目名称: ashumeow代码行数: 660
519
520	c, _ = rest.Update(ctx, update)
521	updated_svc := <-c
533
534	c, _ = rest.Update(ctx, update)
535	result := <-c
573
574	_, err := rest.Update(ctx, update)
575	if err != nil {
示例7:
storage.go开发语言: Go项目名称: bparees代码行数: 318
109
110func (r *REST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
111	return r.store.Update(ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate, options)
302// Update alters the status subset of an object.
303func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
304	// We are explicitly setting forceAllowCreate to false in the call to the underlying storage because
313// Update alters the status finalizers subset of an object.
314func (r *FinalizeREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
315	// We are explicitly setting forceAllowCreate to false in the call to the underlying storage because
示例8:
rest.go开发语言: Go项目名称: bparees代码行数: 808
367
368func (rs *REST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
369	oldObj, err := rs.services.Get(ctx, name, &metav1.GetOptions{})
示例9:
storage.go开发语言: Go项目名称: byxorna代码行数: 318
109
110func (r *REST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
111	return r.store.Update(ctx, name, objInfo, createValidation, updateValidation, forceAllowCreate, options)
302// Update alters the status subset of an object.
303func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
304	// We are explicitly setting forceAllowCreate to false in the call to the underlying storage because
313// Update alters the status finalizers subset of an object.
314func (r *FinalizeREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
315	// We are explicitly setting forceAllowCreate to false in the call to the underlying storage because
示例10:
rest.go开发语言: Go项目名称: byxorna代码行数: 806
367
368func (rs *REST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error) {
369	oldObj, err := rs.services.Get(ctx, name, &metav1.GetOptions{})

本文地址:https://www.itbaoku.cn/snippets/415761.html