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

Fix issue 944 - allow org users to read shared catalogs #949

Merged
merged 16 commits into from
Dec 5, 2022

Conversation

dataclouder
Copy link
Contributor

@dataclouder dataclouder commented Dec 1, 2022

Address issue #944

  • Fix title of catalog operations guide

  • Add functions to find a catalog without its Org

    These changes fix the problem of a catalog that was shared
    to the current org, but a tenant could not retrieve it
    for lack of privileges.
    It also fixes the case when multiple catalogs with the same
    name are available in the organization.
    The new functions search for catalogs without need of accessing
    the sharing organization.
    Also added a new 'is_local' property to all catalog resources and data sources.
    This property tells whether the catalog was created in the current org
    or not.

When there are multiple catalogs with the same name in one Org, and users attempt retrieving a data source, there are two possibilities:

  1. They know the name of the sharing organization, from where the catalog comes. So they can use that name in the org field. The data source gets retrieved as if it were local.
  2. They don't know the original organization name. So they attempt to retrieve the data source, and get an error message that will help retrieving the right one:
│ Error: [catalog read DS] error retrieving catalog cat-datacloud: no records found for catalog 'cat-datacloud' from org 'datacloud-1'
│ There are catalogs with the same name from other orgs: [datacloud datacloud-2]
│
│   with data.vcd_catalog.catalog-1,
│   on config.tf line 32, in data "vcd_catalog" "catalog-1":
│   32: data "vcd_catalog" "catalog-1" {
│

Side effect: There is still a problem, which existed before, but has been made official by an appropriate error message in this PR: when searching a data source by filter (not by name), the filter only works if the Org containing the catalog is reachable by the user. Thus, it won't work for a shared catalog.

Giuseppe Maxia added 8 commits December 1, 2022 21:09
These changes fix the problem of a catalog that was shared
to the current org, but a tenant could not retrieve it
for lack of privileges.
It also fixes the case when multiple catalogs with the same
name are available in the organization.
The new functions search for catalogs without need of accessing
the sharing organization.
Also added a new  'is_local' property to all catalog resources and data sources.
This property tells whether the catalog was created in the current org
or not.

Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
Improve search as system administrator

Signed-off-by: Giuseppe Maxia <[email protected]>
@dataclouder dataclouder marked this pull request as ready for review December 2, 2022 08:25
Giuseppe Maxia added 2 commits December 2, 2022 19:36
Signed-off-by: Giuseppe Maxia <[email protected]>
@dataclouder dataclouder changed the title Fix issue 944 Fix issue 944 - allow org users to read shared catalogs Dec 5, 2022
Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
Signed-off-by: Giuseppe Maxia <[email protected]>
@dataclouder dataclouder merged commit a456623 into vmware:main Dec 5, 2022
@dataclouder dataclouder deleted the fix-issue-944 branch November 20, 2023 10:19
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.

4 participants