Skip to content

Commit

Permalink
Remove polcli and replace with pocli
Browse files Browse the repository at this point in the history
- Remove policy/cmd/polcli - the policy client that operated directly on
  the underlying stores.
- Within the docker deployment, replace it with pocli (separate package)
  that operates on top of the management REST API.

Signed-off-by: Sergei Trofimov <[email protected]>
  • Loading branch information
setrofim committed Jul 26, 2023
1 parent 3707601 commit 7dbb1e8
Show file tree
Hide file tree
Showing 19 changed files with 14 additions and 501 deletions.
2 changes: 1 addition & 1 deletion deployments/docker/env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ set +a
alias veraison="$__VERAISON_DIR/veraison"
alias cocli="$__VERAISON_DIR/veraison -- cocli"
alias evcli="$__VERAISON_DIR/veraison -- evcli"
alias polcli="$__VERAISON_DIR/veraison -- polcli"
alias pocli="$__VERAISON_DIR/veraison -- pocli"
2 changes: 1 addition & 1 deletion deployments/docker/env.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ set +a
alias veraison="$__VERAISON_DIR/veraison"
alias cocli="$__VERAISON_DIR/veraison -- cocli"
alias evcli="$__VERAISON_DIR/veraison -- evcli"
alias polcli="$__VERAISON_DIR/veraison -- polcli"
alias pocli="$__VERAISON_DIR/veraison -- pocli"
2 changes: 1 addition & 1 deletion deployments/docker/src/builder-dispatcher
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ function deploy() {
cp $BUILD_DIR/scheme/bin/* $DEPLOY_DIR/plugins/
cp $BUILD_DIR/deployments/docker/src/skey.jwk $DEPLOY_DIR/
cp $BUILD_DIR/deployments/docker/src/service-entrypoint $DEPLOY_DIR/
cp $BUILD_DIR/policy/cmd/polcli/polcli $DEPLOY_DIR/utils/
cp $gobin/evcli $DEPLOY_DIR/utils/
cp $gobin/cocli $DEPLOY_DIR/utils/
cp $gobin/pocli $DEPLOY_DIR/utils/

echo "creating config"
set -a
Expand Down
1 change: 1 addition & 0 deletions deployments/docker/src/builder.docker
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ RUN go mod download &&\
go install github.com/mitchellh/[email protected] &&\
go install github.com/veraison/corim/cocli@latest &&\
go install github.com/veraison/evcli/v2@latest &&\
go install github.com/veraison/pocli@latest &&\
go install github.com/go-delve/delve/cmd/dlv@latest

ADD --chown=builder:builder builder-dispatcher .
Expand Down
6 changes: 3 additions & 3 deletions deployments/docker/src/manager-dispatcher
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function evcli() {
/bin/bash -c "$cmd"
}

function polcli() {
local cmd="$_utils_dir/polcli $@"
function pocli() {
local cmd="$_utils_dir/pocli $@"
/bin/bash -c "$cmd"
}

Expand All @@ -80,6 +80,6 @@ case $command in
clear-logs) clear_logs "$@";;
cocli) cocli "$@";;
evcli) evcli "$@";;
polcli) polcli "$@";;
pocli) pocli "$@";;
*) echo -e "$_error: unexpected command: \"$command\"";;
esac
5 changes: 4 additions & 1 deletion deployments/docker/src/manager.docker
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ USER manager

WORKDIR /opt/veraison

ADD --chown=manager:nogroup utils/evcli utils/cocli utils/polcli ./utils/
RUN mkdir -p /home/manager/.config/pocli && \
echo "host: management-service" > /home/manager/.config/pocli/config.yaml

ADD --chown=manager:nogroup utils/evcli utils/cocli utils/pocli ./utils/
ADD --chown=manager:nogroup manager-dispatcher ./

ENTRYPOINT ["/opt/veraison/manager-dispatcher"]
Expand Down
6 changes: 3 additions & 3 deletions deployments/docker/veraison
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ function evcli() {
manager evcli $translated_args
}

function polcli() {
function pocli() {
local translated_args=$(_translate_host_paths "$@")
manager evcli $translated_args
manager pocli $translated_args
}

function help() {
Expand Down Expand Up @@ -460,7 +460,7 @@ case $command in
stop-tmux | kill-tmux) kill_tmux_session $2;;
cocli) shift; cocli $@;;
evcli) shift; evcli $@;;
polcli) shift; polcli $@;;
pocli) shift; pocli $@;;
debug) manager_debug $@;;
*) echo -e "$_error: unexpected command: \"$command\" (use -h for help)";;
esac
3 changes: 0 additions & 3 deletions policy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@

GOPKG := github.com/veraison/services/policy

SUBDIR := cmd/polcli

INTERFACES := ibackend.go

MOCKPKG := mocks
Expand All @@ -18,4 +16,3 @@ include ../mk/common.mk
include ../mk/pkg.mk
include ../mk/lint.mk
include ../mk/test.mk
include ../mk/subdir.mk
19 changes: 0 additions & 19 deletions policy/cmd/polcli/Makefile

This file was deleted.

52 changes: 0 additions & 52 deletions policy/cmd/polcli/README.md

This file was deleted.

75 changes: 0 additions & 75 deletions policy/cmd/polcli/commands/add.go

This file was deleted.

65 changes: 0 additions & 65 deletions policy/cmd/polcli/commands/common.go

This file was deleted.

49 changes: 0 additions & 49 deletions policy/cmd/polcli/commands/del.go

This file was deleted.

Loading

0 comments on commit 7dbb1e8

Please sign in to comment.