Skip to content

Commit

Permalink
Validate that we store the values and they are not empty
Browse files Browse the repository at this point in the history
Signed-off-by: Itxaka <[email protected]>
  • Loading branch information
Itxaka committed Feb 3, 2025
1 parent 4db0a83 commit 1df1641
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pkg/validation/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,18 @@ func (v *Validator) Validate() error {
}
}

if config.DefaultConfig.Variant == "standard" {
if vals["KAIROS_VARIANT"] != "standard" {
multi = multierror.Append(multi, fmt.Errorf("KAIROS_VARIANT is not standard"))
}
if vals["KAIROS_SOFTWARE_VERSION"] == "" {
multi = multierror.Append(multi, fmt.Errorf("KAIROS_SOFTWARE_VERSION is empty"))
}
if vals["KAIROS_SOFTWARE_VERSION_PREFIX"] == "" {
multi = multierror.Append(multi, fmt.Errorf("KAIROS_SOFTWARE_VERSION_PREFIX is empty"))
}
}

// Check if initrd contains the necessary binaries
// Do it at the ends as its the slowest check
if !config.DefaultConfig.TrustedBoot {
Expand Down

0 comments on commit 1df1641

Please sign in to comment.