Skip to content

feat: add secure boot option to instance#55

Merged
gabriel-samfira merged 3 commits intocloudbase:mainfrom
n3xtio:feat/secure-boot
Dec 22, 2025
Merged

feat: add secure boot option to instance#55
gabriel-samfira merged 3 commits intocloudbase:mainfrom
n3xtio:feat/secure-boot

Conversation

@n3xt-martin
Copy link
Copy Markdown
Contributor

@n3xt-martin n3xt-martin commented Dec 16, 2025

Good day!

I'm in the need of creating runners with secure boot. I saw that this feature was missing so here's my attempt at the implementation.

I've built the project without issue and I'm testing it as I'm writing.

Copy link
Copy Markdown
Member

@gabriel-samfira gabriel-samfira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Just one small comment, but other wise, this is good to go.

r.DisableUpdates = *extraSpecs.DisableUpdates
}
if extraSpecs.EnableSecureBoot {
r.EnableSecureBoot = *extraSpecs.EnableSecureBoot
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably fail to build, as extraSpecs.EnableSecureBoot is not a pointer anymore. For these 3 values, you can just set the RunnerSpec directly. Like so:

r.EnableSecureBoot = extraSpecs.EnableSecureBoot
r.EnableVTPM = extraSpecs.EnableVTPM
r.EnableIntegrityMonitoring = extraSpecs.EnableIntegrityMonitoring

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaah my bad, completely forgot to change the tests. That's fixed, thank you!

if extraSpecs.DisableUpdates != nil {
r.DisableUpdates = *extraSpecs.DisableUpdates
}
if extraSpecs.EnableSecureBoot {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit (functionally it's the same), for bool values, you can skip the if statement. The result is the same:

  • default value for a bool is false
  • The if in this case only sets the RunnerSpec value if the extra spec is true
  • The same effect can be achieved if you simply do a blind assignment.

This is all for future reference. Saves lines of code and simplifies code paths.

@gabriel-samfira
Copy link
Copy Markdown
Member

Thanks!

@gabriel-samfira gabriel-samfira merged commit 68826f0 into cloudbase:main Dec 22, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants