Skip to content
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

container funcs to return dev friendly warnings #1319

Merged
merged 3 commits into from
Jul 26, 2022
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ func fetchContainersFromAwsResource(resource jsonObj, hclBody *hclsyntax.Body, r
}
fileData, err := ioutil.ReadFile(fileLocation)
if err != nil {
zap.S().Errorf("error fetching containers from aws resource: %v", err)
zap.S().Warnf("failed to fetch containers from aws resource: %v", err)
return results
}
def = string(fileData)
}
containers := []jsonObj{}
err := json.Unmarshal([]byte(def), &containers)
if err != nil {
zap.S().Errorf("error fetching containers from aws resource: %v", err)
zap.S().Warnf("failed to fetch containers from aws resource: %v", err)
return results
}
results = getContainers(containers)
Expand All @@ -126,7 +126,7 @@ func getContainersFromhclBody(hclBody *hclsyntax.Body) (results []output.Contain
for _, arg := range funcExp.Args {
re, diags := arg.Value(nil)
if diags.HasErrors() {
zap.S().Errorf("error fetching containers from aws resource: %v", getErrorMessagesFromDiagnostics(diags))
zap.S().Warnf("failed to fetch the container from aws resource: %v", getErrorMessagesFromDiagnostics(diags))
return
}
if !re.CanIterateElements() {
Expand All @@ -137,7 +137,7 @@ func getContainersFromhclBody(hclBody *hclsyntax.Body) (results []output.Contain
_, val := it.Element()
containerTemp, err := convertCtyToGoNative(val)
if err != nil {
zap.S().Errorf("error fetching containers from aws resource: %v", err)
zap.S().Warnf("failed to fetch the container from aws resource: %v", err)
return
}
var (
Expand Down