Skip to content

Commit

Permalink
Log eniInfos to track down json.Marshall panic
Browse files Browse the repository at this point in the history
  • Loading branch information
Claes Mogren authored and mogren committed Aug 30, 2020
1 parent ba71f62 commit a953022
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/ipamd/introspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ func (c *IPAMContext) setupIntrospectionServer() *http.Server {

func eniV1RequestHandler(ipam *IPAMContext) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
responseJSON, err := json.Marshal(ipam.dataStore.GetENIInfos())
eniInfos := ipam.dataStore.GetENIInfos()
log.Debugf("eniInfos: %+v", eniInfos)
responseJSON, err := json.Marshal(eniInfos)
if err != nil {
log.Errorf("Failed to marshal ENI data: %v", err)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
Expand Down

0 comments on commit a953022

Please sign in to comment.