Skip to content

Commit

Permalink
Name change:
Browse files Browse the repository at this point in the history
The "Machine" in BMCMachineOptions didnt provide
any additional value over just BMCOptions.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Sep 28, 2023
1 parent 9f725f1 commit 8f7e490
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions pkg/providers/tinkerbell/hardware/catalogue_bmc.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ func toRufioMachine(m Machine) *v1alpha1.Machine {
},
InsecureTLS: true,
}
if m.BMCMachineOptions != nil && m.BMCMachineOptions.RPC.ConsumerURL != "" {
if m.BMCOptions != nil && m.BMCOptions.RPC.ConsumerURL != "" {
conn.ProviderOptions = &v1alpha1.ProviderOptions{
RPC: toRPCOptions(m.BMCMachineOptions.RPC),
RPC: toRPCOptions(m.BMCOptions.RPC),
}
}
return &v1alpha1.Machine{
Expand Down
4 changes: 2 additions & 2 deletions pkg/providers/tinkerbell/hardware/catalogue_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ func (w *SecretCatalogueWriter) Write(m Machine) error {
func baseboardManagementSecretFromMachine(m Machine) []*corev1.Secret {
var s []*corev1.Secret

if m.BMCMachineOptions != nil && m.BMCMachineOptions.RPC.ConsumerURL != "" {
for idx, secret := range m.BMCMachineOptions.RPC.HMAC.Secrets {
if m.BMCOptions != nil && m.BMCOptions.RPC.ConsumerURL != "" {
for idx, secret := range m.BMCOptions.RPC.HMAC.Secrets {
s = append(s, &corev1.Secret{
TypeMeta: newSecretTypeMeta(),
ObjectMeta: v1.ObjectMeta{
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/tinkerbell/hardware/catalogue_secret_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func TestRPCSecrets(t *testing.T) {
catalogue := hardware.NewCatalogue()
writer := hardware.NewSecretCatalogueWriter(catalogue)
machine := NewValidMachine()
machine.BMCMachineOptions = &hardware.BMCMachineOptions{
machine.BMCOptions = &hardware.BMCOptions{
RPC: &hardware.RPCOpts{
ConsumerURL: "http://localhost:8080",
HMAC: hardware.HMACOpts{
Expand Down
8 changes: 4 additions & 4 deletions pkg/providers/tinkerbell/hardware/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ type Machine struct {
BMCPassword string `csv:"bmc_password, omitempty"`
VLANID string `csv:"vlan_id, omitempty"`

// BMCMachineOptions are the options used for Rufio providers.
BMCMachineOptions *BMCMachineOptions `csv:"-"`
// BMCOptions are the options used for Rufio providers.
BMCOptions *BMCOptions `csv:"-"`
}

// BMCMachineOptions are the options used to configure the Rufio providers.
// BMCOptions are the options used to configure the Rufio providers.
// Right now we only support the RPC provider.
type BMCMachineOptions struct {
type BMCOptions struct {
// RPC are the options for the Rufio RPC provider.
RPC *RPCOpts `csv:"-"`
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/tinkerbell/hardware/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func NewMachineWithOptions() hardware.Machine {
BMCUsername: "username",
BMCPassword: "password",
VLANID: "200",
BMCMachineOptions: &hardware.BMCMachineOptions{
BMCOptions: &hardware.BMCOptions{
RPC: &hardware.RPCOpts{
ConsumerURL: "https://example.net",
Request: hardware.RequestOpts{
Expand Down

0 comments on commit 8f7e490

Please sign in to comment.