From d10b4c352fc8550eb66e03788cb6d8ce178b1126 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Wed, 13 Jul 2022 16:05:16 +0200 Subject: [PATCH] new apinode namespace in wwapid --- internal/app/api/wwapid/wwapid.go | 12 ++++++------ internal/app/wwctl/node/add/main.go | 4 ++-- internal/app/wwctl/node/list/main.go | 4 ++-- internal/app/wwctl/node/status/main.go | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/app/api/wwapid/wwapid.go b/internal/app/api/wwapid/wwapid.go index 3ae7bf8c..0d19e29d 100644 --- a/internal/app/api/wwapid/wwapid.go +++ b/internal/app/api/wwapid/wwapid.go @@ -14,7 +14,7 @@ import ( "github.com/hpcng/warewulf/internal/pkg/api/apiconfig" "github.com/hpcng/warewulf/internal/pkg/api/container" - "github.com/hpcng/warewulf/internal/pkg/api/node" + apinode "github.com/hpcng/warewulf/internal/pkg/api/node" "github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1" "github.com/hpcng/warewulf/internal/pkg/buildconfig" "github.com/hpcng/warewulf/internal/pkg/version" @@ -241,7 +241,7 @@ func (s *apiServer) NodeAdd(ctx context.Context, request *wwapiv1.NodeAddParamet } // Add the node(s). - err = node.NodeAdd(request) + err = apinode.NodeAdd(request) if err != nil { return } @@ -264,7 +264,7 @@ func (s *apiServer) NodeDelete(ctx context.Context, request *wwapiv1.NodeDeleteP return response, status.Errorf(codes.InvalidArgument, "nil request.NodeNames") } - err = node.NodeDelete(request) + err = apinode.NodeDelete(request) return } @@ -293,7 +293,7 @@ func (s *apiServer) NodeSet(ctx context.Context, request *wwapiv1.NodeSetParamet } // Perform the NodeSet. - err = node.NodeSet(request) + err = apinode.NodeSet(request) if err != nil { return } @@ -309,7 +309,7 @@ func (s *apiServer) NodeStatus(ctx context.Context, request *wwapiv1.NodeNames) return response, status.Errorf(codes.InvalidArgument, "nil request") } - return node.NodeStatus(request.NodeNames) + return apinode.NodeStatus(request.NodeNames) } // Version returns the versions of the wwapiv1 and warewulf as well as the api @@ -331,7 +331,7 @@ func (s *apiServer) Version(ctx context.Context, request *emptypb.Empty) (respon func (s *apiServer) nodeListInternal(nodeNames []string) (response *wwapiv1.NodeListResponse, err error) { var nodes []*wwapiv1.NodeInfo - nodes, err = node.NodeList(nodeNames) + nodes, err = apinode.NodeList(nodeNames) if err != nil { return } diff --git a/internal/app/wwctl/node/add/main.go b/internal/app/wwctl/node/add/main.go index 0101729c..5e92ccf6 100644 --- a/internal/app/wwctl/node/add/main.go +++ b/internal/app/wwctl/node/add/main.go @@ -1,7 +1,7 @@ package add import ( - "github.com/hpcng/warewulf/internal/pkg/api/node" + apinode "github.com/hpcng/warewulf/internal/pkg/api/node" "github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1" "github.com/spf13/cobra" ) @@ -20,5 +20,5 @@ func CobraRunE(cmd *cobra.Command, args []string) error { Type: SetType, NodeNames: args, } - return node.NodeAdd(&nap) + return apinode.NodeAdd(&nap) } diff --git a/internal/app/wwctl/node/list/main.go b/internal/app/wwctl/node/list/main.go index 354dfae1..6580b61d 100644 --- a/internal/app/wwctl/node/list/main.go +++ b/internal/app/wwctl/node/list/main.go @@ -5,14 +5,14 @@ import ( "sort" "strings" - "github.com/hpcng/warewulf/internal/pkg/api/node" + apinode "github.com/hpcng/warewulf/internal/pkg/api/node" "github.com/hpcng/warewulf/internal/pkg/wwlog" "github.com/spf13/cobra" ) func CobraRunE(cmd *cobra.Command, args []string) (err error) { - nodeInfo, err := node.NodeList(args) + nodeInfo, err := apinode.NodeList(args) if err != nil { wwlog.Printf(wwlog.ERROR, "Could not open node configuration: %s\n", err) return diff --git a/internal/app/wwctl/node/status/main.go b/internal/app/wwctl/node/status/main.go index 771157a9..fabc338f 100644 --- a/internal/app/wwctl/node/status/main.go +++ b/internal/app/wwctl/node/status/main.go @@ -8,7 +8,7 @@ import ( "time" "github.com/fatih/color" - "github.com/hpcng/warewulf/internal/pkg/api/node" + apinode "github.com/hpcng/warewulf/internal/pkg/api/node" "github.com/hpcng/warewulf/internal/pkg/api/routes/wwapiv1" "github.com/hpcng/warewulf/internal/pkg/warewulfconf" "github.com/hpcng/warewulf/internal/pkg/wwlog" @@ -37,7 +37,7 @@ func CobraRunE(cmd *cobra.Command, args []string) (err error) { rightnow := time.Now().Unix() var nodeStatusResponse *wwapiv1.NodeStatusResponse - nodeStatusResponse, err = node.NodeStatus([]string{}) + nodeStatusResponse, err = apinode.NodeStatus([]string{}) if err != nil { return err }