Skip to content

fix: relax updates #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions internal/provider/crontab_entry_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ func (r *CronTabEntryResource) Update(ctx context.Context, req resource.UpdateRe
}

if !removed {
resp.Diagnostics.AddError("Not Found", fmt.Sprintf("Unable to update crontab entry, got error: %s", err))
return
resp.Diagnostics.AddWarning("Not Found", fmt.Sprintf("Unable to update crontab entry, got error: %s", err))
}

err = r.client.CrontabEntryAdd(planning.Entry.ValueString())
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/mysql_database_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ func (r *MySQLDatabaseResource) Update(ctx context.Context, req resource.UpdateR
planningDatabaseName := r.databaseName(planning.Suffix.ValueString())

if err := r.client.MySQLDatabaseDrop(stateDatabaseName); err != nil {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to update mysql database, got error: %s", err))
return
resp.Diagnostics.AddWarning("Client Error", fmt.Sprintf("Unable to update mysql database, got error: %s", err))
}

if err := r.client.MySQLDatabaseCreate(planningDatabaseName); err != nil {
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/supervisord_service_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ func (r *SupervisorServiceResource) Update(ctx context.Context, req resource.Upd
}

if err := r.client.SupervisorServiceRemove(r.client.User, state.Name.ValueString()); err != nil {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to update supervisor service, got error: %s", err))
return
resp.Diagnostics.AddWarning("Client Error", fmt.Sprintf("Unable to update supervisor service, got error: %s", err))
}

if err := r.client.SupervisorServiceCreate(
Expand Down
3 changes: 1 addition & 2 deletions internal/provider/web_domain_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ func (r *WebDomainResource) Update(ctx context.Context, req resource.UpdateReque
}

if err := r.client.WebDomainDelete(state.Domain.ValueString()); err != nil {
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to update web domain, got error: %s", err))
return
resp.Diagnostics.AddWarning("Client Error", fmt.Sprintf("Unable to update web domain, got error: %s", err))
}

if err := r.client.WebDomainAdd(planning.Domain.ValueString()); err != nil {
Expand Down
Loading