Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
dimuon committed Aug 17, 2023
1 parent 93593c3 commit 2ed6184
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ec/ecresource/deploymentresource/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,13 @@ func (r *Resource) read(ctx context.Context, id string, state *deploymentv2.Depl
deployment.Elasticsearch.Strategy = baseElasticsearch.Strategy.ValueStringPointer()
}

// sync Elasticsearch keystore contents if plan or state defines it:
// - all keystore entries that are not managed by the resource are left alone
// - if backend doesn't contain some keystore entry, the entry should be removed from the future state as well
if baseElasticsearch != nil && deployment.Elasticsearch != nil && !baseElasticsearch.KeystoreContents.IsNull() {
ds := baseElasticsearch.KeystoreContents.ElementsAs(ctx, &deployment.Elasticsearch.KeystoreContents, true)
diags.Append(ds...)

// response.Resources.Elasticsearch[0].Info.Metadata.Raw
keystoreContents, err := eskeystoreapi.Get(eskeystoreapi.GetParams{
API: r.client,
DeploymentID: id,
Expand Down

0 comments on commit 2ed6184

Please sign in to comment.