Skip to content

Commit

Permalink
fix: lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: francesco-racciatti <[email protected]>
  • Loading branch information
francesco-racciatti committed Aug 3, 2023
1 parent 83d91c3 commit fd015f0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
21 changes: 17 additions & 4 deletions sysdig/data_source_sysdig_fargate_ECS_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func getKiltRecipe(t *testing.T) string {
return string(jsonRecipeConfig)
}

func testContains(t *testing.T) {
func TestContains(t *testing.T) {
tests := []struct {
slice []string
target string
Expand Down Expand Up @@ -128,19 +128,32 @@ func TestNewPatchOptions(t *testing.T) {
// Create a mock resource
resource := newMockResource()
data := resource.Data(nil)
data.Set("bare_pdig_on_containers", []interface{}{

var err error
err = data.Set("bare_pdig_on_containers", []interface{}{
"gimme", "fried", "chicken",
})
data.Set("ignore_containers", []interface{}{
if err != nil {
assert.FailNow(t, fmt.Sprintf("Could not set bare_pdig_on_containers, got error: %v", err))
}

err = data.Set("ignore_containers", []interface{}{
"gimme", "fried", "chicken",
})
data.Set("log_configuration", []interface{}{
if err != nil {
assert.FailNow(t, fmt.Sprintf("Could not set ignore_containers, got error: %v", err))
}

err = data.Set("log_configuration", []interface{}{
map[string]interface{}{
"group": "gimme",
"stream_prefix": "fried",
"region": "chicken",
},
})
if err != nil {
assert.FailNow(t, fmt.Sprintf("Could not set log_configuration, got error: %v", err))
}

// Expected vs actual
expectedPatchOptions := &patchOptions{
Expand Down
5 changes: 4 additions & 1 deletion sysdig/data_source_sysdig_fargate_workload_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ func fargatePostKiltModifications(patchedBytes []byte, patchOpts *patchOptions)
"Name": "__INSTRUMENTATION_WRAPPER",
"Value": "/opt/draios/bin/pdig,-C,-t,-1",
}
container.ArrayAppend(envars, "Environment")
err := container.ArrayAppend(envars, "Environment")
if err != nil {
return nil, fmt.Errorf("failed to extend environment variables: %s", err)
}
}
}
}
Expand Down

0 comments on commit fd015f0

Please sign in to comment.