Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 144 for upsert (0.3 sec)

  1. tests/upsert_test.go

    	} else {
    		var user3 User
    		DB.First(&user3, user.ID)
    		if user3.UpdatedAt.UnixNano() == user2.UpdatedAt.UnixNano() {
    			t.Fatalf("failed to update user's updated_at, old: %v, new: %v", user2.UpdatedAt, user3.UpdatedAt)
    		}
    	}
    }
    
    func TestUpsertSlice(t *testing.T) {
    	langs := []Language{
    		{Code: "upsert-slice1", Name: "Upsert-slice1"},
    		{Code: "upsert-slice2", Name: "Upsert-slice2"},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  2. operator/cmd/mesh/manifest_shared_test.go

    var interceptorFunc = interceptor.Funcs{Patch: func(
    	ctx context.Context,
    	clnt client.WithWatch,
    	obj client.Object,
    	patch client.Patch,
    	opts ...client.PatchOption,
    ) error {
    	// Apply patches are supposed to upsert, but fake client fails if the object doesn't exist,
    	// if an apply patch occurs for an object that doesn't yet exist, create it.
    	if patch.Type() != types.ApplyPatchType {
    		return clnt.Patch(ctx, obj, patch, opts...)
    	}
    Go
    - Registered: Wed Mar 20 22:53:08 GMT 2024
    - Last Modified: Tue Feb 20 22:39:28 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  3. cmd/admin-handlers-users_test.go

    	if err != nil {
    		c.Fatalf("group desc err: %v", err)
    	}
    	c.Assert(groupInfo.Name, group)
    	c.Assert(set.CreateStringSet(groupInfo.Members...), set.CreateStringSet(accessKey))
    	c.Assert(groupInfo.Policy, policy)
    	c.Assert(groupInfo.Status, string(madmin.GroupEnabled))
    
    	// 5. Disable/enable the group and verify that user access is revoked/restored.
    	err = s.adm.SetGroupStatus(ctx, group, madmin.GroupDisabled)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 12 16:36:16 GMT 2024
    - 45.7K bytes
    - Viewed (0)
  4. cmd/admin-handlers-users-race_test.go

    				if err != nil {
    					return err
    				}
    				c.mustNotListObjects(ctx, uClient, bucket)
    				return nil
    			}
    		}(i), i)
    	}
    	if errs := g.Wait(); len(errs) > 0 {
    		c.Fatalf("unable to remove users: %v", errs)
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Sep 04 19:57:37 GMT 2023
    - 3.9K bytes
    - Viewed (0)
  5. cni/pkg/nodeagent/ztunnelserver_test.go

    	mt.Assert(ztunnelConnected.Name(), nil, monitortest.Exactly(1))
    
    	// we should get the fd to dev null. note that we can't assert the fd number
    	// as the kernel may have given us a different number that refers to the same file.
    	assert.Equal(t, len(fds), 1)
    	// in theory we should close the fd, but it's just a test..
    
    	assert.Equal(t, m.Payload.(*zdsapi.WorkloadRequest_Add).Add.Uid, uid)
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 8.6K bytes
    - Viewed (0)
  6. cni/pkg/util/podutil_test.go

    	"istio.io/istio/pkg/test/util/assert"
    )
    
    func TestGetPodIPIfPodIPPresent(t *testing.T) {
    	pod := &corev1.Pod{
    		ObjectMeta: metav1.ObjectMeta{
    			Name:      "test",
    			Namespace: "test",
    		},
    		Spec: corev1.PodSpec{
    			NodeName: "derp",
    		},
    		Status: corev1.PodStatus{
    			PodIP: "11.1.1.12",
    		},
    	}
    
    	podIPs := GetPodIPsIfPresent(pod)
    	assert.Equal(t, len(podIPs), 1)
    }
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 1.7K bytes
    - Viewed (0)
  7. cni/pkg/ipset/nldeps_linux.go

    	err := netlink.IpsetFlush(name)
    	if err != nil {
    		return fmt.Errorf("failed to flush ipset %s: %w", name, err)
    	}
    	return nil
    }
    
    // Alpine and some distros struggles with this - ipset CLI utilities support this, but
    // the kernel can be out of sync with the CLI utility, leading to errors like:
    //
    // ipset v7.10: Argument `comment' is supported in the kernel module of the set type hash:ip
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Jan 26 20:34:28 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  8. istioctl/pkg/writer/ztunnel/configdump/configdump_test.go

    				}
    			} else if len(cw.ztunnelDump.Workloads) != tt.wantConfigs {
    				t.Errorf("wanted %v configs loaded in got %v", tt.wantConfigs, len(cw.ztunnelDump.Workloads))
    			}
    			if tt.wantErr {
    				assert.Error(t, err)
    			} else {
    				assert.NoError(t, err)
    			}
    		})
    	}
    }
    
    func TestConfigWriter_PrintSecretSummary(t *testing.T) {
    	tests := []struct {
    		name               string
    		wantOutputSecret   string
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Feb 02 18:21:48 GMT 2024
    - 3.6K bytes
    - Viewed (0)
  9. tests/sql_builder_test.go

    	if age != 20 {
    		t.Errorf("Scan with Row, age expects: %v, got %v", user2.Age, age)
    	}
    }
    
    func TestRows(t *testing.T) {
    	user1 := User{Name: "RowsUser1", Age: 1}
    	user2 := User{Name: "RowsUser2", Age: 10}
    	user3 := User{Name: "RowsUser3", Age: 20}
    	DB.Save(&user1).Save(&user2).Save(&user3)
    
    	rows, err := DB.Table("users").Where("name = ? or name = ?", user2.Name, user3.Name).Select("name, age").Rows()
    	if err != nil {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  10. istioctl/pkg/writer/pilot/status_test.go

    			input := map[string]*discovery.DiscoveryResponse{}
    			for key, ss := range tt.input {
    				input[key] = ss
    			}
    
    			err := sw.PrintAll(input)
    			if tt.wantErr {
    				assert.Error(t, err)
    			} else {
    				assert.NoError(t, err)
    			}
    			want, _ := os.ReadFile(tt.want)
    			if err := util.Compare(got.Bytes(), want); err != nil {
    				t.Errorf(err.Error())
    			}
    		})
    	}
    }
    
    Go
    - Registered: Wed Apr 24 22:53:08 GMT 2024
    - Last Modified: Fri Mar 08 08:38:19 GMT 2024
    - 6.5K bytes
    - Viewed (0)
Back to top