-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add secure boot option to instance #55
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,6 +141,10 @@ | |
| SSHKeys []string `json:"ssh_keys,omitempty" jsonschema:"description=A list of SSH keys to be added to the instance. The format is USERNAME:SSH_KEY"` | ||
| EnableBootDebug *bool `json:"enable_boot_debug,omitempty" jsonschema:"description=Enable boot debug on the VM."` | ||
| DisableUpdates *bool `json:"disable_updates,omitempty" jsonschema:"description=Disable OS updates on boot."` | ||
| // Shielded VM options | ||
| EnableSecureBoot bool `json:"enable_secure_boot,omitempty" jsonschema:"description=Enable Secure Boot on the VM. Requires a Shielded VM compatible image."` | ||
| EnableVTPM bool `json:"enable_vtpm,omitempty" jsonschema:"description=Enable virtual Trusted Platform Module (vTPM) on the VM."` | ||
| EnableIntegrityMonitoring bool `json:"enable_integrity_monitoring,omitempty" jsonschema:"description=Enable integrity monitoring on the VM."` | ||
| // The Cloudconfig struct from common package | ||
| cloudconfig.CloudConfigSpec | ||
| } | ||
|
|
@@ -197,6 +201,10 @@ | |
| SSHKeys string | ||
| EnableBootDebug bool | ||
| DisableUpdates bool | ||
| // Shielded VM options | ||
| EnableSecureBoot bool | ||
| EnableVTPM bool | ||
| EnableIntegrityMonitoring bool | ||
| } | ||
|
|
||
| func (r *RunnerSpec) MergeExtraSpecs(extraSpecs *extraSpecs) { | ||
|
|
@@ -241,6 +249,15 @@ | |
| if extraSpecs.DisableUpdates != nil { | ||
| r.DisableUpdates = *extraSpecs.DisableUpdates | ||
| } | ||
| if extraSpecs.EnableSecureBoot { | ||
| r.EnableSecureBoot = *extraSpecs.EnableSecureBoot | ||
|
Check failure on line 253 in internal/spec/spec.go
|
||
|
||
| } | ||
| if extraSpecs.EnableVTPM { | ||
| r.EnableVTPM = *extraSpecs.EnableVTPM | ||
|
Check failure on line 256 in internal/spec/spec.go
|
||
| } | ||
| if extraSpecs.EnableIntegrityMonitoring { | ||
| r.EnableIntegrityMonitoring = *extraSpecs.EnableIntegrityMonitoring | ||
|
Check failure on line 259 in internal/spec/spec.go
|
||
| } | ||
| } | ||
|
|
||
| func (r *RunnerSpec) Validate() error { | ||
|
|
||
There was a problem hiding this comment.
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
boolvalues, you can skip the if statement. The result is the same:boolisfalseifin this case only sets theRunnerSpecvalue if the extra spec istrueThis is all for future reference. Saves lines of code and simplifies code paths.