From 16aa97a151c3e0ad879789865b2e8dacdfcf4078 Mon Sep 17 00:00:00 2001 From: lreciomelero Date: Tue, 14 Feb 2023 12:09:38 +0100 Subject: [PATCH] fixed --retain bug --- pkg/cluster/createoption.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/createoption.go b/pkg/cluster/createoption.go index 0c76f6c0a8..b93ab55307 100644 --- a/pkg/cluster/createoption.go +++ b/pkg/cluster/createoption.go @@ -81,11 +81,17 @@ func CreateWithRetain(retain bool) CreateOption { } func CreateWithMove(move bool) CreateOption { - return CreateWithRetain(move) + return createOptionAdapter(func(o *internalcreate.ClusterOptions) error { + o.Retain = move || o.Retain + return nil + }) } func CreateWithAvoidCreation(avoidCreation bool) CreateOption { - return CreateWithRetain(avoidCreation) + return createOptionAdapter(func(o *internalcreate.ClusterOptions) error { + o.Retain = avoidCreation || o.Retain + return nil + }) } // CreateWithWaitForReady configures a maximum wait time for the control plane