Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 57 for nowFunc (1 sec)

  1. pkg/registry/core/persistentvolume/strategy_test.go

    	)
    }
    
    func TestStatusUpdate(t *testing.T) {
    	now := metav1.Now()
    	origin := metav1.NewTime(now.Add(time.Hour))
    	later := metav1.NewTime(now.Add(time.Hour * 2))
    	NowFunc = func() metav1.Time { return now }
    	defer func() {
    		NowFunc = metav1.Now
    	}()
    	tests := []struct {
    		name        string
    		fg          bool
    		oldObj      *api.PersistentVolume
    		newObj      *api.PersistentVolume
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 11K bytes
    - Viewed (0)
  2. callbacks/update.go

    								if field.AutoUpdateTime == schema.UnixNanosecond {
    									value = stmt.DB.NowFunc().UnixNano()
    								} else if field.AutoUpdateTime == schema.UnixMillisecond {
    									value = stmt.DB.NowFunc().UnixMilli()
    								} else if field.AutoUpdateTime == schema.UnixSecond {
    									value = stmt.DB.NowFunc().Unix()
    								} else {
    									value = stmt.DB.NowFunc()
    								}
    								isZero = false
    							}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Mar 18 05:44:55 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  3. pkg/kubelet/nodestatus/setters.go

    func MemoryPressureCondition(nowFunc func() time.Time, // typically Kubelet.clock.Now
    	pressureFunc func() bool, // typically Kubelet.evictionManager.IsUnderMemoryPressure
    	recordEventFunc func(eventType, event string), // typically Kubelet.recordNodeStatusEvent
    ) Setter {
    	return func(ctx context.Context, node *v1.Node) error {
    		currentTime := metav1.NewTime(nowFunc())
    		var condition *v1.NodeCondition
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 12:12:04 UTC 2024
    - 30.5K bytes
    - Viewed (0)
  4. callbacks/create_test.go

    			Email: "email",
    			Age:   18,
    		},
    		{
    			ID:    2,
    			Name:  "bob",
    			Email: "email",
    			Age:   19,
    		},
    	}
    	stmt := &gorm.Statement{
    		DB: &gorm.DB{
    			Config: &gorm.Config{
    				NowFunc: func() time.Time { return time.Time{} },
    			},
    			Statement: &gorm.Statement{
    				Settings: sync.Map{},
    				Schema:   s,
    			},
    		},
    		ReflectValue: reflect.ValueOf(dest),
    		Dest:         dest,
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Mar 18 05:48:42 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  5. pkg/registry/certificates/certificates/strategy_test.go

    			}
    		})
    	}
    }
    
    func TestStatusUpdate(t *testing.T) {
    	now := metav1.Now()
    	later := metav1.NewTime(now.Add(time.Hour))
    	nowFunc = func() metav1.Time { return now }
    	defer func() {
    		nowFunc = metav1.Now
    	}()
    
    	tests := []struct {
    		name        string
    		newObj      *certapi.CertificateSigningRequest
    		oldObj      *certapi.CertificateSigningRequest
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 15 14:34:53 UTC 2024
    - 7.6K bytes
    - Viewed (0)
  6. pkg/kubelet/nodestatus/setters_test.go

    				"Diff: %s", cmp.Diff(expectNode, node))
    		})
    	}
    
    }
    
    func TestReadyCondition(t *testing.T) {
    	now := time.Now()
    	before := now.Add(-time.Second)
    	nowFunc := func() time.Time { return now }
    
    	withCapacity := &v1.Node{
    		Status: v1.NodeStatus{
    			Capacity: v1.ResourceList{
    				v1.ResourceCPU:              *resource.NewMilliQuantity(2000, resource.DecimalSI),
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 25 21:47:24 UTC 2024
    - 76.1K bytes
    - Viewed (0)
  7. pkg/registry/core/persistentvolume/storage/storage_test.go

    	hostPathType := new(api.HostPathType)
    	*hostPathType = api.HostPathType(pathType)
    	return hostPathType
    }
    
    func validNewPersistentVolume(name string) *api.PersistentVolume {
    	now := persistentvolume.NowFunc()
    	pv := &api.PersistentVolume{
    		ObjectMeta: metav1.ObjectMeta{
    			Name: name,
    		},
    		Spec: api.PersistentVolumeSpec{
    			Capacity: api.ResourceList{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  8. src/database/sql/sql.go

    //
    // Do not remove or change the type signature.
    // See go.dev/issue/67401.
    //
    //go:linkname drivers
    var drivers = make(map[string]driver.Driver)
    
    // nowFunc returns the current time; it's overridden in tests.
    var nowFunc = time.Now
    
    // Register makes a database driver available by the provided name.
    // If Register is called twice with the same name or if driver is nil,
    // it panics.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:53 UTC 2024
    - 103.6K bytes
    - Viewed (0)
  9. callbacks/create.go

    				}
    			}
    			return called
    		})
    	}
    }
    
    // ConvertToCreateValues convert to create values
    func ConvertToCreateValues(stmt *gorm.Statement) (values clause.Values) {
    	curTime := stmt.DB.NowFunc()
    
    	switch value := stmt.Dest.(type) {
    	case map[string]interface{}:
    		values = ConvertMapToValuesForCreate(stmt, value)
    	case *map[string]interface{}:
    		values = ConvertMapToValuesForCreate(stmt, *value)
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 08 03:29:55 UTC 2024
    - 12.5K bytes
    - Viewed (0)
  10. src/database/sql/sql_test.go

    		t.Errorf("stats.OpenConnections = %d; want 0", got)
    	}
    }
    
    func TestConnMaxLifetime(t *testing.T) {
    	t0 := time.Unix(1000000, 0)
    	offset := time.Duration(0)
    
    	nowFunc = func() time.Time { return t0.Add(offset) }
    	defer func() { nowFunc = time.Now }()
    
    	db := newTestDB(t, "magicquery")
    	defer closeDB(t, db)
    
    	driver := db.Driver().(*fakeDriver)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 111.6K bytes
    - Viewed (0)
Back to top