Skip to content

Commit

Permalink
update error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
1riatsila1 committed Sep 3, 2024
1 parent b169f0e commit 75709ce
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions pkg/config-api-provider/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,27 +79,27 @@ func (p *uxiConfigurationProvider) Configure(ctx context.Context, req provider.C
if config.Host.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root("host"),
"Unknown HashiCups API Host",
"The provider cannot create the HashiCups API client as there is an unknown configuration value for the HashiCups API host. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the HASHICUPS_HOST environment variable.",
"Unknown UXI API Host",
"The provider cannot create the UXI API client as there is an unknown configuration value for the UXI API host. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the UXI_HOST environment variable.",
)

Check warning on line 85 in pkg/config-api-provider/provider/provider.go

View check run for this annotation

Codecov / codecov/patch

pkg/config-api-provider/provider/provider.go#L80-L85

Added lines #L80 - L85 were not covered by tests
}

if config.ClientID.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root("client_id"),
"Unknown HashiCups API Password",
"The provider cannot create the HashiCups API client as there is an unknown configuration value for the HashiCups API password. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the HASHICUPS_PASSWORD environment variable.",
"Unknown Client ID",
"The provider cannot create the UXI API client as there is an unknown configuration value for the Client ID. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the CLIENT_ID environment variable.",
)

Check warning on line 94 in pkg/config-api-provider/provider/provider.go

View check run for this annotation

Codecov / codecov/patch

pkg/config-api-provider/provider/provider.go#L89-L94

Added lines #L89 - L94 were not covered by tests
}

if config.ClientSecret.IsUnknown() {
resp.Diagnostics.AddAttributeError(
path.Root("client_secret"),
"Unknown HashiCups API Password",
"The provider cannot create the HashiCups API client as there is an unknown configuration value for the HashiCups API password. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the HASHICUPS_PASSWORD environment variable.",
"Unknown Client Secret",
"The provider cannot create the UXI API client as there is an unknown configuration value for the Client Secret. "+
"Either target apply the source of the value first, set the value statically in the configuration, or use the CLIENT_SECRET environment variable.",
)

Check warning on line 103 in pkg/config-api-provider/provider/provider.go

View check run for this annotation

Codecov / codecov/patch

pkg/config-api-provider/provider/provider.go#L98-L103

Added lines #L98 - L103 were not covered by tests
}

Expand Down Expand Up @@ -129,29 +129,29 @@ func (p *uxiConfigurationProvider) Configure(ctx context.Context, req provider.C
if host == "" {
resp.Diagnostics.AddAttributeError(
path.Root("host"),
"Missing HashiCups API Host",
"The provider cannot create the HashiCups API client as there is a missing or empty value for the HashiCups API host. "+
"Set the host value in the configuration or use the HASHICUPS_HOST environment variable. "+
"Missing UXI API Host",
"The provider cannot create the UXI API client as there is a missing or empty value for the UXI API host. "+
"Set the host value in the configuration or use the UXI_HOST environment variable. "+
"If either is already set, ensure the value is not empty.",
)

Check warning on line 136 in pkg/config-api-provider/provider/provider.go

View check run for this annotation

Codecov / codecov/patch

pkg/config-api-provider/provider/provider.go#L130-L136

Added lines #L130 - L136 were not covered by tests
}

if clientID == "" {
resp.Diagnostics.AddAttributeError(
path.Root("client_id"),
"Missing HashiCups API Password",
"The provider cannot create the HashiCups API client as there is a missing or empty value for the HashiCups API password. "+
"Set the password value in the configuration or use the HASHICUPS_PASSWORD environment variable. "+
"Missing Client ID",
"The provider cannot create the UXI API client as there is a missing or empty value for the Client ID. "+
"Set the Client ID value in the configuration or use the CLIENT_ID environment variable. "+
"If either is already set, ensure the value is not empty.",
)

Check warning on line 146 in pkg/config-api-provider/provider/provider.go

View check run for this annotation

Codecov / codecov/patch

pkg/config-api-provider/provider/provider.go#L140-L146

Added lines #L140 - L146 were not covered by tests
}

if clientSecret == "" {
resp.Diagnostics.AddAttributeError(
path.Root("client_secret"),
"Missing HashiCups API Password",
"The provider cannot create the HashiCups API client as there is a missing or empty value for the HashiCups API password. "+
"Set the password value in the configuration or use the HASHICUPS_PASSWORD environment variable. "+
"Missing Client Secret",
"The provider cannot create the UXI API client as there is a missing or empty value for the Client Secret. "+
"Set the Client Secret value in the configuration or use the CLIENT_SECRET environment variable. "+
"If either is already set, ensure the value is not empty.",
)

Check warning on line 156 in pkg/config-api-provider/provider/provider.go

View check run for this annotation

Codecov / codecov/patch

pkg/config-api-provider/provider/provider.go#L150-L156

Added lines #L150 - L156 were not covered by tests
}
Expand Down

0 comments on commit 75709ce

Please sign in to comment.