Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

Commit

Permalink
fix(nodes): add forgotten daemon base
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiggi33 committed Aug 4, 2024
1 parent 8d4ae60 commit 80238c0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/provider/node_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ func (d *nodeDataSource) Schema(ctx context.Context, req datasource.SchemaReques
Description: "The daemon SFTP of the node.",
Computed: true,
},
"daemon_base": schema.StringAttribute{
Description: "The file base of the daemon of the node",
Computed: true,
},
"created_at": schema.StringAttribute{
Description: "The creation date of the node.",
Computed: true,
Expand Down
9 changes: 9 additions & 0 deletions internal/provider/node_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type nodeResourceModel struct {
UploadSize types.Int32 `tfsdk:"upload_size"`
DaemonSFTP types.Int32 `tfsdk:"daemon_sftp"`
DaemonListen types.Int32 `tfsdk:"daemon_listen"`
DaemonBase types.String `tfsdk:"daemon_base"`
CreatedAt types.String `tfsdk:"created_at"`
UpdatedAt types.String `tfsdk:"updated_at"`
}
Expand Down Expand Up @@ -139,6 +140,10 @@ func (r *nodeResource) Schema(_ context.Context, _ resource.SchemaRequest, resp
Description: "The daemon listen of the node.",
Required: true,
},
"daemon_base": schema.StringAttribute{
Description: "The base file for the daemon of the node.",
Computed: true,
},
"created_at": schema.StringAttribute{
Description: "The creation date of the node.",
Computed: true,
Expand Down Expand Up @@ -220,6 +225,7 @@ func (r *nodeResource) Create(ctx context.Context, req resource.CreateRequest, r
plan.UploadSize = types.Int32Value(updatedNode.UploadSize)
plan.DaemonSFTP = types.Int32Value(updatedNode.DaemonSFTP)
plan.DaemonListen = types.Int32Value(updatedNode.DaemonListen)
plan.DaemonBase = types.StringValue(updatedNode.DaemonBase)
plan.CreatedAt = types.StringValue(updatedNode.CreatedAt.Format(time.RFC3339))
plan.UpdatedAt = types.StringValue(updatedNode.UpdatedAt.Format(time.RFC3339))

Expand Down Expand Up @@ -268,6 +274,7 @@ func (r *nodeResource) Read(ctx context.Context, req resource.ReadRequest, resp
state.UploadSize = types.Int32Value(node.UploadSize)
state.DaemonSFTP = types.Int32Value(node.DaemonSFTP)
state.DaemonListen = types.Int32Value(node.DaemonListen)
state.DaemonBase = types.StringValue(node.DaemonBase)
state.CreatedAt = types.StringValue(node.CreatedAt.Format(time.RFC3339))
state.UpdatedAt = types.StringValue(node.UpdatedAt.Format(time.RFC3339))

Expand Down Expand Up @@ -334,6 +341,7 @@ func (r *nodeResource) Update(ctx context.Context, req resource.UpdateRequest, r
plan.UploadSize = types.Int32Value(node.UploadSize)
plan.DaemonSFTP = types.Int32Value(node.DaemonSFTP)
plan.DaemonListen = types.Int32Value(node.DaemonListen)
plan.DaemonBase = types.StringValue(node.DaemonBase)
plan.CreatedAt = types.StringValue(node.CreatedAt.Format(time.RFC3339))
plan.UpdatedAt = types.StringValue(node.UpdatedAt.Format(time.RFC3339))

Expand Down Expand Up @@ -418,6 +426,7 @@ func (r *nodeResource) ImportState(ctx context.Context, req resource.ImportState
UploadSize: types.Int32Value(node.UploadSize),
DaemonSFTP: types.Int32Value(node.DaemonSFTP),
DaemonListen: types.Int32Value(node.DaemonListen),
DaemonBase: types.StringValue(node.DaemonBase),
CreatedAt: types.StringValue(node.CreatedAt.Format(time.RFC3339)),
UpdatedAt: types.StringValue(node.UpdatedAt.Format(time.RFC3339)),
}
Expand Down
5 changes: 5 additions & 0 deletions internal/provider/nodes_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ func (d *nodesDataSource) Schema(ctx context.Context, req datasource.SchemaReque
Description: "The daemon SFTP of the node.",
Computed: true,
},
"daemon_base": schema.StringAttribute{
Description: "The file base of the daemon of the node",
Computed: true,
},
"created_at": schema.StringAttribute{
Description: "The creation date of the node.",
Computed: true,
Expand Down Expand Up @@ -202,6 +206,7 @@ func (d *nodesDataSource) Read(ctx context.Context, req datasource.ReadRequest,
UploadSize: types.Int32Value(node.UploadSize),
DaemonListen: types.Int32Value(node.DaemonListen),
DaemonSFTP: types.Int32Value(node.DaemonSFTP),
DaemonBase: types.StringValue(node.DaemonBase),
CreatedAt: types.StringValue(node.CreatedAt.Format(time.RFC3339)),
UpdatedAt: types.StringValue(node.UpdatedAt.Format(time.RFC3339)),
})
Expand Down

0 comments on commit 80238c0

Please sign in to comment.