Skip to content

Commit

Permalink
Merge pull request #256 from jacobweinstock/redfish-options
Browse files Browse the repository at this point in the history
Add redfish provider options:

## Description

<!--- Please describe what this PR is going to change -->
Add redfish options, `UseBasicAuth`, and `SystemName`. See the RedfishOptions struct for new field details.

## Why is this needed

<!--- Link to issue you have raised -->

Fixes: #

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->


## How are existing users impacted? What migration steps/scripts do we need?

<!--- Fixes a bug, unblocks installation, removes a component of the stack etc -->
<!--- Requires a DB migration script, etc. -->


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
jacobweinstock authored Oct 22, 2024
2 parents cda13df + c1c3a93 commit c5afdbb
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 40 deletions.
8 changes: 4 additions & 4 deletions api/v1alpha1/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ type MachineSpec struct {
type ProviderOptions struct {
// IntelAMT contains the options to customize the IntelAMT provider.
// +optional
IntelAMT *IntelAMTOptions `json:"intelAMT"`
IntelAMT *IntelAMTOptions `json:"intelAMT,omitempty"`

// IPMITOOL contains the options to customize the Ipmitool provider.
// +optional
IPMITOOL *IPMITOOLOptions `json:"ipmitool"`
IPMITOOL *IPMITOOLOptions `json:"ipmitool,omitempty"`

// Redfish contains the options to customize the Redfish provider.
// +optional
Redfish *RedfishOptions `json:"redfish"`
Redfish *RedfishOptions `json:"redfish,omitempty"`

// RPC contains the options to customize the RPC provider.
// +optional
RPC *RPCOptions `json:"rpc"`
RPC *RPCOptions `json:"rpc,omitempty"`
}

// Connection contains connection data for a Baseboard Management Controller.
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/provider_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import (
type RedfishOptions struct {
// Port that redfish will use for calls.
Port int `json:"port"`
// UseBasicAuth for redfish calls. The default is false which means token based auth is used.
UseBasicAuth bool `json:"useBasicAuth"`
// SystemName is the name of the system to use for redfish calls.
// With redfish implementations that manage multiple systems via a single endpoint, this allows for specifying the system to manage.
SystemName string `json:"systemName"`
}

// IPMITOOLOptions contains the ipmitool provider specific options.
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/bmc.tinkerbell.org_machines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,19 @@ spec:
port:
description: Port that redfish will use for calls.
type: integer
systemName:
description: |-
SystemName is the name of the system to use for redfish calls.
With redfish implementations that manage multiple systems via a single endpoint, this allows for specifying the system to manage.
type: string
useBasicAuth:
description: UseBasicAuth for redfish calls. The default
is false which means token based auth is used.
type: boolean
required:
- port
- systemName
- useBasicAuth
type: object
rpc:
description: RPC contains the options to customize the RPC
Expand Down
11 changes: 11 additions & 0 deletions config/crd/bases/bmc.tinkerbell.org_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,19 @@ spec:
port:
description: Port that redfish will use for calls.
type: integer
systemName:
description: |-
SystemName is the name of the system to use for redfish calls.
With redfish implementations that manage multiple systems via a single endpoint, this allows for specifying the system to manage.
type: string
useBasicAuth:
description: UseBasicAuth for redfish calls. The default
is false which means token based auth is used.
type: boolean
required:
- port
- systemName
- useBasicAuth
type: object
rpc:
description: RPC contains the options to customize the RPC
Expand Down
39 changes: 6 additions & 33 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ namePrefix: rufio-
#commonLabels:
# someName: someValue

bases:
- ../crd
- ../rbac
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- ../webhook
Expand All @@ -24,7 +20,6 @@ bases:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
Expand All @@ -43,31 +38,9 @@ patchesStrategicMerge:
#- webhookcainjection_patch.yaml

# the following config is for teaching kustomize how to do var substitution
vars:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
# fieldref:
# fieldpath: metadata.namespace
#- name: CERTIFICATE_NAME
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
#- name: SERVICE_NAMESPACE # namespace of the service
# objref:
# kind: Service
# version: v1
# name: webhook-service
# fieldref:
# fieldpath: metadata.namespace
#- name: SERVICE_NAME
# objref:
# kind: Service
# version: v1
# name: webhook-service
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../crd
- ../rbac
- ../manager
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.22.2

require (
dario.cat/mergo v1.0.1
github.com/bmc-toolbox/bmclib/v2 v2.3.3-0.20241009101203-eba5356884bf
github.com/bmc-toolbox/bmclib/v2 v2.3.4-0.20241022160847-8a5f5a1a243c
github.com/ccoveille/go-safecast v1.1.0
github.com/go-logr/logr v1.4.2
github.com/go-logr/zerologr v1.2.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ github.com/VictorLowther/soap v0.0.0-20150314151524-8e36fca84b22 h1:a0MBqYm44o0N
github.com/VictorLowther/soap v0.0.0-20150314151524-8e36fca84b22/go.mod h1:/B7V22rcz4860iDqstGvia/2+IYWXf3/JdQCVd/1D2A=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bmc-toolbox/bmclib/v2 v2.3.3-0.20241009101203-eba5356884bf h1:mZ9+KTnagDFwddNWcHzp3tk2XTKL+3JJLZvSNh8Kzi8=
github.com/bmc-toolbox/bmclib/v2 v2.3.3-0.20241009101203-eba5356884bf/go.mod h1:t8If/0fHQTRIK/yKDk2H3SgthDNNj+7z2aeftDFRFrU=
github.com/bmc-toolbox/bmclib/v2 v2.3.4-0.20241022160847-8a5f5a1a243c h1:UrzCk+x0r3nsa3aTvuNesgtU5/6EkCrEF7EfwnM2rjI=
github.com/bmc-toolbox/bmclib/v2 v2.3.4-0.20241022160847-8a5f5a1a243c/go.mod h1:t8If/0fHQTRIK/yKDk2H3SgthDNNj+7z2aeftDFRFrU=
github.com/bmc-toolbox/common v0.0.0-20240806132831-ba8adc6a35e3 h1:/BjZSX/sphptIdxpYo4wxAQkgMLyMMgfdl48J9DKNeE=
github.com/bmc-toolbox/common v0.0.0-20240806132831-ba8adc6a35e3/go.mod h1:Cdnkm+edb6C0pVkyCrwh3JTXAe0iUF9diDG/DztPI9I=
github.com/bombsimon/logrusr/v2 v2.0.1 h1:1VgxVNQMCvjirZIYaT9JYn6sAVGVEcNtRE0y4mvaOAM=
Expand Down

0 comments on commit c5afdbb

Please sign in to comment.