Skip to content

Commit b261deb

Browse files
zanebcgwalters
andcommitted
OCPBUGS-15845: Fail if host incompatible with target cluster
Co-Authored-By: Colin Walters <[email protected]>
1 parent ac3ac89 commit b261deb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

pkg/types/validation/installconfig.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ import (
5151
"github.com/openshift/installer/pkg/validate"
5252
)
5353

54+
// hostCryptBypassedAnnotation is set if the host crypt check was bypassed via environment variable.
55+
const hostCryptBypassedAnnotation = "install.openshift.io/hostcrypt-check-bypassed"
56+
5457
// list of known plugins that require hostPrefix to be set
5558
var pluginsUsingHostPrefix = sets.NewString(string(operv1.NetworkTypeOVNKubernetes))
5659

@@ -1171,7 +1174,15 @@ func validateFIPSconfig(c *types.InstallConfig) field.ErrorList {
11711174
}
11721175

11731176
if err := hostcrypt.VerifyHostTargetState(c.FIPS); err != nil {
1174-
logrus.Warnf("%v", err)
1177+
if skip, ok := os.LookupEnv("OPENSHIFT_INSTALL_SKIP_HOSTCRYPT_VALIDATION"); ok && skip != "" {
1178+
logrus.Warnf("%v", err)
1179+
if c.Annotations == nil {
1180+
c.Annotations = make(map[string]string)
1181+
}
1182+
c.Annotations[hostCryptBypassedAnnotation] = "true"
1183+
} else {
1184+
allErrs = append(allErrs, field.Forbidden(field.NewPath("fips"), err.Error()))
1185+
}
11751186
}
11761187
return allErrs
11771188
}

0 commit comments

Comments
 (0)