Skip to content

Commit

Permalink
Add APIs for machine phases (#531)
Browse files Browse the repository at this point in the history
* Add APIs for machine phases

* Autogenerated files

* Apply suggestions from code review

Co-Authored-By: hardikdr <[email protected]>
  • Loading branch information
hardikdr authored and k8s-ci-robot committed Nov 28, 2018
1 parent 299c318 commit 5a27d98
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
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.

0 comments on commit 5a27d98

Please sign in to comment.