Skip to content

Commit f207f90

Browse files
change --legacy to --latest to switch v1 to default (#1111)
1 parent 32e4786 commit f207f90

File tree

9 files changed

+30
-34
lines changed

9 files changed

+30
-34
lines changed

.github/workflows/pull_request.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,22 @@ jobs:
141141

142142
- name: Write out basic config
143143
run: |
144-
cat << EOF > test.yaml
144+
cat << EOF > test.cfg
145145
---
146-
version: 2
147-
local-only:
148-
local: true
146+
- local-only:
149147
150-
control-services:
151-
- service: control
148+
- control-service:
149+
service: control
152150
filename: /tmp/receptor.sock
153151
154-
work-commands:
155-
- worktype: cat
152+
- work-command:
153+
worktype: cat
156154
command: cat
157155
EOF
158156
159157
- name: Run receptor (and wait a few seconds for it to boot)
160158
run: |
161-
podman run --name receptor -d -v $PWD/test.yaml:/etc/receptor/receptor.yaml:Z localhost/receptor
159+
podman run --name receptor -d -v $PWD/test.cfg:/etc/receptor/receptor.conf:Z localhost/receptor
162160
sleep 3
163161
podman logs receptor
164162

cmd/receptor-cl/receptor.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import (
1313
)
1414

1515
func main() {
16-
var legacy bool
16+
var isV2 bool
1717
newArgs := []string{}
1818
for _, arg := range os.Args {
19-
if arg == "--legacy" {
20-
legacy = true
19+
if arg == "--config-v2" {
20+
isV2 = true
2121

2222
continue
2323
}
@@ -26,10 +26,10 @@ func main() {
2626

2727
os.Args = newArgs
2828

29-
if !legacy {
29+
if isV2 {
30+
fmt.Println("Running v2 cli/config")
3031
cmd.Execute()
3132
} else {
32-
fmt.Println("Running old cli/config")
3333
cmd.RunConfigV1()
3434
}
3535

packaging/container/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ LABEL version="${VERSION}"
1919

2020
COPY receptorctl-${VERSION}-py3-none-any.whl /tmp
2121
COPY receptor_python_worker-${VERSION}-py3-none-any.whl /tmp
22-
COPY receptor.yaml /etc/receptor/receptor.yaml
22+
COPY receptor.conf /etc/receptor/receptor.conf
2323

2424
RUN dnf -y update && \
2525
dnf -y install python3.12-pip && \
@@ -36,4 +36,4 @@ ENV RECEPTORCTL_SOCKET=/tmp/receptor.sock
3636
EXPOSE 7323
3737

3838
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
39-
CMD ["/usr/bin/receptor", "--config", "/etc/receptor/receptor.yaml"]
39+
CMD ["/usr/bin/receptor", "-c", "/etc/receptor/receptor.conf"]

packaging/container/receptor.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
- control-service:
3+
service: control
4+
filename: /tmp/receptor.sock
5+
6+
- tcp-listener:
7+
port: 7323

packaging/container/receptor.yaml

Lines changed: 0 additions & 8 deletions
This file was deleted.

packaging/tc-image/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ FROM receptor:latest
33
RUN dnf install tc -y
44

55
ENTRYPOINT ["/bin/bash"]
6-
CMD ["-c", "/usr/bin/receptor --legacy --config /etc/receptor/receptor.conf > /etc/receptor/stdout 2> /etc/receptor/stderr"]
6+
CMD ["-c", "/usr/bin/receptor --config /etc/receptor/receptor.conf > /etc/receptor/stdout 2> /etc/receptor/stderr"]

pkg/workceptor/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ func (cw *commandUnit) Start() error {
269269
receptorBin = "receptor"
270270
}
271271

272-
cmd := exec.Command(receptorBin, "--legacy", "--node", "id=worker",
272+
cmd := exec.Command(receptorBin, "--node", "id=worker",
273273
"--log-level", levelName,
274274
"--command-runner",
275275
fmt.Sprintf("command=%s", cw.command),

receptorctl/tests/conftest.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ def start_nodes(receptor_mesh, receptor_nodes, receptor_bin_path):
266266
)
267267
receptor_nodes.nodes.append(
268268
subprocess.Popen(
269-
[receptor_bin_path, "--legacy", "-c", config_file],
269+
[receptor_bin_path, "-c", config_file],
270270
stdout=receptor_nodes.log_files[i],
271271
stderr=receptor_nodes.log_files[i],
272272
)
@@ -335,7 +335,6 @@ def receptor_mesh_access_control(
335335
@pytest.fixture(scope="function")
336336
def receptor_control_args(receptor_mesh):
337337
args = {
338-
"--legacy": None,
339338
"--socket": f"{receptor_mesh.get_mesh_tmp_dir()}/{receptor_mesh.socket_file_name}",
340339
"--config": None,
341340
"--tls": None,

tests/functional/cli/cli_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func ConfirmListening(pid int, proto string) (bool, error) {
2828

2929
func TestHelp(t *testing.T) {
3030
t.Parallel()
31-
cmd := exec.Command("receptor", "--legacy", "--help")
31+
cmd := exec.Command("receptor", "--help")
3232
if err := cmd.Run(); err != nil {
3333
t.Fatal(err)
3434
}
@@ -50,7 +50,7 @@ func TestListeners(t *testing.T) {
5050
t.Run(listener, func(t *testing.T) {
5151
t.Parallel()
5252
receptorStdOut := bytes.Buffer{}
53-
cmd := exec.Command("receptor", "--legacy", "--node", "id=test", listener, "port=0")
53+
cmd := exec.Command("receptor", "--node", "id=test", listener, "port=0")
5454
cmd.Stdout = &receptorStdOut
5555
err := cmd.Start()
5656
if err != nil {
@@ -98,7 +98,7 @@ func TestSSLListeners(t *testing.T) {
9898
if err != nil {
9999
t.Fatal(err)
100100
}
101-
cmd := exec.Command("receptor", "--legacy", "--node", "id=test", "--tls-server", "name=server-tls", fmt.Sprintf("cert=%s", crt), fmt.Sprintf("key=%s", key), listener, fmt.Sprintf("port=%d", port), "tls=server-tls")
101+
cmd := exec.Command("receptor", "--node", "id=test", "--tls-server", "name=server-tls", fmt.Sprintf("cert=%s", crt), fmt.Sprintf("key=%s", key), listener, fmt.Sprintf("port=%d", port), "tls=server-tls")
102102
cmd.Stdout = &receptorStdOut
103103
err = cmd.Start()
104104
if err != nil {
@@ -143,7 +143,7 @@ func TestNegativeCost(t *testing.T) {
143143
t.Run(listener, func(t *testing.T) {
144144
t.Parallel()
145145
receptorStdOut := bytes.Buffer{}
146-
cmd := exec.Command("receptor", "--legacy", "--node", "id=test", listener, "port=0", "cost=-1")
146+
cmd := exec.Command("receptor", "--node", "id=test", listener, "port=0", "cost=-1")
147147
cmd.Stdout = &receptorStdOut
148148
err := cmd.Start()
149149
if err != nil {
@@ -185,7 +185,7 @@ func TestCostMap(t *testing.T) {
185185
t.Run(costMapCopy, func(t *testing.T) {
186186
t.Parallel()
187187
receptorStdOut := bytes.Buffer{}
188-
cmd := exec.Command("receptor", "--legacy", "--node", "id=test", listener, "port=0", fmt.Sprintf("nodecost=%s", costMapCopy))
188+
cmd := exec.Command("receptor", "--node", "id=test", listener, "port=0", fmt.Sprintf("nodecost=%s", costMapCopy))
189189
cmd.Stdout = &receptorStdOut
190190
err := cmd.Start()
191191
if err != nil {
@@ -235,7 +235,7 @@ func TestCosts(t *testing.T) {
235235
t.Run(costCopy, func(t *testing.T) {
236236
t.Parallel()
237237
receptorStdOut := bytes.Buffer{}
238-
cmd := exec.Command("receptor", "--legacy", "--node", "id=test", listener, "port=0", fmt.Sprintf("cost=%s", costCopy))
238+
cmd := exec.Command("receptor", "--node", "id=test", listener, "port=0", fmt.Sprintf("cost=%s", costCopy))
239239
cmd.Stdout = &receptorStdOut
240240
err := cmd.Start()
241241
if err != nil {

0 commit comments

Comments
 (0)