Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quote regexp metadata when using secret labels in regexp queries for dupe checks. #17446

Merged
merged 1 commit into from
May 30, 2024

Conversation

wallyworld
Copy link
Member

@wallyworld wallyworld commented May 30, 2024

It turns out some charms are using special chars in secret labels, including regexp symbols. As such, mongo queries which check for duplicate labels fail as the query uses a regexp. This PR is a simple fix which quotes the regexp metadata.

QA steps

$ juju exec -u controller/0 -- secret-add --label "\U.*aaa" foo=bar
secret://f15c6efa-61ec-47b5-89a6-8430e566f927/cpbuplo03na228fsolhg
$ juju exec -u controller/0 -- secret-get --label "\U.*aaa"
foo: bar
$ juju exec -u controller/0 -- secret-add --label "\U.*aaa" foo=bar
secret://f15c6efa-61ec-47b5-89a6-8430e566f927/cpbv76003na2708afobg
creating secrets: secret with label "\\U.*aaa" already exists

Links

Launchpad bug: https://bugs.launchpad.net/bugs/2058012

Jira card: JUJU-6078

Copy link
Member

@ycliuhw ycliuhw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, ty!

@wallyworld
Copy link
Member Author

/merge

@jujubot jujubot merged commit 405a837 into juju:3.4 May 30, 2024
21 of 23 checks passed
@Aflynn50 Aflynn50 mentioned this pull request May 31, 2024
jujubot added a commit that referenced this pull request May 31, 2024
#17458

Merge from 3.4 to 3.5 with no conflicts.

This merge includes the following PRs:
- #17440 from jack-w-shaw
- #17453 from hpidcock
- #17444 from Aflynn50
- #17448 from hpidcock
- #17446 from wallyworld
- #17422 from SimonRichardson
- #17436 from hpidcock
 - #17348 from jack-w-shaw
@jack-w-shaw jack-w-shaw mentioned this pull request Jun 3, 2024
jujubot added a commit that referenced this pull request Jun 3, 2024
#17461

Forward merge:
- #17348
- #17413
- #17423
- #17436
- #17422
- #17446
- #17448
- #17444
- #17453
- #17440
- #17458

Conflicts:
- acceptancetests/jujupy/client.py
- acceptancetests/jujupy/tests/test_status.py
- acceptancetests/repository/trusty/haproxy/cm.py
- acceptancetests/tests/test_jujucharm.py
- cmd/juju/cloud/addcredential.go
- core/base/base.go
- environs/bootstrap/bootstrap.go
- provider/azure/environ.go
- provider/azure/internal/imageutils/images.go
- scripts/win-installer/setup.iss
- snap/snapcraft.yaml
- version/version.go

Conflicts mostly trivial

`provider/azure/internal/imageutils/images.go` took a bit of thought. This conflict resulted from my PR #17440
@jack-w-shaw jack-w-shaw mentioned this pull request Jun 6, 2024
jujubot added a commit that referenced this pull request Jun 7, 2024
#17479

Forward merge:
- #17348
- #17413
- #17423
- #17436
- #17336
- #17422
- #17446
- #17448
- #17444
- #17453
- #17440
- #17458
- #17454
- #17461
- #17462
- #17463
- #17465
- #17469
- #17144
- #17179
- #17464
- #17476
- #17477

Conflicts:
- cmd/juju/application/bundle/bundle.go
- cmd/juju/application/bundle/bundle_test.go
- cmd/juju/application/deploy.go
- cmd/juju/application/deploy_test.go
- cmd/juju/commands/bootstrap.go
- cmd/juju/machine/add.go
- cmd/jujud-controller/agent/machine.go
- cmd/jujud/agent/machine.go
- go.mod
- go.sum
- internal/bundle/changes/changes.go
- internal/container/utils.go
- internal/container/utils_test.go
- internal/provider/azure/environ.go
- internal/provider/azure/internal/errorutils/errors_test.go
- internal/provider/azure/internal/imageutils/images.go
- internal/provider/azure/internal/imageutils/images_test.go
- internal/worker/containerbroker/broker_test.go
- internal/worker/uniter/runner/context/context.go
- internal/worker/uniter/runner/context/contextfactory.go
- internal/worker/uniter/runner/context/export_test.go
- internal/worker/uniter/runner/jujuc/relation-ids.go
- tests/includes/juju.sh
- tests/main.sh
- tests/suites/deploy/os.sh

Most conflicts were trivial to solve. Azure conflicts took a bit of thought. They emerged from [my PR](#17440)

The conflicts to `internal/worker/uniter/runner`, emerging from [this PR](#17464), took some thought, since the structure of tests had changed to mocks. The conflicts with the production code here, however, was trivial to merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants