Refactor encryption configuration (#1387)

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
Christian Mesh
2024-03-13 10:58:52 -04:00
committed by GitHub
parent 4c4d9bca67
commit 586c45fe5a
33 changed files with 86 additions and 127 deletions

View File

@@ -38,7 +38,7 @@ func (c *StateMeta) State(enc encryption.Encryption) (statemgr.Full, error) {
realState = statemgr.NewFilesystem(c.statePath, encryption.StateEncryptionDisabled()) // User specified state file should not be encrypted
} else {
// Load the backend
b, backendDiags := c.Backend(nil, enc.Backend())
b, backendDiags := c.Backend(nil, enc.State())
if backendDiags.HasErrors() {
return nil, backendDiags.Err()
}
@@ -62,7 +62,7 @@ func (c *StateMeta) State(enc encryption.Encryption) (statemgr.Full, error) {
}
// Get a local backend
localRaw, backendDiags := c.Backend(&BackendOpts{ForceLocal: true}, enc.Backend())
localRaw, backendDiags := c.Backend(&BackendOpts{ForceLocal: true}, enc.State())
if backendDiags.HasErrors() {
// This should never fail
panic(backendDiags.Err())