Deprecate service_account_email config (#610)
* Deprecate service_account_email config - it could be extracted from the JWT if needed Co-authored-by: João Palet <joao.palet@outlook.com>
This commit is contained in:
parent
100704c0f4
commit
d7e4ab2adb
5 changed files with 6 additions and 19 deletions
|
|
@ -15,7 +15,7 @@ const Separator = ","
|
|||
|
||||
type ProviderData struct {
|
||||
RoundTripper http.RoundTripper
|
||||
ServiceAccountEmail string
|
||||
ServiceAccountEmail string // Deprecated: ServiceAccountEmail is not required and will be removed after 12th June 2025.
|
||||
Region string
|
||||
ArgusCustomEndpoint string
|
||||
AuthorizationCustomEndpoint string
|
||||
|
|
|
|||
|
|
@ -62,13 +62,11 @@ func (d *projectDataSource) Configure(ctx context.Context, req datasource.Config
|
|||
if providerData.ResourceManagerCustomEndpoint != "" {
|
||||
rmClient, err = resourcemanager.NewAPIClient(
|
||||
config.WithCustomAuth(providerData.RoundTripper),
|
||||
config.WithServiceAccountEmail(providerData.ServiceAccountEmail),
|
||||
config.WithEndpoint(providerData.ResourceManagerCustomEndpoint),
|
||||
)
|
||||
} else {
|
||||
rmClient, err = resourcemanager.NewAPIClient(
|
||||
config.WithCustomAuth(providerData.RoundTripper),
|
||||
config.WithServiceAccountEmail(providerData.ServiceAccountEmail),
|
||||
)
|
||||
}
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -107,13 +107,11 @@ func (r *projectResource) Configure(ctx context.Context, req resource.ConfigureR
|
|||
ctx = tflog.SetField(ctx, "resourcemanager_custom_endpoint", providerData.ResourceManagerCustomEndpoint)
|
||||
rmClient, err = resourcemanager.NewAPIClient(
|
||||
config.WithCustomAuth(providerData.RoundTripper),
|
||||
config.WithServiceAccountEmail(providerData.ServiceAccountEmail),
|
||||
config.WithEndpoint(providerData.ResourceManagerCustomEndpoint),
|
||||
)
|
||||
} else {
|
||||
rmClient, err = resourcemanager.NewAPIClient(
|
||||
config.WithCustomAuth(providerData.RoundTripper),
|
||||
config.WithServiceAccountEmail(providerData.ServiceAccountEmail),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -278,12 +276,6 @@ func (r *projectResource) Create(ctx context.Context, req resource.CreateRequest
|
|||
containerId := model.ContainerId.ValueString()
|
||||
ctx = tflog.SetField(ctx, "project_container_id", containerId)
|
||||
|
||||
serviceAccountEmail := r.resourceManagerClient.GetConfig().ServiceAccountEmail
|
||||
if serviceAccountEmail == "" {
|
||||
core.LogAndAddError(ctx, &resp.Diagnostics, "Error creating project", "The service account e-mail cannot be empty: set it in the provider configuration or through the STACKIT_SERVICE_ACCOUNT_EMAIL or in your credentials file (default filepath is ~/.stackit/credentials.json)")
|
||||
return
|
||||
}
|
||||
|
||||
// Generate API request body from model
|
||||
payload, err := toCreatePayload(ctx, &model)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue