Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment conditions api #11214

Merged
merged 2 commits into from
Oct 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions api/swagger-spec/oapi-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -24726,6 +24726,13 @@
"details": {
"$ref": "v1.DeploymentDetails",
"description": "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"
},
"conditions": {
"type": "array",
"items": {
"$ref": "v1.DeploymentCondition"
},
"description": "Conditions represents the latest available observations of a deployment config's current state."
}
}
},
Expand Down Expand Up @@ -24779,6 +24786,36 @@
}
}
},
"v1.DeploymentCondition": {
"id": "v1.DeploymentCondition",
"description": "DeploymentCondition describes the state of a deployment config at a certain point.",
"required": [
"type",
"status"
],
"properties": {
"type": {
"type": "string",
"description": "Type of deployment condition."
},
"status": {
"type": "string",
"description": "Status of the condition, one of True, False, Unknown."
},
"lastTransitionTime": {
"type": "string",
"description": "The last time the condition transitioned from one status to another."
},
"reason": {
"type": "string",
"description": "The reason for the condition's last transition."
},
"message": {
"type": "string",
"description": "A human readable message indicating details about the transition."
}
}
},
"v1.DeploymentRequest": {
"id": "v1.DeploymentRequest",
"description": "DeploymentRequest is a request to a deployment config for a new deployment.",
Expand Down
36 changes: 36 additions & 0 deletions api/swagger-spec/openshift-openapi-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -46113,6 +46113,35 @@
}
}
},
"v1.DeploymentCondition": {
"description": "DeploymentCondition describes the state of a deployment config at a certain point.",
"required": [
"type",
"status"
],
"properties": {
"lastTransitionTime": {
"description": "The last time the condition transitioned from one status to another.",
"type": "string"
},
"message": {
"description": "A human readable message indicating details about the transition.",
"type": "string"
},
"reason": {
"description": "The reason for the condition's last transition.",
"type": "string"
},
"status": {
"description": "Status of the condition, one of True, False, Unknown.",
"type": "string"
},
"type": {
"description": "Type of deployment condition.",
"type": "string"
}
}
},
"v1.DeploymentConfig": {
"description": "Deployment Configs define the template for a pod and manages deploying new images or configuration changes. A single deployment configuration is usually analogous to a single micro-service. Can support many different deployment patterns, including full restart, customizable rolling updates, and fully custom behaviors, as well as pre- and post- deployment hooks. Each individual deployment is represented as a replication controller.\n\nA deployment is \"triggered\" when its configuration is changed or a tag in an Image Stream is changed. Triggers can be disabled to allow manual control over a deployment. The \"strategy\" determines how the deployment is carried out and may be changed at any time. The `latestVersion` field is updated when a new deployment is triggered by any means.",
"required": [
Expand Down Expand Up @@ -46288,6 +46317,13 @@
"type": "integer",
"format": "int32"
},
"conditions": {
"description": "Conditions represents the latest available observations of a deployment config's current state.",
"type": "array",
"items": {
"$ref": "#/definitions/v1.DeploymentCondition"
}
},
"details": {
"$ref": "#/definitions/v1.DeploymentDetails"
},
Expand Down
33 changes: 33 additions & 0 deletions pkg/deploy/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,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
// Conditions represents the latest available observations of a deployment config's current state.
Conditions []DeploymentCondition
}

// DeploymentTriggerPolicy describes a policy for a single trigger that results in a new deployment.
Expand Down Expand Up @@ -409,6 +411,37 @@ type DeploymentCauseImageTrigger struct {
From kapi.ObjectReference
}

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
// Status of the condition, one of True, False, Unknown.
Status kapi.ConditionStatus
// The last time the condition transitioned from one status to another.
LastTransitionTime unversioned.Time
// The reason for the condition's last transition.
Reason string
// A human readable message indicating details about the transition.
Message string
}

// DeploymentConfigList is a collection of deployment configs.
type DeploymentConfigList struct {
unversioned.TypeMeta
Expand Down
Loading