-
Notifications
You must be signed in to change notification settings - Fork 214
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
Handle multiple apps returned by SAML app data source, where one app exactly matches. #1894
base: master
Are you sure you want to change the base?
Handle multiple apps returned by SAML app data source, where one app exactly matches. #1894
Conversation
…exactly matches. In the case where there are two apps: "MyApp" and "MyApp 2". If the data source for saml apps queried with label "MyApp", if the API returns "MyApp 2" as the first app in the list, the data source will fail. This change now iterate through all of the apps returned and returning an exact match, if "label" has been specified.
@MatthewJohn Thanks. We will review it |
Thanks @duytiennguyen-okta :) |
for _, appItx := range appList { | ||
if appItx.Label == filters.Label { | ||
app = appItx | ||
foundMatch = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should break here, similar to https://github.com/okta/terraform-provider-okta/blob/master/okta/data_source_okta_app.go#L111?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh course, yes, apologies!
If you're ok with the suggestion, I will bring the PR in and update it @MatthewJohn |
In the case where there are two apps: "MyApp" and "MyApp 2".
If the data source for saml apps queried with label "MyApp" and the API returns "MyApp 2" as the first app in the list, the data source will fail.
This change now iterates through all of the apps returned and returning an exact match, if "label" has been specified.