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

searxng - ACL for hostPath + ixVolume migration #1688

Merged
merged 10 commits into from
Nov 24, 2023
Merged

Conversation

stavros-k
Copy link
Contributor

@stavros-k stavros-k commented Oct 30, 2023

A migration added under migrations dir for existing installations. Also a minor migration added in helm side, but that's only for CI, as we test upgrades with previous chart too. It can be safely removed on the next bump.


Related:
truenas/catalog_validation#78

Maybe we should comment out aclEntries from schema for now, until the next Cobia release?
This should allow us to perform the migration on the rest of the apps, and will only need to uncomment it when the changes are in


After this is approved and finalized, I'll proceed updating/migrating the rest of the apps

Depends on #1702

@stavros-k stavros-k added the WIP Work In Progress label Oct 30, 2023
@stavros-k stavros-k self-assigned this Oct 30, 2023
@stavros-k stavros-k requested review from Qubad786 and sonicaj October 31, 2023 16:50
@stavros-k stavros-k removed the WIP Work In Progress label Oct 31, 2023
@stavros-k stavros-k marked this pull request as ready for review October 31, 2023 16:50
Comment on lines 131 to 138
- variable: aclEntries
label: ACL Configuration
schema:
type: dict
show_if: [["aclEnable", "=", true]]
attrs: []
$ref:
- "normalize/acl"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm adding ACL entries here fails with key error (path)

https://github.com/truenas/middleware/blob/24016a463a3eb1e717b05bfaf04a6d049c8abb25/src/middlewared/middlewared/plugins/chart_releases_linux/normalize_schema.py#L184

 Error: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 426, in run
    await self.future
  File "/usr/lib/python3/dist-packages/middlewared/job.py", line 464, in __run_body
    rv = await self.method(*([self] + args))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/service/crud_service.py", line 194, in nf
    rv = await func(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 44, in nf
    res = await f(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/schema/processor.py", line 177, in nf
    return await func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/chart_release.py", line 538, in do_update
    config, context = await self.normalise_and_validate_values(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/chart_release.py", line 342, in normalise_and_validate_values
    return await self.middleware.call(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1398, in call
    return await self._call(
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1341, in _call
    return await methodobj(*prepared_call.args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/normalize_schema.py", line 42, in get_normalized_values
    values[attr.name] = await self.normalize_question(attr, values[attr.name], update, values, context)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/normalize_schema.py", line 55, in normalize_question
    value[attr.name] = await self.normalize_question(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/normalize_schema.py", line 63, in normalize_question
    value[index] = await self.normalize_question(attr, item, update, complete_config, context)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/normalize_schema.py", line 55, in normalize_question
    value[attr.name] = await self.normalize_question(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/normalize_schema.py", line 55, in normalize_question
    value[attr.name] = await self.normalize_question(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/normalize_schema.py", line 66, in normalize_question
    value = await self.middleware.call(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1398, in call
    return await self._call(
           ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/main.py", line 1341, in _call
    return await methodobj(*prepared_call.args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/normalize_schema.py", line 184, in normalize_acl
    if not value or any(not value[k] for k in ('entries', 'path')):
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/middlewared/plugins/chart_releases_linux/normalize_schema.py", line 184, in <genexpr>
    if not value or any(not value[k] for k in ('entries', 'path')):
                            ~~~~~^^^
KeyError: 'path'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay had to remove $ref normalize/acl when its under a dict with $ref normalize/ixVolume

@stavros-k stavros-k force-pushed the acl-take-two branch 4 times, most recently from 7606247 to 9dbad2c Compare November 3, 2023 14:16
@stavros-k stavros-k added the WIP Work In Progress label Nov 3, 2023
@stavros-k stavros-k marked this pull request as draft November 3, 2023 17:26
@stavros-k stavros-k changed the base branch from master to storage-template-shim November 3, 2023 17:34
@stavros-k stavros-k changed the title ACL for hostPath + ixVolume searxng - ACL for hostPath + ixVolume migration Nov 3, 2023
@stavros-k stavros-k marked this pull request as ready for review November 3, 2023 17:48
@stavros-k stavros-k removed the WIP Work In Progress label Nov 6, 2023
@stavros-k stavros-k force-pushed the storage-template-shim branch from d060c0f to 5e8e793 Compare November 6, 2023 16:25
@stavros-k stavros-k force-pushed the acl-take-two branch 2 times, most recently from 69fcc64 to cbea159 Compare November 6, 2023 17:07
@stavros-k stavros-k force-pushed the storage-template-shim branch from f5f4390 to 4fa8f75 Compare November 7, 2023 14:29
@stavros-k stavros-k force-pushed the acl-take-two branch 2 times, most recently from 488d214 to f1b687d Compare November 7, 2023 14:30
@stavros-k stavros-k force-pushed the storage-template-shim branch from 4fa8f75 to 16a2da8 Compare November 8, 2023 18:10
@stavros-k stavros-k force-pushed the storage-template-shim branch from 16a2da8 to bfac0c7 Compare November 9, 2023 14:05
@stavros-k stavros-k force-pushed the storage-template-shim branch from bfac0c7 to f2b7ad7 Compare November 10, 2023 13:17
@stavros-k stavros-k force-pushed the storage-template-shim branch from f2b7ad7 to 9545c63 Compare November 13, 2023 13:55
@stavros-k stavros-k force-pushed the storage-template-shim branch from 9545c63 to 9d32f5f Compare November 14, 2023 13:56
Base automatically changed from storage-template-shim to master November 14, 2023 20:45
@stavros-k stavros-k force-pushed the acl-take-two branch 4 times, most recently from ff15b5a to 111b5d2 Compare November 21, 2023 13:53
Copy link
Member

@sonicaj sonicaj left a comment

Choose a reason for hiding this comment

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

We should be good provided the merge conflict is resolved ofc

@stavros-k stavros-k merged commit f4df01c into master Nov 24, 2023
10 checks passed
@stavros-k stavros-k deleted the acl-take-two branch November 24, 2023 08:32
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.

2 participants