From b62445060eb7a0c909a515b5c14edfc9fbe85913 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Fri, 11 Oct 2024 19:12:54 +0000 Subject: [PATCH] Sync kine changes from k3s-io/kine#325 Signed-off-by: Brad Davidson --- pkg/rke2/rke2_linux.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/rke2/rke2_linux.go b/pkg/rke2/rke2_linux.go index 546150127d..3bf5c9e3c9 100644 --- a/pkg/rke2/rke2_linux.go +++ b/pkg/rke2/rke2_linux.go @@ -19,7 +19,7 @@ import ( "github.com/k3s-io/k3s/pkg/cli/cmds" "github.com/k3s-io/k3s/pkg/cluster/managed" "github.com/k3s-io/k3s/pkg/etcd" - "github.com/k3s-io/kine/pkg/endpoint" + "github.com/k3s-io/kine/pkg/util" "github.com/pkg/errors" "github.com/rancher/rke2/pkg/cli/defaults" "github.com/rancher/rke2/pkg/images" @@ -67,8 +67,10 @@ func initExecutor(clx *cli.Context, cfg Config, isServer bool) (*podexecutor.Sta // When the datastore sets a etcd endpoint, rke2 does not need kine with tls and changes // in the --etcd-servers inside podexecutor using ExternalDatabase - driver, _ := endpoint.ParseStorageEndpoint(cmds.ServerConfig.DatastoreEndpoint) - if !(driver == endpoint.ETCDBackend) { + scheme, _ := util.SchemeAndAddress(cmds.ServerConfig.DatastoreEndpoint) + switch scheme { + case "http", "https": + default: cmds.ServerConfig.KineTLS = true ExternalDatabase = true }