Skip to content

Commit

Permalink
feat(intelAMT): add support for HTTPS connections
Browse files Browse the repository at this point in the history
Signed-off-by: Léonard Suslian (synthe102) <[email protected]>
  • Loading branch information
synthe102 committed May 24, 2024
1 parent 736ddc0 commit f72a47d
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
6 changes: 6 additions & 0 deletions api/v1alpha1/provider_opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ type IPMITOOLOptions struct {
type IntelAMTOptions struct {
// Port that intelAMT will use for calls.
Port int `json:"port"`

// UseHttp determines whether to use http or https for intelAMT calls.
// +optional
// +kubebuilder:validation:Enum=http;https
// +kubebuilder:default:=http
HostScheme string `json:"hostScheme"`
}

// HMACAlgorithm is a type for HMAC algorithms.
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/bmc.tinkerbell.org_machines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ spec:
description: IntelAMT contains the options to customize the
IntelAMT provider.
properties:
hostScheme:
default: http
description: UseHttp determines whether to use http or
https for intelAMT calls.
enum:
- http
- https
type: string
port:
description: Port that intelAMT will use for calls.
type: integer
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/bmc.tinkerbell.org_tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ spec:
description: IntelAMT contains the options to customize the
IntelAMT provider.
properties:
hostScheme:
default: http
description: UseHttp determines whether to use http or
https for intelAMT calls.
enum:
- http
- https
type: string
port:
description: Port that intelAMT will use for calls.
type: integer
Expand Down
5 changes: 3 additions & 2 deletions controller/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ func (b BMCOptions) Translate(host string) []bmclib.Option {

// intelAmt options
if b.IntelAMT != nil {
amt := bmclib.WithIntelAMTPort(uint32(b.IntelAMT.Port))
o = append(o, amt)
amtPort := bmclib.WithIntelAMTPort(uint32(b.IntelAMT.Port))
amtScheme := bmclib.WithIntelAMTHostScheme(b.IntelAMT.HostScheme)
o = append(o, amtPort, amtScheme)

Check warning on line 82 in controller/client.go

View check run for this annotation

Codecov / codecov/patch

controller/client.go#L80-L82

Added lines #L80 - L82 were not covered by tests
}

// rpc options
Expand Down

0 comments on commit f72a47d

Please sign in to comment.