Skip to content
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
6 changes: 6 additions & 0 deletions apis/metal3.io/v1alpha1/baremetalhost_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ const (
// has any sort of error.
OperationalStatusError OperationalStatus = "error"

// OperationalStatusDelayed is the status value for when the host
// deployment needs to be delayed to limit simultaneous hosts provisioning
OperationalStatusDelayed = "delayed"
)

Expand Down Expand Up @@ -546,10 +548,13 @@ type CredentialsStatus struct {
type RebootMode string

const (
// RebootModeHard defined for hard reset of a node
RebootModeHard RebootMode = "hard"
// RebootModeSoft defined for soft reset of a node
RebootModeSoft RebootMode = "soft"
)

// RebootAnnotationArguments defines the arguments of the RebootAnnotation type
type RebootAnnotationArguments struct {
Mode RebootMode `json:"mode"`
}
Expand Down Expand Up @@ -896,6 +901,7 @@ func (host *BareMetalHost) GetImageChecksum() (string, string, bool) {
return host.Spec.Image.GetChecksum()
}

// GetChecksum method returns the checksum of an image
func (image *Image) GetChecksum() (checksum, checksumType string, ok bool) {
if image == nil {
return
Expand Down
1 change: 1 addition & 0 deletions pkg/provisioner/fixture/fixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type fixtureProvisioner struct {
state *Fixture
}

// Fixture contains persistent state for a particular host
type Fixture struct {
// counter to set the provisioner as ready
BecomeReadyCounter int
Expand Down
6 changes: 3 additions & 3 deletions pkg/provisioner/ironic/ironic.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func (e macAddressConflictError) Error() string {
return fmt.Sprintf("MAC address %s conflicts with existing node %s", e.Address, e.ExistingNode)
}

// NewMacAddressConflictError is a wrap for macAddressConflictError error
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem very informative, maybe we should improve it further.

func NewMacAddressConflictError(address, node string) error {
return macAddressConflictError{Address: address, ExistingNode: node}
}
Expand Down Expand Up @@ -1198,10 +1199,9 @@ func (p *ironicProvisioner) Adopt(force bool) (result provisioner.Result, err er
Target: nodes.TargetAdopt,
},
)
} else {
return operationFailed(fmt.Sprintf("Host adoption failed: %s",
ironicNode.LastError))
}
return operationFailed(fmt.Sprintf("Host adoption failed: %s",
ironicNode.LastError))
case nodes.Active:
default:
}
Expand Down
1 change: 1 addition & 0 deletions pkg/provisioner/ironic/testserver/ironic.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func (m *IronicMock) NodeError(name string, errorCode int) *IronicMock {
return m
}

// NodeCreateCallback type is the callback mock for CreateNodes
type NodeCreateCallback func(node nodes.Node)

// CreateNodes configures the server so POSTing to /v1/nodes saves the data
Expand Down