Skip to content

Commit 2d7d333

Browse files
committed
Add disable cert API
Signed-off-by: Michael Shitrit <[email protected]>
1 parent 0b51991 commit 2d7d333

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

data/data/install.openshift.io_installconfigs.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ spec:
7171
properties:
7272
address:
7373
type: string
74+
disableCertificateVerification:
75+
type: boolean
7476
hostName:
7577
type: string
7678
password:
@@ -79,6 +81,7 @@ spec:
7981
type: string
8082
required:
8183
- address
84+
- disableCertificateVerification
8285
- password
8386
- username
8487
type: object
@@ -1384,6 +1387,8 @@ spec:
13841387
properties:
13851388
address:
13861389
type: string
1390+
disableCertificateVerification:
1391+
type: boolean
13871392
hostName:
13881393
type: string
13891394
password:
@@ -1392,6 +1397,7 @@ spec:
13921397
type: string
13931398
required:
13941399
- address
1400+
- disableCertificateVerification
13951401
- password
13961402
- username
13971403
type: object
@@ -2636,6 +2642,8 @@ spec:
26362642
properties:
26372643
address:
26382644
type: string
2645+
disableCertificateVerification:
2646+
type: boolean
26392647
hostName:
26402648
type: string
26412649
password:
@@ -2644,6 +2652,7 @@ spec:
26442652
type: string
26452653
required:
26462654
- address
2655+
- disableCertificateVerification
26472656
- password
26482657
- username
26492658
type: object

pkg/types/machinepools.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ type Fencing struct {
160160

161161
// Credential stores the information about a baremetal host's management controller.
162162
type Credential struct {
163-
HostName string `json:"hostName,omitempty" validate:"required,uniqueField"`
164-
Username string `json:"username" validate:"required"`
165-
Password string `json:"password" validate:"required"`
166-
Address string `json:"address" validate:"required,uniqueField"`
163+
HostName string `json:"hostName,omitempty" validate:"required,uniqueField"`
164+
Username string `json:"username" validate:"required"`
165+
Password string `json:"password" validate:"required"`
166+
Address string `json:"address" validate:"required,uniqueField"`
167+
DisableCertificateVerification bool `json:"disableCertificateVerification"`
167168
}

pkg/types/validation/installconfig_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2822,6 +2822,15 @@ func TestValidateTNF(t *testing.T) {
28222822
name: "valid_two_credentials",
28232823
expected: "",
28242824
},
2825+
{
2826+
config: installConfig().
2827+
MachinePoolCP(machinePool().
2828+
Credential(c1().DisableCertificateVerification(true), c2())).
2829+
CpReplicas(2).
2830+
build(),
2831+
name: "valid_with_disabled_cert_verification",
2832+
expected: "",
2833+
},
28252834
{
28262835
config: installConfig().
28272836
MachinePoolCP(machinePool().
@@ -3017,6 +3026,11 @@ func (hb *credentialBuilder) BMCPassword(value string) *credentialBuilder {
30173026
return hb
30183027
}
30193028

3029+
func (hb *credentialBuilder) DisableCertificateVerification(value bool) *credentialBuilder {
3030+
hb.Credential.DisableCertificateVerification = value
3031+
return hb
3032+
}
3033+
30203034
type machinePoolBuilder struct {
30213035
types.MachinePool
30223036
}

0 commit comments

Comments
 (0)