Skip to content

Commit

Permalink
Move calicoctl binary to standard executable search path
Browse files Browse the repository at this point in the history
This change moves calicoctl binary to the standard executable search
path so that it can be found without using an absolute path.
  • Loading branch information
hjiawei committed Dec 20, 2023
1 parent e83ae81 commit 54f32e9
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions calicoctl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FROM scratch as source
ARG TARGETARCH

COPY LICENSE /licenses/LICENSE
COPY bin/calicoctl-linux-${TARGETARCH} /calicoctl
COPY bin/calicoctl-linux-${TARGETARCH} /usr/bin/calicoctl

FROM calico/base

Expand All @@ -35,4 +35,4 @@ ENV CALICO_CTL_CONTAINER=TRUE

COPY --from=source / /

ENTRYPOINT ["/calicoctl"]
ENTRYPOINT ["/usr/bin/calicoctl"]
2 changes: 1 addition & 1 deletion manifests/calicoctl-etcd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
- name: calicoctl
image: calico/ctl:master
command:
- /calicoctl
- calicoctl
args:
- version
- --poll=1m
Expand Down
2 changes: 1 addition & 1 deletion manifests/calicoctl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
- name: calicoctl
image: calico/ctl:master
command:
- /calicoctl
- calicoctl
args:
- version
- --poll=1m
Expand Down
4 changes: 2 additions & 2 deletions node/tests/k8st/infra/calicoctl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ spec:
serviceAccountName: calicoctl
containers:
- name: calicoctl
image: docker.io/calico/ctl:latest-amd64
image: calico/ctl:master
command:
- /calicoctl
- calicoctl
args:
- version
- --poll=1m
Expand Down
2 changes: 1 addition & 1 deletion node/tests/k8st/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def kubectl(args, logerr=True, allow_fail=False, allow_codes=[], timeout=0, retu
returnerr=returnerr)

def calicoctl(args, allow_fail=False):
return kubectl("exec -i -n kube-system calicoctl -- /calicoctl --allow-version-mismatch " + args,
return kubectl("exec -i -n kube-system calicoctl -- calicoctl --allow-version-mismatch " + args,
allow_fail=allow_fail)


Expand Down
2 changes: 1 addition & 1 deletion node/tests/st/utils/docker_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def calicoctl(self, command, version=None, raise_exception_on_failure=True):
if not version:
calicoctl = os.environ.get("CALICOCTL", "/code/dist/calicoctl")
else:
calicoctl = "/code/dist/calicoctl-" + version
calicoctl = "/code/dist/calicoctl" + version

if ETCD_SCHEME == "https":
etcd_auth = "%s:2379" % ETCD_HOSTNAME_SSL
Expand Down
6 changes: 3 additions & 3 deletions process/testing/winfv/create_kubeadm_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ echo "Calico is running."
kubectl taint nodes --all node-role.kubernetes.io/master-

# strict affinity
curl -O -L https://github.com/projectcalico/calicoctl/releases/download/v3.17.1/calicoctl
curl -L https://github.com/projectcalico/calico/releases/download/v3.27.0/calicoctl-linux-amd64 -o calicoctl
chmod +x calicoctl
export CALICO_DATASTORE_TYPE=kubernetes
export CALICO_KUBECONFIG=~/.kube/config
./calicoctl get node
./calicoctl ipam configure --strictaffinity=true
./calicoctl --allow-version-mismatch get node
./calicoctl --allow-version-mismatch ipam configure --strictaffinity=true
echo "ipam configured"

pushd $ROOT/infra
Expand Down

0 comments on commit 54f32e9

Please sign in to comment.