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

DXE-4661 Cp Code Data Source Functionality Bug #604

Open
Jobinator400 opened this issue Jan 21, 2025 · 3 comments
Open

DXE-4661 Cp Code Data Source Functionality Bug #604

Jobinator400 opened this issue Jan 21, 2025 · 3 comments

Comments

@Jobinator400
Copy link

Jobinator400 commented Jan 21, 2025

We have an issue where retrieving a cp code via the data source provides the wrong one/id when there are 2 or more cp codes with the same name.

Replication steps:

  1. Create a property in your group (should be a child group under contract level group)
  2. Create a cp code that will be associated to the property (name ie test)
  3. Activate the property
  4. Create a NetStorage group + upload directory (storage group name, domain prefix, and cp code name should be the same as the property's cp code, ie. test)
  5. Update the property's behavior via terraform to have an origin type of net storage (retrieving the cp id to define the behavior via cp code data source using the common name)

Assumption: Issue seems to be that the cp code data source returns the first matching instance of a cp code given a provided name, even if there's multiple matches
Issue: Performing step 5, the property type cp code id is retrieved instead of the net storage type cp code, since they both have the same name (which is discovered via UI errors, preventing an activation due to incorrect cp code id)

Potential solution(s):

  • Have the data source return all matching codes (a list return instead of single)
  • Incorporate product id in parameter to extract the appropriate cp code by type
@KonradRajda
Copy link

Hi @Jobinator400

Thanks for reporting it. I was able to reproduce this behaviour.
As an alternative to the cpcodeName you can fetch cp code datasource by cpcodeId and this way be sure that you are using correct cp code.

Does this approach solve your problem?
I will make sure that our documentation will be updated with this information.

BR,
Konrad

@KonradRajda KonradRajda changed the title Cp Code Data Source Functionality Bug DXISSUE-3100 Cp Code Data Source Functionality Bug Jan 23, 2025
@hypnotisttom
Copy link

As an alternative to the cpcodeName you can fetch cp code datasource by cpcodeId and this way be sure that you are using correct cp code.

We only have the name. We are looking it up to get the ID.

@KonradRajda KonradRajda changed the title DXISSUE-3100 Cp Code Data Source Functionality Bug DXE-4661 Cp Code Data Source Functionality Bug Jan 27, 2025
@KonradRajda
Copy link

Hi @hypnotisttom @Jobinator400

I have opened ticket for internal investigation.
We will inform you about the progress.

BR,
Konrad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants