Skip to content

Commit

Permalink
Merge pull request #15 from ctjnkns/onos-client-path
Browse files Browse the repository at this point in the history
fix lint errors
  • Loading branch information
ctjnkns committed Jan 4, 2024
2 parents 477989f + ae53d6e commit e35bda4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion internal/provider/flows_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type flowsModel struct {
Treatment flowsTreatmentModel `tfsdk:"treatment"`
}

// flowsSelectorModel maps flow ingredients data
// flowsSelectorModel maps flow ingredients data.
type flowsSelectorModel struct {
Criteria []flowsSelectorCriteriaModel `tfsdk:"criteria"`
}
Expand Down
30 changes: 15 additions & 15 deletions internal/provider/intent_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
var (
_ resource.Resource = &intentResource{}
_ resource.ResourceWithConfigure = &intentResource{}
//_ resource.ResourceWithImportState = &intentResource{}
//_ resource.ResourceWithImportState = &intentResource{}.
)

// intentResource is the resource implementation.
Expand Down Expand Up @@ -169,12 +169,12 @@ func (r *intentResource) Create(ctx context.Context, req resource.CreateRequest,

// Generate API request body from plan
intent := onosclient.Intent{
AppID: string(plan.Intent.AppID.ValueString()),
Key: string(plan.Intent.Key.ValueString()),
Type: string(plan.Intent.Type.ValueString()),
AppID: plan.Intent.AppID.ValueString(),
Key: plan.Intent.Key.ValueString(),
Type: plan.Intent.Type.ValueString(),
Priority: int(plan.Intent.Priority.ValueInt64()),
One: string(plan.Intent.One.ValueString()),
Two: string(plan.Intent.Two.ValueString()),
One: plan.Intent.One.ValueString(),
Two: plan.Intent.Two.ValueString(),
}

// Create new intent
Expand Down Expand Up @@ -221,8 +221,8 @@ func (r *intentResource) Read(ctx context.Context, req resource.ReadRequest, res

// Get refreshed intent value from Onos
intent := onosclient.Intent{
AppID: string(state.Intent.AppID.ValueString()),
Key: string(state.Intent.Key.ValueString()),
AppID: state.Intent.AppID.ValueString(),
Key: state.Intent.Key.ValueString(),
}
intent, err := r.client.GetIntent(intent)
if err != nil {
Expand Down Expand Up @@ -262,12 +262,12 @@ func (r *intentResource) Update(ctx context.Context, req resource.UpdateRequest,

// Generate API request body from plan
intent := onosclient.Intent{
AppID: string(plan.Intent.AppID.ValueString()),
Key: string(plan.Intent.Key.ValueString()),
Type: string(plan.Intent.Type.ValueString()),
AppID: plan.Intent.AppID.ValueString(),
Key: plan.Intent.Key.ValueString(),
Type: plan.Intent.Type.ValueString(),
Priority: int(plan.Intent.Priority.ValueInt64()),
One: string(plan.Intent.One.ValueString()),
Two: string(plan.Intent.Two.ValueString()),
One: plan.Intent.One.ValueString(),
Two: plan.Intent.Two.ValueString(),
}

// Update existing intent
Expand Down Expand Up @@ -316,8 +316,8 @@ func (r *intentResource) Delete(ctx context.Context, req resource.DeleteRequest,
}
//convert to model
intent := onosclient.Intent{
AppID: string(state.Intent.AppID.ValueString()),
Key: string(state.Intent.Key.ValueString()),
AppID: state.Intent.AppID.ValueString(),
Key: state.Intent.Key.ValueString(),
}

// Delete existing intent
Expand Down
Binary file added terraform-provider-onos
Binary file not shown.

0 comments on commit e35bda4

Please sign in to comment.