mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-24 15:55:17 -04:00
terraform-provider: lock-step microservice version (#2733)
This commit is contained in:
parent
615e731855
commit
9414f29b51
11 changed files with 104 additions and 54 deletions
|
@ -11,7 +11,9 @@ package provider
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/internal/semver"
|
||||
datastruct "github.com/edgelesssys/constellation/v2/terraform-provider-constellation/internal/data"
|
||||
"github.com/hashicorp/terraform-plugin-framework/datasource"
|
||||
"github.com/hashicorp/terraform-plugin-framework/provider"
|
||||
|
@ -69,8 +71,16 @@ func (p *ConstellationProvider) Configure(ctx context.Context, req provider.Conf
|
|||
return
|
||||
}
|
||||
|
||||
ver, err := semver.New(p.version)
|
||||
if err != nil {
|
||||
resp.Diagnostics.AddError("Invalid provider version",
|
||||
fmt.Sprintf("Expected a valid semantic version, got %s: %s", p.version, err),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
config := datastruct.ProviderData{
|
||||
Version: p.version,
|
||||
Version: ver,
|
||||
}
|
||||
|
||||
// Make the clients available during data source and resource "Configure" methods.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue