deploy: api for deploymentconfig Conditions
@@ -321,6 +321,8 @@ type DeploymentConfigStatus struct {
// Details are the reasons for the update to this deployment config.
// This could be based on a change made by the user or caused by an automatic trigger
Details *DeploymentDetails `json:"details,omitempty" protobuf:"bytes,7,opt,name=details"`
+ // Conditions represents the latest available observations of a deployment config's current state.
+ Conditions []DeploymentCondition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
}
// DeploymentTriggerPolicy describes a policy for a single trigger that results in a new deployment.
@@ -384,6 +386,37 @@ type DeploymentCauseImageTrigger struct {
From kapi.ObjectReference `json:"from" protobuf:"bytes,1,opt,name=from"`
}
+type DeploymentConditionType string
+
+// These are valid conditions of a deployment config.
+const (
+ // DeploymentAvailable means the deployment config is available, ie. at least the minimum available
+ // replicas required are up and running for at least minReadySeconds.
+ DeploymentAvailable DeploymentConditionType = "Available"
+ // DeploymentProgressing means the deployment config is progressing. Progress for a deployment
+ // config is considered when a new replica set is created or adopted, and when new pods scale up or
+ // old pods scale down. Progress is not estimated for paused deployment configs, when the deployment
+ // config needs to rollback, or when progressDeadlineSeconds is not specified.
+ DeploymentProgressing DeploymentConditionType = "Progressing"
+ // DeploymentReplicaFailure is added in a deployment config when one of its pods
+ // fails to be created or deleted.
+ DeploymentReplicaFailure DeploymentConditionType = "ReplicaFailure"
+)
+
+// DeploymentCondition describes the state of a deployment config at a certain point.
+type DeploymentCondition struct {
+ // Type of deployment condition.
+ Type DeploymentConditionType `json:"type"`
+ // Status of the condition, one of True, False, Unknown.
+ Status kapi.ConditionStatus `json:"status"`
+ // The last time the condition transitioned from one status to another.
+ LastTransitionTime unversioned.Time `json:"lastTransitionTime,omitempty"`
+ // The reason for the condition's last transition.
+ Reason string `json:"reason,omitempty"`
+ // A human readable message indicating details about the transition.
+ Message string `json:"message,omitempty"`
+}
+
// DeploymentConfigList is a collection of deployment configs.
type DeploymentConfigList struct {
unversioned.TypeMeta `json:",inline"`
