Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 58 for IsAlreadyExists (0.31 sec)

  1. cmd/kubeadm/app/util/apiclient/idempotency.go

    		true, func(_ context.Context) (bool, error) {
    			ctx := context.Background()
    			if _, err := client.CoreV1().ConfigMaps(cm.ObjectMeta.Namespace).Create(ctx, cm, metav1.CreateOptions{}); err != nil {
    				if !apierrors.IsAlreadyExists(err) {
    					lastError = errors.Wrap(err, "unable to create ConfigMap")
    					return false, nil
    				}
    				if _, err := client.CoreV1().ConfigMaps(cm.ObjectMeta.Namespace).Update(ctx, cm, metav1.UpdateOptions{}); err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Feb 18 11:14:32 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  2. pkg/kubelet/pluginmanager/reconciler/reconciler.go

    			err := rc.operationExecutor.UnregisterPlugin(registeredPlugin, rc.actualStateOfWorld)
    			if err != nil &&
    				!goroutinemap.IsAlreadyExists(err) &&
    				!exponentialbackoff.IsExponentialBackoff(err) {
    				// Ignore goroutinemap.IsAlreadyExists and exponentialbackoff.IsExponentialBackoff errors, they are expected.
    				// Log all other errors.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Dec 18 04:27:38 UTC 2022
    - 6.2K bytes
    - Viewed (0)
  3. pkg/kube/kclient/helpers.go

    	kerrors "k8s.io/apimachinery/pkg/api/errors"
    
    	"istio.io/istio/pkg/kube/controllers"
    )
    
    func CreateOrUpdate[T controllers.Object](c Writer[T], object T) (T, error) {
    	res, err := c.Create(object)
    	if kerrors.IsAlreadyExists(err) {
    		// Already exist, update
    		return c.Update(object)
    	}
    	return res, err
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 06 16:02:24 UTC 2023
    - 919 bytes
    - Viewed (0)
  4. pkg/util/goroutinemap/goroutinemap_test.go

    	// Assert
    	if err2 == nil {
    		t.Fatalf("NewGoRoutine did not fail. Expected: <Failed to create operation with name \"%s\". An operation with that name already exists.> Actual: <no error>", operationName)
    	}
    	if !IsAlreadyExists(err2) {
    		t.Fatalf("NewGoRoutine did not return alreadyExistsError, got: %v", err2)
    	}
    }
    
    func Test_NewGoRoutineMap_Negative_SecondOpBeforeFirstCompletesWithExpBackoff(t *testing.T) {
    	// Arrange
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 11 14:09:48 UTC 2017
    - 14.9K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/api/errors/errors_test.go

    	b.Run("Nil", func(b *testing.B) {
    		for i := 0; i < b.N; i++ {
    			IsAlreadyExists(nil)
    		}
    	})
    
    	b.Run("Bare", func(b *testing.B) {
    		for i := 0; i < b.N; i++ {
    			IsAlreadyExists(err)
    		}
    	})
    
    	b.Run("Wrapped", func(b *testing.B) {
    		for i := 0; i < b.N; i++ {
    			IsAlreadyExists(wrapped)
    		}
    	})
    }
    
    func BenchmarkIsNotFoundWrappedErrors(b *testing.B) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Oct 28 07:31:28 UTC 2023
    - 19.5K bytes
    - Viewed (0)
  6. pkg/volume/util/nestedpendingoperations/nestedpendingoperations_test.go

    	// Assert
    	if err2 == nil {
    		t.Fatalf("NestedPendingOperations did not fail. Expected: <Failed to create operation with name \"%s\". An operation with that name already exists.> Actual: <no error>", volumeName)
    	}
    	if !IsAlreadyExists(err2) {
    		t.Fatalf("NestedPendingOperations did not return alreadyExistsError, got: %v", err2)
    	}
    }
    
    func Test_NestedPendingOperations_Negative_SecondThirdOpWithDifferentNames(t *testing.T) {
    	// Arrange
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Aug 26 01:29:17 UTC 2022
    - 36.1K bytes
    - Viewed (0)
  7. pkg/util/goroutinemap/goroutinemap.go

    func NewAlreadyExistsError(operationName string) error {
    	return alreadyExistsError{operationName}
    }
    
    // IsAlreadyExists returns true if an error returned from GoRoutineMap indicates
    // a new operation can not be started because an operation with the same
    // operation name is already executing.
    func IsAlreadyExists(err error) bool {
    	switch err.(type) {
    	case alreadyExistsError:
    		return true
    	default:
    		return false
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 16 11:54:27 UTC 2020
    - 6.8K bytes
    - Viewed (0)
  8. pkg/kube/kclient/clienttest/crd.go

    	if !ok {
    		return
    	}
    	obj := &metav1.PartialObjectMetadata{
    		TypeMeta:   crd.TypeMeta,
    		ObjectMeta: crd.ObjectMeta,
    	}
    	if _, err := fmd.CreateFake(obj, metav1.CreateOptions{}); err != nil {
    		if kerrors.IsAlreadyExists(err) {
    			_, err = fmd.UpdateFake(obj, metav1.UpdateOptions{})
    			if err != nil {
    				t.Fatal(err)
    			}
    		} else {
    			t.Fatal(err)
    		}
    	}
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Apr 25 14:44:17 UTC 2024
    - 2K bytes
    - Viewed (0)
  9. tests/integration/security/util/cert/cert.go

    				ca.RootCertFile:     rootCert,
    			},
    		}
    
    		if _, err := cluster.Kube().CoreV1().Secrets(systemNs.Name()).Create(context.TODO(), secret, metav1.CreateOptions{}); err != nil {
    			if errors.IsAlreadyExists(err) {
    				if _, err := cluster.Kube().CoreV1().Secrets(systemNs.Name()).Update(context.TODO(), secret, metav1.UpdateOptions{}); err != nil {
    					return err
    				}
    			} else {
    				return err
    			}
    		}
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Fri Dec 15 16:44:37 UTC 2023
    - 6.2K bytes
    - Viewed (0)
  10. pkg/registry/scheduling/rest/storage_scheduling.go

    				if err != nil {
    					if apierrors.IsNotFound(err) {
    						_, err := schedClientSet.PriorityClasses().Create(context.TODO(), pc, metav1.CreateOptions{})
    						if err == nil || apierrors.IsAlreadyExists(err) {
    							klog.Infof("created PriorityClass %s with value %v", pc.Name, pc.Value)
    							continue
    						}
    						// ServiceUnavailble error is returned when the API server is blocked by storage version updates
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 23 18:36:33 UTC 2022
    - 4.7K bytes
    - Viewed (0)
Back to top