k8s/io/kubernetes/pkg/api/errors.IsMethodNotSupported 示例代码

2022-03-03

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

示例1:
namespaced_resources_deleter.go开发语言: Go项目名称: abhgupta代码行数: 582
360	// remember next time that this resource does not support delete collection...
361	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
362		glog.V(5).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
401	// remember next time that this resource does not support delete collection...
402	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
403		glog.V(5).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
426		opts := &metav1.DeleteOptions{PropagationPolicy: &background}
427		if err = dynamicClient.Resource(&apiResource, namespace).Delete(item.GetName(), opts); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) {
428			return err
示例2:
namespace_controller_utils.go开发语言: Go项目名称: amygdala代码行数: 480
169	// remember next time that this resource does not support delete collection...
170	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
171		glog.V(4).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
210	// remember next time that this resource does not support delete collection...
211	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
212		glog.V(4).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
237	for _, item := range unstructuredList.Items {
238		if err = dynamicClient.Resource(&apiResource, namespace).Delete(item.Name, nil); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) {
239			return err
示例3:
namespaced_resources_deleter.go开发语言: Go项目名称: ddysher代码行数: 578
356	// remember next time that this resource does not support delete collection...
357	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
358		glog.V(5).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
397	// remember next time that this resource does not support delete collection...
398	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
399		glog.V(5).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
422		opts := &metav1.DeleteOptions{PropagationPolicy: &background}
423		if err = dynamicClient.Resource(&apiResource, namespace).Delete(item.GetName(), opts); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) {
424			return err
示例4:
namespaced_resources_deleter.go开发语言: Go项目名称: detiber代码行数: 578
356	// remember next time that this resource does not support delete collection...
357	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
358		glog.V(5).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
397	// remember next time that this resource does not support delete collection...
398	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
399		glog.V(5).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
422		opts := &metav1.DeleteOptions{PropagationPolicy: &background}
423		if err = dynamicClient.Resource(&apiResource, namespace).Delete(item.GetName(), opts); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) {
424			return err
示例5:
namespaced_resources_deleter.go开发语言: Go项目名称: bparees代码行数: 613
333	// remember next time that this resource does not support delete collection...
334	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
335		klog.V(5).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
368	// remember next time that this resource does not support delete collection...
369	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
370		klog.V(5).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
391		opts := metav1.DeleteOptions{PropagationPolicy: &background}
392		if err = d.metadataClient.Resource(gvr).Namespace(namespace).Delete(context.TODO(), item.GetName(), opts); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) {
393			return err
示例6:
namespaced_resources_deleter.go开发语言: Go项目名称: byxorna代码行数: 613
333	// remember next time that this resource does not support delete collection...
334	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
335		klog.V(5).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
368	// remember next time that this resource does not support delete collection...
369	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
370		klog.V(5).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
391		opts := metav1.DeleteOptions{PropagationPolicy: &background}
392		if err = d.metadataClient.Resource(gvr).Namespace(namespace).Delete(context.TODO(), item.GetName(), opts); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) {
393			return err
示例7:
namespaced_resources_deleter.go开发语言: Go项目名称: csrwng代码行数: 567
358	// remember next time that this resource does not support delete collection...
359	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
360		klog.V(5).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
393	// remember next time that this resource does not support delete collection...
394	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
395		klog.V(5).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
416		opts := &metav1.DeleteOptions{PropagationPolicy: &background}
417		if err = d.metadataClient.Resource(gvr).Namespace(namespace).Delete(item.GetName(), opts); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) {
418			return err
示例8:
namespace_controller_utils.go开发语言: Go项目名称: cjcullen代码行数: 517
192	// remember next time that this resource does not support delete collection...
193	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
194		glog.V(5).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
237	// remember next time that this resource does not support delete collection...
238	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
239		glog.V(5).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
264	for _, item := range unstructuredList.Items {
265		if err = dynamicClient.Resource(&apiResource, namespace).Delete(item.GetName(), nil); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) {
266			return err
示例9:
namespace_controller_utils.go开发语言: Go项目名称: cloud-zuiwanyuan代码行数: 455
167	// remember next time that this resource does not support delete collection...
168	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
169		glog.V(5).Infof("namespace controller - deleteCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
212	// remember next time that this resource does not support delete collection...
213	if errors.IsMethodNotSupported(err) || errors.IsNotFound(err) {
214		glog.V(5).Infof("namespace controller - listCollection not supported - namespace: %s, gvr: %v", namespace, gvr)
239	for _, item := range unstructuredList.Items {
240		if err = dynamicClient.Resource(&apiResource, namespace).Delete(item.GetName(), nil); err != nil && !errors.IsNotFound(err) && !errors.IsMethodNotSupported(err) {
241			return err
示例10:
unjoin.go开发语言: Go项目名称: ddysher代码行数: 333
324	err := unjoiningClusterClientset.Rbac().ClusterRoleBindings().Delete(clusterRoleName, &metav1.DeleteOptions{})
325	if err != nil && !errors.IsMethodNotSupported(err) && !errors.IsNotFound(err) {
326		return err
328	err = unjoiningClusterClientset.Rbac().ClusterRoles().Delete(clusterRoleName, &metav1.DeleteOptions{})
329	if err != nil && !errors.IsMethodNotSupported(err) && !errors.IsNotFound(err) {
330		return err

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