Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for newStatefulSetPod (0.16 sec)

  1. pkg/controller/statefulset/stateful_set_test.go

    	set := newStatefulSet(5)
    	pod1 := newStatefulSetPod(set, 1)
    	// pod2 is an orphan with matching labels and name.
    	pod2 := newStatefulSetPod(set, 2)
    	pod2.OwnerReferences = nil
    	// pod3 has wrong labels.
    	pod3 := newStatefulSetPod(set, 3)
    	pod3.OwnerReferences = nil
    	pod3.Labels = nil
    	// pod4 has wrong name.
    	pod4 := newStatefulSetPod(set, 4)
    	pod4.OwnerReferences = nil
    	pod4.Name = "x" + pod4.Name
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 33.1K bytes
    - Viewed (0)
  2. pkg/controller/statefulset/stateful_pod_control_test.go

    	_, ctx := ktesting.NewTestContext(t)
    	recorder := record.NewFakeRecorder(10)
    	set := newStatefulSet(3)
    	pod := newStatefulSetPod(set, 0)
    	fakeClient := &fake.Clientset{}
    	podIndexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc})
    	gooPod := newStatefulSetPod(set, 0)
    	gooPod.Name = "goo-0"
    	podIndexer.Add(gooPod)
    	podLister := corelisters.NewPodLister(podIndexer)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 05 19:06:41 UTC 2024
    - 35.5K bytes
    - Viewed (0)
  3. pkg/controller/statefulset/stateful_set_utils_test.go

    	set2 := newStatefulSet(3)
    	set2.Name = "foo2"
    	pod := newStatefulSetPod(set, 1)
    	if !isMemberOf(set, pod) {
    		t.Error("isMemberOf returned false negative")
    	}
    	if isMemberOf(set2, pod) {
    		t.Error("isMemberOf returned false positive")
    	}
    }
    
    func TestIdentityMatches(t *testing.T) {
    	set := newStatefulSet(3)
    	pod := newStatefulSetPod(set, 1)
    	if !identityMatches(set, pod) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 05 19:06:41 UTC 2024
    - 50.9K bytes
    - Viewed (0)
  4. pkg/controller/statefulset/stateful_set_utils.go

    func getPodRevision(pod *v1.Pod) string {
    	if pod.Labels == nil {
    		return ""
    	}
    	return pod.Labels[apps.StatefulSetRevisionLabel]
    }
    
    // newStatefulSetPod returns a new Pod conforming to the set's Spec with an identity generated from ordinal.
    func newStatefulSetPod(set *apps.StatefulSet, ordinal int) *v1.Pod {
    	pod, _ := controller.GetPodFromTemplate(&set.Spec.Template, set, metav1.NewControllerRef(set, controllerKind))
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jun 05 19:06:41 UTC 2024
    - 26.7K bytes
    - Viewed (0)
  5. pkg/controller/statefulset/stateful_set_control_test.go

    	om.podsIndexer.Update(pod)
    	return om.podsLister.Pods(set.Namespace).List(selector)
    }
    
    func (om *fakeObjectManager) addTerminatingPod(set *apps.StatefulSet, ordinal int) ([]*v1.Pod, error) {
    	pod := newStatefulSetPod(set, ordinal)
    	pod.SetUID(types.UID(pod.Name + "-uid")) // To match fakeObjectManager.CreatePod
    	pod.Status.Phase = v1.PodRunning
    	deleted := metav1.NewTime(time.Now())
    	pod.DeletionTimestamp = &deleted
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue May 07 19:01:47 UTC 2024
    - 108.7K bytes
    - Viewed (0)
Back to top