mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-24 15:55:17 -04:00
terraform-provider: fix parsing api_server_cert_sans
(#2758)
* tf: don't double quote cert sans * tf: improve provider examples
This commit is contained in:
parent
2ce73c19dc
commit
2f10223682
4 changed files with 30 additions and 14 deletions
|
@ -685,9 +685,10 @@ func (r *ClusterResource) apply(ctx context.Context, data *ClusterResourceModel,
|
|||
}
|
||||
|
||||
// parse API server certificate SANs
|
||||
apiServerCertSANs := make([]string, 0, len(data.APIServerCertSANs.Elements()))
|
||||
for _, san := range data.APIServerCertSANs.Elements() {
|
||||
apiServerCertSANs = append(apiServerCertSANs, san.String())
|
||||
apiServerCertSANs, convertDiags := r.getAPIServerCertSANs(ctx, data)
|
||||
diags.Append(convertDiags...)
|
||||
if diags.HasError() {
|
||||
return diags
|
||||
}
|
||||
|
||||
// parse network config
|
||||
|
@ -1210,6 +1211,15 @@ func (r *ClusterResource) getNetworkConfig(ctx context.Context, data *ClusterRes
|
|||
return networkCfg, diags
|
||||
}
|
||||
|
||||
func (r *ClusterResource) getAPIServerCertSANs(ctx context.Context, data *ClusterResourceModel) ([]string, diag.Diagnostics) {
|
||||
if data.APIServerCertSANs.IsNull() {
|
||||
return nil, nil
|
||||
}
|
||||
apiServerCertSANs := make([]string, 0, len(data.APIServerCertSANs.Elements()))
|
||||
diags := data.APIServerCertSANs.ElementsAs(ctx, &apiServerCertSANs, false)
|
||||
return apiServerCertSANs, diags
|
||||
}
|
||||
|
||||
// tfContextLogger is a logging adapter between the tflog package and
|
||||
// Constellation's logger.
|
||||
type tfContextLogger struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue