From d08e75bf9c7958bacf37b6b702f698b81ca65646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= <66256922+daniel-weisse@users.noreply.github.com> Date: Tue, 12 Dec 2023 15:01:56 +0100 Subject: [PATCH] constellation-lib: fix incorrect encoding and ordering of Init response (#2708) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- internal/constellation/applyinit.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/constellation/applyinit.go b/internal/constellation/applyinit.go index 9b73a5f5a..cbec0cc2c 100644 --- a/internal/constellation/applyinit.go +++ b/internal/constellation/applyinit.go @@ -8,6 +8,7 @@ package constellation import ( "context" + "encoding/hex" "errors" "fmt" "io" @@ -121,17 +122,17 @@ func (a *Applier) Init( } return InitOutput{ - ClusterID: string(doer.resp.OwnerId), - OwnerID: string(doer.resp.ClusterId), + ClusterID: hex.EncodeToString(doer.resp.ClusterId), + OwnerID: hex.EncodeToString(doer.resp.OwnerId), Kubeconfig: kubeconfigBytes, }, nil } // InitOutput contains the output of the init RPC. type InitOutput struct { - // ClusterID is the ID of the cluster. + // ClusterID is the hex encoded ID of the cluster. ClusterID string - // OwnerID is the ID of the owner of the cluster. + // OwnerID is the hex encoded ID of the owner of the cluster. OwnerID string // Kubeconfig is the kubeconfig for the cluster. Kubeconfig []byte