Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ReplaceOrAppendPodCondition (0.29 sec)

  1. pkg/util/pod/pod.go

    	}
    	return patchBytes, bytes.Equal(patchBytes, []byte(fmt.Sprintf(`{"metadata":{"uid":%q}}`, uid))), nil
    }
    
    // ReplaceOrAppendPodCondition replaces the first pod condition with equal type or appends if there is none
    func ReplaceOrAppendPodCondition(conditions []v1.PodCondition, condition *v1.PodCondition) []v1.PodCondition {
    	if i, _ := podutil.GetPodConditionFromList(conditions, condition.Type); i >= 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Nov 07 15:22:29 UTC 2022
    - 3K bytes
    - Viewed (0)
  2. pkg/util/pod/pod_test.go

    				{
    					Type:   cType,
    					Status: v1.ConditionFalse,
    				},
    			},
    		},
    	}
    	for _, tc := range testCases {
    		t.Run(tc.description, func(t *testing.T) {
    			gotConditions := ReplaceOrAppendPodCondition(tc.conditions, &tc.condition)
    			if diff := cmp.Diff(tc.wantConditions, gotConditions); diff != "" {
    				t.Errorf("Unexpected conditions: %s", diff)
    			}
    		})
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Nov 07 15:22:29 UTC 2022
    - 4.5K bytes
    - Viewed (0)
Back to top