Skip to content

Commit

Permalink
Fix for consistency error
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian-panek-vmltech committed Nov 16, 2023
1 parent a656147 commit 323e46c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/ssh/aem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ instance:
http_url: http://127.0.0.1:4503
user: admin
password: admin
run_modes: [local, duperp]
run_modes: [local]
jvm_opts:
- -server
- -Djava.awt.headless=true
Expand Down
2 changes: 1 addition & 1 deletion internal/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (c Client) RunShellPurely(cmd string) ([]byte, error) {
}
out, err := cmdObj.CombinedOutput()
if err != nil {
if len(out) > 0 { // TODO rethink error handling
if len(out) > 0 {
return nil, fmt.Errorf("cannot run command '%s': %w\n\n%s", cmdObj, err, string(out))
}
return nil, err
Expand Down
9 changes: 1 addition & 8 deletions internal/provider/instance_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (r *InstanceResource) Schema(ctx context.Context, req resource.SchemaReques
},

Attributes: map[string]schema.Attribute{
"files": schema.MapAttribute{ // TODO handle it, instead of copying lib dir
"files": schema.MapAttribute{
MarkdownDescription: "Files or directories to be copied into the machine",
ElementType: types.StringType,
Computed: true,
Expand Down Expand Up @@ -293,13 +293,6 @@ func (r *InstanceResource) Schema(ctx context.Context, req resource.SchemaReques
},
},
},
PlanModifiers: []planmodifier.List{
listplanmodifier.UseStateForUnknown(),
listplanmodifier.RequiresReplaceIf(func(ctx context.Context, request planmodifier.ListRequest, response *listplanmodifier.RequiresReplaceIfFuncResponse) {
// TODO check if: [1] list is not empty; [2] the same instances are still created; [3] dirs have not changed
// response.RequiresReplace = true
}, "If the value of this attribute changes, Terraform will destroy and recreate the resource.", "If the value of this attribute changes, Terraform will destroy and recreate the resource."),
},
},
},
}
Expand Down

0 comments on commit 323e46c

Please sign in to comment.