Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 26 for setCondition (0.19 sec)

  1. pkg/controller/replication/replication_controller_utils.go

    		if c.Type == condType {
    			return &c
    		}
    	}
    	return nil
    }
    
    // SetCondition adds/replaces the given condition in the replication controller status.
    func SetCondition(status *v1.ReplicationControllerStatus, condition v1.ReplicationControllerCondition) {
    	currentCond := GetCondition(*status, condition.Type)
    	if currentCond != nil && currentCond.Status == condition.Status && currentCond.Reason == condition.Reason {
    		return
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 28 14:41:20 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  2. pkg/controller/replicaset/replica_set_utils.go

    		Message:            msg,
    	}
    }
    
    // GetCondition returns a replicaset condition with the provided type if it exists.
    func GetCondition(status apps.ReplicaSetStatus, condType apps.ReplicaSetConditionType) *apps.ReplicaSetCondition {
    	for _, c := range status.Conditions {
    		if c.Type == condType {
    			return &c
    		}
    	}
    	return nil
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 07 12:19:51 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  3. pkg/controller/podautoscaler/horizontal.go

    	if invalidMetricsCount >= len(metricSpecs) || (invalidMetricsCount > 0 && replicas < specReplicas) {
    		setCondition(hpa, invalidMetricCondition.Type, invalidMetricCondition.Status, invalidMetricCondition.Reason, invalidMetricCondition.Message)
    		return -1, "", statuses, time.Time{}, invalidMetricError
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 63.6K bytes
    - Viewed (0)
  4. pkg/controller/daemon/update_test.go

    		}
    		if !podutil.UpdatePodCondition(&pod.Status, &condition) {
    			t.Fatal("failed to update pod")
    		}
    		// TODO: workaround UpdatePodCondition calling time.Now() directly
    		setCondition := podutil.GetPodReadyCondition(pod.Status)
    		setCondition.LastTransitionTime.Time = dsc.failedPodsBackoff.Clock.Now()
    		logger.Info("marked pod ready", "pod", pod.Name, "ready", ready)
    		count--
    	}
    	if count > 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Feb 10 21:10:35 UTC 2024
    - 28.9K bytes
    - Viewed (0)
  5. pkg/controller/replicaset/replica_set_test.go

    			cond:   condReplicaFailure2(),
    
    			expectedStatus: &apps.ReplicaSetStatus{Conditions: []apps.ReplicaSetCondition{condReplicaFailure2()}},
    		},
    	}
    
    	for _, test := range tests {
    		SetCondition(test.status, test.cond)
    		if !reflect.DeepEqual(test.status, test.expectedStatus) {
    			t.Errorf("%s: expected status: %v, got: %v", test.name, test.expectedStatus, test.status)
    		}
    	}
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 69.2K bytes
    - Viewed (0)
  6. pilot/pkg/model/status/helper.go

    func GetBoolCondition(conditions []*v1alpha1.IstioCondition, condition string, defaultValue bool) bool {
    	got := GetCondition(conditions, condition)
    	if got == nil {
    		return defaultValue
    	}
    	if got.Status == StatusTrue {
    		return true
    	}
    	if got.Status == StatusFalse {
    		return false
    	}
    	return defaultValue
    }
    
    func GetCondition(conditions []*v1alpha1.IstioCondition, condition string) *v1alpha1.IstioCondition {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Jun 21 15:06:10 UTC 2023
    - 2.9K bytes
    - Viewed (0)
  7. pkg/apis/storagemigration/validation/validation.go

    func isSuccessful(svm *storagemigration.StorageVersionMigration) bool {
    	successCondition := getCondition(svm, storagemigration.MigrationSucceeded)
    	if successCondition != nil && successCondition.Status == corev1.ConditionTrue {
    		return true
    	}
    	return false
    }
    
    func isFailed(svm *storagemigration.StorageVersionMigration) bool {
    	failedCondition := getCondition(svm, storagemigration.MigrationFailed)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 08 04:18:56 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  8. tensorflow/compiler/mlir/tfr/passes/canonicalize.cc

        // Then branch
        if (matchPattern(if_op.getCondition(), m_NonZero())) {
          return InlineRegion(if_op.getLoc(), rewriter, if_op,
                              &if_op.getThenRegion());
        }
    
        // Else branch
        if (matchPattern(if_op.getCondition(), m_Zero())) {
          if (if_op.getElseRegion().empty()) {
            // Remove the op
    Registered: Sun Jun 16 05:45:23 UTC 2024
    - Last Modified: Sat Jan 14 22:15:06 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  9. pilot/pkg/model/kstatus/helper_test.go

    				},
    			},
    			condition: "",
    			want:      metav1.Condition{},
    		},
    	}
    	for _, tt := range tests {
    		t.Run(tt.name, func(t *testing.T) {
    			if got := GetCondition(tt.conditions, tt.condition); !reflect.DeepEqual(got, tt.want) {
    				t.Errorf("GetCondition got %v, want %v", got, tt.want)
    			}
    		})
    	}
    }
    
    func TestCreateCondition(t *testing.T) {
    	transitionTime := metav1.Now()
    	tests := []struct {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed May 24 18:11:40 UTC 2023
    - 9K bytes
    - Viewed (0)
  10. pilot/pkg/autoregistration/internal/health/util.go

    // condition.
    func HasHealthCondition(wle *config.Config) bool {
    	if wle == nil {
    		return false
    	}
    	s, ok := wle.Status.(*v1alpha1.IstioStatus)
    	if !ok {
    		return false
    	}
    	return status.GetCondition(s.Conditions, status.ConditionHealthy) != nil
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 11 07:04:17 UTC 2023
    - 1.7K bytes
    - Viewed (0)
Back to top