Skip to content

Commit

Permalink
Agentctl (ligato#1425)
Browse files Browse the repository at this point in the history
* Add make target for installing agentctl

Signed-off-by: Ondrej Fabry <[email protected]>

* Define version parameter for root command

Signed-off-by: Ondrej Fabry <[email protected]>

* Remove separate version command

Signed-off-by: Ondrej Fabry <[email protected]>

* Cleanup commands

Signed-off-by: Ondrej Fabry <[email protected]>

* Update copyrights and optimize imports

Signed-off-by: Ondrej Fabry <[email protected]>

* Define cli package

Signed-off-by: Ondrej Fabry <[email protected]>

* Refactor subcommands for agentctl

Signed-off-by: Ondrej Fabry <[email protected]>

* Cleanup import and vppcli commands

Signed-off-by: Ondrej Fabry <[email protected]>

* Use ETCD_ENDPOINTS env var

Signed-off-by: Ondrej Fabry <[email protected]>

* Fix flags for grpc/http port

Signed-off-by: Ondrej Fabry <[email protected]>

* Add get/put/del as config subcommands

Signed-off-by: Ondrej Fabry <[email protected]>

* Cleanup dump command

Signed-off-by: Ondrej Fabry <[email protected]>

* Fix deps

Signed-off-by: Ondrej Fabry <[email protected]>

* Fix log list

Signed-off-by: Ondrej Fabry <[email protected]>

* Cleanup global flags and some commands

Signed-off-by: Ondrej Fabry <[email protected]>

* Sort loggers and use template

Signed-off-by: Ondrej Fabry <[email protected]>

* Improve log list and add new command model

Signed-off-by: Ondrej Fabry <[email protected]>

* Improve model subcommands

Signed-off-by: Ondrej Fabry <[email protected]>

* Cleanup models command

Signed-off-by: Ondrej Fabry <[email protected]>

* Run dep ensure

Signed-off-by: Ondrej Fabry <[email protected]>

* Allow changing root command name and make separate vpp command

Signed-off-by: Ondrej Fabry <[email protected]>

* Use models in dump command and print as table

Signed-off-by: Ondrej Fabry <[email protected]>

* Cleanup dump code

Signed-off-by: Ondrej Fabry <[email protected]>

* Cleanup commands

Signed-off-by: Ondrej Fabry <[email protected]>

* Update generate command

Signed-off-by: Ondrej Fabry <[email protected]>

* Cleanup command usage template and allow listing keys

Signed-off-by: Ondrej Fabry <[email protected]>

* Cleanup naming

Signed-off-by: Ondrej Fabry <[email protected]>

* Fix import command

Signed-off-by: Ondrej Fabry <[email protected]>

* Add status command

Signed-off-by: Ondrej Fabry <[email protected]>

* Remove blank lines

Signed-off-by: Ondrej Fabry <[email protected]>

* Print info message and error for log set

Signed-off-by: Ondrej Fabry <[email protected]>

* Update cn-infra

Signed-off-by: Ondrej Fabry <[email protected]>

* Define proper defaults for global flags

Signed-off-by: Ondrej Fabry <[email protected]>

* Fix global flags

Signed-off-by: Ondrej Fabry <[email protected]>

* Satisfy linter

Signed-off-by: Ondrej Fabry <[email protected]>
  • Loading branch information
ondrej-fabry authored and VladoLavor committed Oct 4, 2019
1 parent 16e60de commit 9033d3f
Show file tree
Hide file tree
Showing 45 changed files with 6,506 additions and 2,237 deletions.
16 changes: 14 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,7 @@ required = [
[[prune.project]]
name = "github.com/gogo/protobuf"
unused-packages = false

[[constraint]]
branch = "master"
name = "github.com/common-nighthawk/go-figure"
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ agent:
@echo "=> installing agent ${VERSION}"
@go install -ldflags "${LDFLAGS}" -tags="${GO_BUILD_TAGS}" ${GO_BUILD_ARGS} ./cmd/vpp-agent

agentctl:
@echo "=> installing agentctl ${VERSION}"
@go install -ldflags "${LDFLAGS}" -tags="${GO_BUILD_TAGS}" ${GO_BUILD_ARGS} ./cmd/agentctl

install:
@echo "=> installing ${VERSION}"
go install -ldflags "${LDFLAGS}" -tags="${GO_BUILD_TAGS}" ${GO_BUILD_ARGS} ./cmd/vpp-agent
Expand Down
37 changes: 32 additions & 5 deletions cmd/agentctl/agentctl.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
// Copyright (c) 2019 Cisco and/or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package main

import (
"fmt"
"os"

"github.com/ligato/vpp-agent/cmd/agentctl/cmd"
"github.com/ligato/vpp-agent/cmd/agentctl/commands"
)

const logo = `
___ __ ________ __
/ | ____ ____ ____ / /_/ ____/ /_/ /
/ /| |/ __ '/ _ \/ __ \/ __/ / / __/ /
/ ___ / /_/ / __/ / / / /_/ /___/ /_/ /
/_/ |_\__, /\___/_/ /_/\__/\____/\__/_/
/____/
`

func main() {
if err := cmd.RootCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
cli := commands.NewAgentCli()

agentCtl := commands.NewRootCommand(cli)
agentCtl.Long = logo

if err := agentCtl.Execute(); err != nil {
os.Exit(-1)
}
}
57 changes: 0 additions & 57 deletions cmd/agentctl/cmd/del.go

This file was deleted.

Loading

0 comments on commit 9033d3f

Please sign in to comment.