Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
Attempt to modify to resolve broken build CI

Signed-off-by: billie60 <[email protected]>
  • Loading branch information
billie60 authored Jun 16, 2023
1 parent b86d62c commit 781e6e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cmd/prefetchfiles-nri-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,18 +180,19 @@ func (p *plugin) RunPodSandbox(pod *api.PodSandbox) error {
name = parts[0]
if pod.Annotations == nil {
log.Printf("error: Pod annotations is nil")
return nil
return errors.New("Pod annotations is nil")
}
prefetchList, ok := pod.Annotations["prefetch_list"]
if !ok {
errMsg := "Pod.yaml annotations don't have prefetch list."
log.Printf("error: %s", errMsg)
return nil
return errors.New(errMsg)
}
msg := fmt.Sprintf("%s : %s", name, prefetchList)
err := sendDataOverHTTP(msg, "/api/v1/daemons/prefetch")
if err != nil {
log.Printf("Failed to send data: %v\n", err)
return err
} else {
log.Println("Data sent successfully")
}
Expand Down

0 comments on commit 781e6e6

Please sign in to comment.