Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 144 for nowFunc (0.26 sec)

  1. pkg/controller/certificates/authority/authority_test.go

    			want: x509.Certificate{
    				NotBefore:             now,
    				NotAfter:              now.Add(1 * time.Hour),
    				BasicConstraintsValid: true,
    				KeyUsage:              x509.KeyUsageDigitalSignature,
    			},
    		},
    		{
    			name:   "ext key usage",
    			policy: PermissiveSigningPolicy{TTL: time.Hour, Usages: []capi.KeyUsage{"client auth"}, Now: nowFunc},
    			want: x509.Certificate{
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 23 19:36:11 UTC 2021
    - 7.3K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/metrics/timing_ratio_histogram.go

    	ratioedOpts := opts.TimingHistogramOpts
    	ratioedOpts.InitialValue /= opts.InitialDenominator
    	th := compbasemetrics.NewTestableTimingHistogram(nowFunc, &ratioedOpts)
    	return &TimingRatioHistogram{
    		Registerable: th,
    		timingRatioHistogramInner: timingRatioHistogramInner{
    			nowFunc:         nowFunc,
    			getGaugeOfRatio: func() Gauge { return th },
    			numerator:       opts.InitialValue,
    			denominator:     opts.InitialDenominator,
    		}}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 03 06:51:04 UTC 2023
    - 8.6K bytes
    - Viewed (0)
  3. gorm.go

    	}
    
    	if config.QueryFields {
    		tx.Config.QueryFields = true
    	}
    
    	if config.Logger != nil {
    		tx.Config.Logger = config.Logger
    	}
    
    	if config.NowFunc != nil {
    		tx.Config.NowFunc = config.NowFunc
    	}
    
    	if config.Initialized {
    		tx = tx.getInstance()
    	}
    
    	return tx
    }
    
    // WithContext change current instance db's context to ctx
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sun Aug 20 11:46:56 UTC 2023
    - 11.6K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. pkg/registry/core/persistentvolume/strategy.go

    	pv := obj.(*api.PersistentVolume)
    	pv.Status = api.PersistentVolumeStatus{}
    
    	if utilfeature.DefaultFeatureGate.Enabled(features.PersistentVolumeLastPhaseTransitionTime) {
    		pv.Status.Phase = api.VolumePending
    		now := NowFunc()
    		pv.Status.LastPhaseTransitionTime = &now
    	}
    }
    
    func (persistentvolumeStrategy) Validate(ctx context.Context, obj runtime.Object) field.ErrorList {
    	persistentvolume := obj.(*api.PersistentVolume)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 01 03:58:36 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/storage/value/encrypt/envelope/kmsv2/grpc_service.go

    	return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
    		start := NowFunc()
    		respErr := invoker(ctx, method, req, reply, cc, opts...)
    		elapsed := NowFunc().Sub(start)
    		metrics.RecordKMSOperationLatency(providerName, method, elapsed, respErr)
    		return respErr
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 14 23:18:16 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top