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

initial ephemeral poc #11824

Draft
wants to merge 7 commits into
base: FEATURE-BRANCH-ephemeral-resource
Choose a base branch
from

Conversation

BBBmau
Copy link
Collaborator

@BBBmau BBBmau commented Sep 25, 2024

initial work of supporting ephemeral resource service_account_token

Has the base code for supporting ephemerals which is including in the provider config itslef. Still requires some work on supprting services such as IAMCredentialsBasePath which is crucial for supporting both service_account_token and service_account_jwt

Although this PR covers all of them we should only really focus on service_account_token.

This PR can easily be closed and opened again to make the ephemeral development process much smoother.

Release Note Template for Downstream PRs (will be copied)


@SarahFrench
Copy link
Collaborator

Making a note: the Go rewrite was just merged into the feature branch via the sync PR. This has caused some conflicts, and the .go.erb files are no longer valid

@SarahFrench SarahFrench changed the base branch from FEATURE-BRANCH-ephemeral-resources to FEATURE-BRANCH-ephemeral-resource September 26, 2024 20:25
Copy link
Collaborator

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

Looks like a good start, thanks for opening this PR to show the POC!

I think our next steps should be to:

  • Open a PR that adds support for ephemeral resources but includes none.
  • Open a PR that pulls out the ephemeral_service_account_access_token work and completes it, along with acc tests, and does that in a way that's not blocked by the muxing fixes
    • i.e. we'll get my muxing fixes merged, into the feature branch via a sync, and then rebase any open PRs we have

return
}

// Required for accessing project, region, zone and tokenSource
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit

Suggested change
// Required for accessing project, region, zone and tokenSource

Comment on lines +1 to +4
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

// EphemeralResources defines the resources that are of ephemral type implemented in the provider.
func (p *FrameworkProvider) EphemeralResources(_ context.Context) []func() ephemeral.EphemeralResource {
return []func() ephemeral.EphemeralResource{
eph.GoogleEphemeralServiceAccountAccessToken,
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know you're aware of it, but making a note: these ephemeral resources should be moved into the same package as the original data sources they resemble.

@@ -517,6 +517,20 @@ func (p *FrameworkProviderConfig) SetupGrpcLogging() {
)
}

func (p *FrameworkProviderConfig) NewIamCredentialsClient(userAgent string) *iamcredentials.Service {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Once my muxing fixes PR is merged the plugin-framework side of the provider will use the SDK-flavoured Config struct, which already has this method implemented and you can use directly in the code of this PR's work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Given the timelines of this project and getting the muxing fixes merged, I think we'll have to go ahead with this as a temporary fix to unblock ourselves 😬

SarahFrench

This comment was marked as outdated.

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