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

Adding TemplateSource resource #386

Merged
merged 2 commits into from
Aug 21, 2024
Merged

Adding TemplateSource resource #386

merged 2 commits into from
Aug 21, 2024

Conversation

IaroslavTitov
Copy link
Contributor

Summary

  • Adding TemplateSource resource, to have the ability to add templates to orgs via PSP

Testing

  • Manual test
  • Added new integ tests

@IaroslavTitov IaroslavTitov force-pushed the iaro/template branch 3 times, most recently from b598991 to 959bf2a Compare August 15, 2024 16:43
Comment on lines +92 to +94
replaceProperties := map[string]bool{
"organizationName": true,
}
Copy link
Member

Choose a reason for hiding this comment

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

just for my own knowledge why do we always replace organizationName

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So if organizationName changes, we can't update the resource, like, a TemplateSource created in one org, cannot be moved into another org.
So we have to delete old one and make new one in new org

Copy link
Member

Choose a reason for hiding this comment

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

ah ok - sorry the naming here threw me. These are properties that will trigger a replacement requirement no properties to replace.

Comment on lines +53 to +54
// This sucks, but there's not Get API for Template Sources
// Thus, using a List and then finding by ID
Copy link
Member

Choose a reason for hiding this comment

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

can you add a TODO with a ticket in pulumi-service to track adding one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}
}

return nil, nil
Copy link
Member

Choose a reason for hiding this comment

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

not entirely sure of the pattern here but if we can't find a template source do we want to raise an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't want to throw an error here, for example during refresh we expect it to be not found (if user deleted the template source, causing a drift)

I mean, I could refactor this to return NotFound error here instead and have caller handle that, but imho this way is better, since there was no error calling API, just nothing (nil) found

@IaroslavTitov IaroslavTitov merged commit 94f93ae into main Aug 21, 2024
13 checks passed
@IaroslavTitov IaroslavTitov deleted the iaro/template branch August 21, 2024 15:24
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