|
|
|
@ -18,7 +18,7 @@ import (
|
|
|
|
|
"github.com/k3s-io/k3s/pkg/version" |
|
|
|
|
"github.com/pkg/errors" |
|
|
|
|
"github.com/urfave/cli" |
|
|
|
|
"k8s.io/utils/pointer" |
|
|
|
|
"k8s.io/utils/ptr" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
func commandPrep(cfg *cmds.Server) (*clientaccess.Info, error) { |
|
|
|
@ -54,7 +54,7 @@ func Enable(app *cli.Context) error {
|
|
|
|
|
if err != nil { |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
b, err := json.Marshal(server.EncryptionRequest{Enable: pointer.Bool(true)}) |
|
|
|
|
b, err := json.Marshal(server.EncryptionRequest{Enable: ptr.To(true)}) |
|
|
|
|
if err != nil { |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
@ -74,7 +74,7 @@ func Disable(app *cli.Context) error {
|
|
|
|
|
if err != nil { |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
b, err := json.Marshal(server.EncryptionRequest{Enable: pointer.Bool(false)}) |
|
|
|
|
b, err := json.Marshal(server.EncryptionRequest{Enable: ptr.To(false)}) |
|
|
|
|
if err != nil { |
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
@ -155,7 +155,7 @@ func Prepare(app *cli.Context) error {
|
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
b, err := json.Marshal(server.EncryptionRequest{ |
|
|
|
|
Stage: pointer.String(secretsencrypt.EncryptionPrepare), |
|
|
|
|
Stage: ptr.To(secretsencrypt.EncryptionPrepare), |
|
|
|
|
Force: cmds.ServerConfig.EncryptForce, |
|
|
|
|
}) |
|
|
|
|
if err != nil { |
|
|
|
@ -177,7 +177,7 @@ func Rotate(app *cli.Context) error {
|
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
b, err := json.Marshal(server.EncryptionRequest{ |
|
|
|
|
Stage: pointer.String(secretsencrypt.EncryptionRotate), |
|
|
|
|
Stage: ptr.To(secretsencrypt.EncryptionRotate), |
|
|
|
|
Force: cmds.ServerConfig.EncryptForce, |
|
|
|
|
}) |
|
|
|
|
if err != nil { |
|
|
|
@ -199,7 +199,7 @@ func Reencrypt(app *cli.Context) error {
|
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
b, err := json.Marshal(server.EncryptionRequest{ |
|
|
|
|
Stage: pointer.String(secretsencrypt.EncryptionReencryptActive), |
|
|
|
|
Stage: ptr.To(secretsencrypt.EncryptionReencryptActive), |
|
|
|
|
Force: cmds.ServerConfig.EncryptForce, |
|
|
|
|
Skip: cmds.ServerConfig.EncryptSkip, |
|
|
|
|
}) |
|
|
|
@ -222,7 +222,7 @@ func RotateKeys(app *cli.Context) error {
|
|
|
|
|
return err |
|
|
|
|
} |
|
|
|
|
b, err := json.Marshal(server.EncryptionRequest{ |
|
|
|
|
Stage: pointer.String(secretsencrypt.EncryptionRotateKeys), |
|
|
|
|
Stage: ptr.To(secretsencrypt.EncryptionRotateKeys), |
|
|
|
|
}) |
|
|
|
|
if err != nil { |
|
|
|
|
return err |
|
|
|
|