Skip to content

OCPEDGE-1707: Add Disable Certificate Verification API #9640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2025
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
27 changes: 27 additions & 0 deletions data/data/install.openshift.io_installconfigs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ spec:
properties:
address:
type: string
certificateVerification:
default: Enabled
description: |-
CertificateVerification Defines whether ssl certificate verification is required or not.
If omitted, the platform chooses a default, that default is enabled.
enum:
- Enabled
- Disabled
type: string
hostName:
type: string
password:
Expand Down Expand Up @@ -1384,6 +1393,15 @@ spec:
properties:
address:
type: string
certificateVerification:
default: Enabled
description: |-
CertificateVerification Defines whether ssl certificate verification is required or not.
If omitted, the platform chooses a default, that default is enabled.
enum:
- Enabled
- Disabled
type: string
hostName:
type: string
password:
Expand Down Expand Up @@ -2636,6 +2654,15 @@ spec:
properties:
address:
type: string
certificateVerification:
default: Enabled
description: |-
CertificateVerification Defines whether ssl certificate verification is required or not.
If omitted, the platform chooses a default, that default is enabled.
enum:
- Enabled
- Disabled
type: string
hostName:
type: string
password:
Expand Down
16 changes: 16 additions & 0 deletions pkg/types/machinepools.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,26 @@ type Fencing struct {
Credentials []*Credential `json:"credentials,omitempty"`
}

// CertificateVerificationPolicy represents the options for CertificateVerification .
type CertificateVerificationPolicy string

const (
// CertificateVerificationEnabled enables ssl certificate verification.
CertificateVerificationEnabled CertificateVerificationPolicy = "Enabled"
// CertificateVerificationDisabled disables ssl certificate verification.
CertificateVerificationDisabled CertificateVerificationPolicy = "Disabled"
)

// Credential stores the information about a baremetal host's management controller.
type Credential struct {
HostName string `json:"hostName,omitempty" validate:"required,uniqueField"`
Username string `json:"username" validate:"required"`
Password string `json:"password" validate:"required"`
Address string `json:"address" validate:"required,uniqueField"`
// CertificateVerification Defines whether ssl certificate verification is required or not.
// If omitted, the platform chooses a default, that default is enabled.
// +kubebuilder:default:="Enabled"
// +kubebuilder:validation:Enum=Enabled;Disabled
// +optional
CertificateVerification CertificateVerificationPolicy `json:"certificateVerification,omitempty"`
}
15 changes: 15 additions & 0 deletions pkg/types/validation/installconfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2822,6 +2822,16 @@ func TestValidateTNF(t *testing.T) {
name: "valid_two_credentials",
expected: "",
},
{
config: installConfig().
PlatformBMWithHosts().
MachinePoolCP(machinePool().
Credential(c1().CertificateVerification(types.CertificateVerificationDisabled), c2())).
CpReplicas(2).
build(),
name: "valid_with_disabled_cert_verification",
expected: "",
},
{
config: installConfig().
MachinePoolCP(machinePool().
Expand Down Expand Up @@ -3017,6 +3027,11 @@ func (hb *credentialBuilder) BMCPassword(value string) *credentialBuilder {
return hb
}

func (hb *credentialBuilder) CertificateVerification(value types.CertificateVerificationPolicy) *credentialBuilder {
hb.Credential.CertificateVerification = value
return hb
}

type machinePoolBuilder struct {
types.MachinePool
}
Expand Down