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

Add APIs for machine phases #531

Merged
merged 3 commits into from
Nov 28, 2018
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
14 changes: 14 additions & 0 deletions config/crds/cluster_v1alpha1_machine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,25 @@ spec:
type: string
errorReason:
type: string
lastOperation:
properties:
description:
type: string
lastUpdated:
format: date-time
type: string
state:
type: string
type:
type: string
type: object
lastUpdated:
format: date-time
type: string
nodeRef:
type: object
phase:
type: string
providerStatus:
type: object
versions:
Expand Down
29 changes: 29 additions & 0 deletions pkg/apis/cluster/v1alpha1/machine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,35 @@ type MachineStatus struct {
// Refer: https://kubernetes.io/docs/concepts/architecture/nodes/#condition
// +optional
Conditions []corev1.NodeCondition `json:"conditions,omitempty"`

// LastOperation describes the last-operation performed by the machine-controller.
// This API should be useful as a history in terms of the latest operation performed on the
// specific machine. It should also convey the state of the latest-operation for example if
// it is still on-going, failed or completed successfully.
// +optional
LastOperation *LastOperation `json:"lastOperation,omitempty"`

// Phase represents the current phase of machine actuation.
// Eg. Pending, Running, Terminating, Failed etc.
// +optional
Phase *string `json:"phase,omitempty"`
}

// LastOperation represents the detail of the last performed operation on the MachineObject.
type LastOperation struct {
// Description is the human-readable description of the last operation.
Description *string `json:"description,omitempty"`

// LastUpdateTime is the timestamp at which LastOperation API was last-updated.
LastUpdated *metav1.Time `json:"lastUpdated,omitempty"`

// State is the current status of the last performed operation.
// Eg.Processing, Failed, Successful etc
State *string `json:"state,omitempty"`

// Type is the type of operation which was last performed.
// Eg. Create, Delete, Update etc
Type *string `json:"type,omitempty"`
}

/// [MachineStatus]
Expand Down
45 changes: 45 additions & 0 deletions pkg/apis/cluster/v1alpha1/zz_generated.deepcopy.go

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