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 revision to Environment resource #289

Merged
merged 1 commit into from
May 30, 2024
Merged

Adding revision to Environment resource #289

merged 1 commit into from
May 30, 2024

Conversation

IaroslavTitov
Copy link
Contributor

Summary

  • Adding a revision property to Environment resource
  • Moving to a newer esc client added more dummy methods into the test file

Testing

  • Tested in devstack using Dotnet API
  • revision number changes as expected

@IaroslavTitov IaroslavTitov requested review from pgavlin and komalali May 28, 2024 21:52
@IaroslavTitov IaroslavTitov marked this pull request as ready for review May 28, 2024 21:52
@@ -14,14 +14,26 @@ import (
"github.com/stretchr/testify/assert"
)

type getEnvironmentFunc func(ctx context.Context, orgName string, envName string, decrypt bool) (yaml []byte, etag string, err error)
type getEnvironmentFunc func(ctx context.Context, orgName string, envName string, version string, decrypt bool) (yaml []byte, etag string, revision int, err error)
Copy link
Member

Choose a reason for hiding this comment

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

What is the version here?

Copy link
Contributor Author

@IaroslavTitov IaroslavTitov May 30, 2024

Choose a reason for hiding this comment

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

This function has to match the signature of GetEnvironment method inside ESC client. I bumped the version and signature of the method changed, so had to change to match as well.

Other than that, version allows to pass in either tag or revision that you want to get of this environment.

@@ -70,9 +74,11 @@ export class Environment extends pulumi.CustomResource {
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["organization"] = args ? args.organization : undefined;
resourceInputs["yaml"] = args ? args.yaml : undefined;
resourceInputs["revision"] = undefined /*out*/;
Copy link
Member

Choose a reason for hiding this comment

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

This is odd... why is it in the inputs section?

Copy link
Member

Choose a reason for hiding this comment

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

I think this is fine, I'm just not used to seeing outputs only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm guessing because it's an output only property?

@IaroslavTitov IaroslavTitov merged commit c9e1ac7 into main May 30, 2024
13 checks passed
@IaroslavTitov IaroslavTitov deleted the iaro/rev branch May 30, 2024 16:48
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