From 04378f0d533bcd07bc08ca61772f4a5ded5421d3 Mon Sep 17 00:00:00 2001 From: Aditya Prakash Joshi Date: Thu, 16 Dec 2021 20:21:35 +0530 Subject: [PATCH] added csr hosts for orderer node (#26) --- kubectl-hlf/cmd/ordnode/create.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/kubectl-hlf/cmd/ordnode/create.go b/kubectl-hlf/cmd/ordnode/create.go index 623dcb05..827b7f43 100644 --- a/kubectl-hlf/cmd/ordnode/create.go +++ b/kubectl-hlf/cmd/ordnode/create.go @@ -61,6 +61,14 @@ func (c *createCmd) run(args []string) error { return err } + csrHosts := []string{ + "127.0.0.1", + "localhost", + } + csrHosts = append(csrHosts, k8sIP) + csrHosts = append(csrHosts, c.ordererOpts.Name) + csrHosts = append(csrHosts, fmt.Sprintf("%s.%s", c.ordererOpts.Name, c.ordererOpts.NS)) + fabricOrderer := &v1alpha1.FabricOrdererNode{ TypeMeta: v1.TypeMeta{ Kind: "FabricOrdererNode", @@ -110,12 +118,8 @@ func (c *createCmd) run(args []string) error { Cacert: base64.StdEncoding.EncodeToString([]byte(certAuth.Status.TlsCert)), }, Csr: v1alpha1.Csr{ - Hosts: []string{ - "127.0.0.1", - "localhost", - k8sIP, - }, - CN: "", + Hosts: csrHosts, + CN: "", }, Enrollid: c.ordererOpts.EnrollID, Enrollsecret: c.ordererOpts.EnrollPW,