app ps, app volume rm and possibly other commands match too many apps #305

Closed
opened 2022-03-25 16:07:54 +00:00 by knoflook · 3 comments
Owner

traefik -> traefik.test.domain.com
capsul -> test.domain.com

abra app ps test.domain.com returns containers from traefik and capsul, same with abra app volume rm test.domain.com

traefik -> traefik.test.domain.com capsul -> test.domain.com `abra app ps test.domain.com` returns containers from traefik and capsul, same with `abra app volume rm test.domain.com`
knoflook added the
bug
abra
labels 2022-03-25 16:07:54 +00:00
Owner

Thanks for raising, I forgot to creat this ticket myself after fixing #300 and then forgot. I believe we need to re-work how the filtering is done, it doesn't exclude the sub-string cases. Need to look into all these uses:

➜  abra (main) ✔ grep -iR "filters.Add"       
pkg/upstream/stack/stack.go:	filters.Add("label", label)
pkg/upstream/stack/stack.go:	filters.Add("name", fmt.Sprintf("%s_%s", stackName, serviceName))
cli/app/secret.go:		filters.Add("name", app.StackName())
cli/app/secret.go:		filters.Add("name", app.StackName())
cli/app/logs.go:	filters.Add("name", stackName)
cli/app/logs.go:	filters.Add("name", fmt.Sprintf("%s_%s", app.StackName(), serviceName))
cli/app/run.go:		filters.Add("name", stackAndServiceName)
cli/app/ps.go:	filters.Add("name", app.StackName())
cli/app/errors.go:		filters.Add("name", service.Name)
cli/app/cp.go:	filters.Add("name", fmt.Sprintf("%s_%s", app.StackName(), service))

Adding a ^ or some sort of end stop for the matching might work. Or we might need to load in the service names explicitly of the recipe and then do filters.Add with the exact match. That might be safer.

Thanks for raising, I forgot to creat this ticket myself after fixing https://git.coopcloud.tech/coop-cloud/organising/issues/300 and then forgot. I believe we need to re-work how the filtering is done, it doesn't exclude the sub-string cases. Need to look into all these uses: ``` ➜ abra (main) ✔ grep -iR "filters.Add" pkg/upstream/stack/stack.go: filters.Add("label", label) pkg/upstream/stack/stack.go: filters.Add("name", fmt.Sprintf("%s_%s", stackName, serviceName)) cli/app/secret.go: filters.Add("name", app.StackName()) cli/app/secret.go: filters.Add("name", app.StackName()) cli/app/logs.go: filters.Add("name", stackName) cli/app/logs.go: filters.Add("name", fmt.Sprintf("%s_%s", app.StackName(), serviceName)) cli/app/run.go: filters.Add("name", stackAndServiceName) cli/app/ps.go: filters.Add("name", app.StackName()) cli/app/errors.go: filters.Add("name", service.Name) cli/app/cp.go: filters.Add("name", fmt.Sprintf("%s_%s", app.StackName(), service)) ``` Adding a `^` or some sort of end stop for the matching might work. Or we might need to load in the service names explicitly of the recipe and then do `filters.Add` with the exact match. That might be safer.
decentral1se added this to the Beta release (software) project 2022-03-26 14:24:07 +00:00
Owner

Idk why this was closed 🤔

Would be rad if you could test coop-cloud/abra#169 💯

Idk why this was closed 🤔 Would be rad if you could test https://git.coopcloud.tech/coop-cloud/abra/pulls/169 💯
Author
Owner

yeah it's working good!

yeah it's working good!
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: coop-cloud/organising#305
No description provided.