constellation-lib: fix incorrect encoding and ordering of Init response (#2708)

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2023-12-12 15:01:56 +01:00 committed by GitHub
parent 0512cfccd7
commit d08e75bf9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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