Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for Rfc3339Copy (0.1 sec)

  1. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time.go

    // Unix returns the local time corresponding to the given Unix time
    // by wrapping time.Unix.
    func Unix(sec int64, nsec int64) Time {
    	return Time{time.Unix(sec, nsec)}
    }
    
    // Rfc3339Copy returns a copy of the Time at second-level precision.
    func (t Time) Rfc3339Copy() Time {
    	copied, _ := time.Parse(time.RFC3339, t.Format(time.RFC3339))
    	return Time{copied}
    }
    
    // UnmarshalJSON implements the json.Unmarshaller interface.
    Registered: 2024-06-15 01:39
    - Last Modified: 2024-05-29 21:48
    - 5.2K bytes
    - Viewed (0)
  2. pkg/kubelet/kubelet_node_status_test.go

    		cond.LastHeartbeatTime = cond.LastHeartbeatTime.Rfc3339Copy()
    		cond.LastTransitionTime = cond.LastTransitionTime.Rfc3339Copy()
    	}
    
    	// Expect LastHeartbeat updated, other things unchanged.
    	for i, cond := range expectedNode.Status.Conditions {
    		expectedNode.Status.Conditions[i].LastHeartbeatTime = metav1.NewTime(cond.LastHeartbeatTime.Time.Add(time.Minute)).Rfc3339Copy()
    	}
    Registered: 2024-06-15 01:39
    - Last Modified: 2024-05-08 19:23
    - 115.8K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/apis/meta/v1/time_test.go

    	}
    }
    
    func TestTimeMarshalJSONUnmarshalYAML(t *testing.T) {
    	cases := []struct {
    		input Time
    	}{
    		{Time{}},
    		{Date(1998, time.May, 5, 5, 5, 5, 50, time.Local).Rfc3339Copy()},
    		{Date(1998, time.May, 5, 5, 5, 5, 0, time.Local).Rfc3339Copy()},
    	}
    
    	for i, c := range cases {
    		input := TimeHolder{c.input}
    		jsonMarshalled, err := json.Marshal(&input)
    		if err != nil {
    Registered: 2024-06-15 01:39
    - Last Modified: 2024-05-29 21:48
    - 9.4K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/apis/meta/fuzzer/fuzzer.go

    			var sec, nsec uint32
    			c.Fuzz(&sec)
    			c.Fuzz(&nsec)
    			j.CreationTimestamp = metav1.Unix(int64(sec), int64(nsec)).Rfc3339Copy()
    
    			if j.DeletionTimestamp != nil {
    				c.Fuzz(&sec)
    				c.Fuzz(&nsec)
    				t := metav1.Unix(int64(sec), int64(nsec)).Rfc3339Copy()
    				j.DeletionTimestamp = &t
    			}
    
    			if len(j.Labels) == 0 {
    				j.Labels = nil
    			} else {
    				delete(j.Labels, "")
    			}
    Registered: 2024-06-15 01:39
    - Last Modified: 2024-05-03 15:12
    - 9.9K bytes
    - Viewed (0)
  5. pkg/kubelet/status/status_manager_test.go

    	verifyUpdates(t, syncer, 1)
    	finalStatus := expectPodStatus(t, syncer, testPod)
    	if finalStatus.StartTime.IsZero() {
    		t.Errorf("StartTime should not be zero")
    	}
    	expected := now.Rfc3339Copy()
    	if !finalStatus.StartTime.Equal(&expected) {
    		t.Errorf("Expected %v, but got %v", expected, finalStatus.StartTime)
    	}
    }
    
    func TestChangedStatusUpdatesLastTransitionTime(t *testing.T) {
    Registered: 2024-06-15 01:39
    - Last Modified: 2024-05-02 16:27
    - 68.1K bytes
    - Viewed (0)
  6. pkg/kubelet/status/status_manager.go

    	if containers := len(pod.Spec.Containers) + len(pod.Spec.InitContainers); containers > 0 {
    		bytesPerStatus = bytesPerStatus / containers
    	}
    	normalizeTimeStamp := func(t *metav1.Time) {
    		*t = t.Rfc3339Copy()
    	}
    	normalizeContainerState := func(c *v1.ContainerState) {
    		if c.Running != nil {
    			normalizeTimeStamp(&c.Running.StartedAt)
    		}
    		if c.Terminated != nil {
    Registered: 2024-06-15 01:39
    - Last Modified: 2024-05-02 16:27
    - 44.3K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/apiserver_test.go

    	d := streaming.NewDecoder(fr, streamSerializer.Serializer)
    	return d
    }
    
    func TestGetPartialObjectMetadata(t *testing.T) {
    	now := metav1.Time{Time: metav1.Now().Rfc3339Copy().Local()}
    	storage := map[string]rest.Storage{}
    	simpleStorage := SimpleRESTStorage{
    		item: genericapitesting.Simple{
    Registered: 2024-06-15 01:39
    - Last Modified: 2023-05-01 20:15
    - 158.7K bytes
    - Viewed (0)
  8. pkg/kubelet/kubelet_pods_test.go

    				},
    				Metadata: &runtimeapi.PodSandboxMetadata{Attempt: uint32(0)},
    				State:    runtimeapi.PodSandboxState_SANDBOX_READY,
    			},
    		},
    	}
    
    	now := metav1.Now()
    	normalized_now := now.Rfc3339Copy()
    
    	tests := []struct {
    		name                                       string
    		pod                                        *v1.Pod
    		currentStatus                              *kubecontainer.PodStatus
    Registered: 2024-06-15 01:39
    - Last Modified: 2024-06-07 00:05
    - 198.8K bytes
    - Viewed (0)
Back to top