From 8c5747c588004132c0c8efe7d9ea638fdfa1e581 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Mon, 3 Jul 2023 11:38:36 -0700 Subject: [PATCH 1/2] Warn that v1.28 will deprecate reencrypt/prepare Signed-off-by: Derek Nola --- pkg/cli/secretsencrypt/secrets_encrypt.go | 3 +++ pkg/server/secrets-encrypt.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/pkg/cli/secretsencrypt/secrets_encrypt.go b/pkg/cli/secretsencrypt/secrets_encrypt.go index d1fa095300b5..02e50c1e626e 100644 --- a/pkg/cli/secretsencrypt/secrets_encrypt.go +++ b/pkg/cli/secretsencrypt/secrets_encrypt.go @@ -16,6 +16,7 @@ import ( "github.com/k3s-io/k3s/pkg/server" "github.com/k3s-io/k3s/pkg/version" "github.com/pkg/errors" + "github.com/sirupsen/logrus" "github.com/urfave/cli" "k8s.io/utils/pointer" ) @@ -151,6 +152,7 @@ func Prepare(app *cli.Context) error { if err = cmds.InitLogging(); err != nil { return err } + logrus.Warnln("This command will be deprecated in v1.28, rotate will subsume it") info, err := commandPrep(app, &cmds.ServerConfig) if err != nil { return err @@ -196,6 +198,7 @@ func Reencrypt(app *cli.Context) error { if err = cmds.InitLogging(); err != nil { return err } + logrus.Warnln("This command will be deprecated in v1.28, rotate will subsume it") info, err := commandPrep(app, &cmds.ServerConfig) if err != nil { return err diff --git a/pkg/server/secrets-encrypt.go b/pkg/server/secrets-encrypt.go index 0a4b20ae7c23..65d4d0ed2010 100644 --- a/pkg/server/secrets-encrypt.go +++ b/pkg/server/secrets-encrypt.go @@ -208,6 +208,7 @@ func encryptionPrepare(ctx context.Context, server *config.Control, force bool) if err := AppendNewEncryptionKey(&curKeys); err != nil { return err } + logrus.Warnln("prepare command will be deprecated in v1.28, rotate will replace it") logrus.Infoln("Adding secrets-encryption key: ", curKeys[len(curKeys)-1]) if err := secretsencrypt.WriteEncryptionConfig(server.Runtime, curKeys, true); err != nil { @@ -275,6 +276,7 @@ func encryptionReencrypt(ctx context.Context, server *config.Control, force bool if _, err = server.Runtime.Core.Core().V1().Node().Update(node); err != nil { return err } + logrus.Warnln("reencrypt command will be deprecated in v1.28, rotate will replace it") logrus.Debugf("encryption hash annotation set successfully on node: %s\n", node.ObjectMeta.Name) return nil } From 241d4e26abb395c23e612e60ea3912743aa58435 Mon Sep 17 00:00:00 2001 From: Derek Nola Date: Mon, 3 Jul 2023 11:59:10 -0700 Subject: [PATCH 2/2] Reword Signed-off-by: Derek Nola --- pkg/cli/secretsencrypt/secrets_encrypt.go | 4 ++-- pkg/server/secrets-encrypt.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/cli/secretsencrypt/secrets_encrypt.go b/pkg/cli/secretsencrypt/secrets_encrypt.go index 02e50c1e626e..0ef29e8d2fbe 100644 --- a/pkg/cli/secretsencrypt/secrets_encrypt.go +++ b/pkg/cli/secretsencrypt/secrets_encrypt.go @@ -152,7 +152,7 @@ func Prepare(app *cli.Context) error { if err = cmds.InitLogging(); err != nil { return err } - logrus.Warnln("This command will be deprecated in v1.28, rotate will subsume it") + logrus.Warnln("This command will be deprecated in v1.28, will be combined with rotate") info, err := commandPrep(app, &cmds.ServerConfig) if err != nil { return err @@ -198,7 +198,7 @@ func Reencrypt(app *cli.Context) error { if err = cmds.InitLogging(); err != nil { return err } - logrus.Warnln("This command will be deprecated in v1.28, rotate will subsume it") + logrus.Warnln("This command will be deprecated in v1.28, will be combined with rotate") info, err := commandPrep(app, &cmds.ServerConfig) if err != nil { return err diff --git a/pkg/server/secrets-encrypt.go b/pkg/server/secrets-encrypt.go index 65d4d0ed2010..c67d152522e2 100644 --- a/pkg/server/secrets-encrypt.go +++ b/pkg/server/secrets-encrypt.go @@ -208,7 +208,7 @@ func encryptionPrepare(ctx context.Context, server *config.Control, force bool) if err := AppendNewEncryptionKey(&curKeys); err != nil { return err } - logrus.Warnln("prepare command will be deprecated in v1.28, rotate will replace it") + logrus.Warnln("prepare command will be deprecated in v1.28, will be combined with rotate") logrus.Infoln("Adding secrets-encryption key: ", curKeys[len(curKeys)-1]) if err := secretsencrypt.WriteEncryptionConfig(server.Runtime, curKeys, true); err != nil { @@ -276,7 +276,7 @@ func encryptionReencrypt(ctx context.Context, server *config.Control, force bool if _, err = server.Runtime.Core.Core().V1().Node().Update(node); err != nil { return err } - logrus.Warnln("reencrypt command will be deprecated in v1.28, rotate will replace it") + logrus.Warnln("reencrypt command will be deprecated in v1.28, will be combined with rotate") logrus.Debugf("encryption hash annotation set successfully on node: %s\n", node.ObjectMeta.Name) return nil }