You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
logger.Errorf("Received err when change nc version %s in containerstatus to int, err msg %v", service.state.ContainerStatus[idx].CreateNetworkContainerRequest.Version, err)
210
-
continue
211
-
}
212
-
// host NC version is the NC version from NMAgent, if it's smaller than NC version from DNC, then append it to indicate it needs update.
logger.Errorf("Received err when change nc version %s in containerstatus to int, err msg %v", service.state.ContainerStatus[idx].CreateNetworkContainerRequest.Version, err)
210
+
continue
211
+
}
212
+
// host NC version is the NC version from NMAgent, if it's smaller than NC version from DNC, then append it to indicate it needs update.
// if we marked this NC as needs update, but it no longer exists in internal state when we reach
269
-
// this point, our internal state has changed unexpectedly and we should bail out and try again.
270
-
returnlen(programmedNCs), errors.Wrapf(errNonExistentContainerStatus, "can't find NC with ID %s in service state, stop updating this host NC version", ncID)
271
-
}
272
-
// if the NC still exists in state and is programmed to some version (doesn't have to be latest), add it to our set of NCs that have been programmed
// if we marked this NC as needs update, but it no longer exists in internal state when we reach
269
+
// this point, our internal state has changed unexpectedly and we should bail out and try again.
270
+
returnlen(programmedNCs), errors.Wrapf(errNonExistentContainerStatus, "can't find NC with ID %s in service state, stop updating this host NC version", ncID)
271
+
}
272
+
// if the NC still exists in state and is programmed to some version (doesn't have to be latest), add it to our set of NCs that have been programmed
logger.Errorf("failed to parse host nc version string %s: %s", ncInfo.HostVersion, err)
280
-
continue
281
-
}
282
-
iflocalNCVersion>nmaProgrammedNCVersion {
283
-
//nolint:staticcheck // SA1019: suppress deprecated logger.Printf usage. Todo: legacy logger usage is consistent in cns repo. Migrates when all logger usage is migrated
284
-
logger.Errorf("NC version from consolidated sources is decreasing: have %d, got %d", localNCVersion, nmaProgrammedNCVersion)
//nolint:staticcheck // SA1019: suppress deprecated logger.Printf usage. Todo: legacy logger usage is consistent in cns repo. Migrates when all logger usage is migrated
291
-
logger.Printf("Updating NC %s host version from %s to %s", ncID, ncInfo.HostVersion, nmaProgrammedNCVersionStr)
292
-
ncInfo.HostVersion=nmaProgrammedNCVersionStr
293
-
logger.Printf("Updated NC %s host version to %s", ncID, ncInfo.HostVersion)
294
-
service.state.ContainerStatus[ncID] =ncInfo
295
-
// if we successfully updated the NC, pop it from the needs update set.
296
-
delete(outdatedNCs, ncID)
297
-
}
298
-
// if we didn't empty out the needs update set, NMA has not programmed all the NCs we are expecting, and we
299
-
// need to return an error indicating that
300
-
iflen(outdatedNCs) >0 {
301
-
returnlen(programmedNCs), errors.Errorf("unable to update some NCs: %v, missing or bad response from NMA or IMDS", outdatedNCs)
logger.Errorf("failed to parse host nc version string %s: %s", ncInfo.HostVersion, err)
280
+
continue
281
+
}
282
+
iflocalNCVersion>nmaProgrammedNCVersion {
283
+
//nolint:staticcheck // SA1019: suppress deprecated logger.Printf usage. Todo: legacy logger usage is consistent in cns repo. Migrates when all logger usage is migrated
284
+
logger.Errorf("NC version from consolidated sources is decreasing: have %d, got %d", localNCVersion, nmaProgrammedNCVersion)
//nolint:staticcheck // SA1019: suppress deprecated logger.Printf usage. Todo: legacy logger usage is consistent in cns repo. Migrates when all logger usage is migrated
291
+
logger.Printf("Updating NC %s host version from %s to %s", ncID, ncInfo.HostVersion, nmaProgrammedNCVersionStr)
292
+
ncInfo.HostVersion=nmaProgrammedNCVersionStr
293
+
logger.Printf("Updated NC %s host version to %s", ncID, ncInfo.HostVersion)
294
+
service.state.ContainerStatus[ncID] =ncInfo
295
+
// if we successfully updated the NC, pop it from the needs update set.
296
+
delete(outdatedNCs, ncID)
297
+
}
298
+
// if we didn't empty out the needs update set, NMA has not programmed all the NCs we are expecting, and we
299
+
// need to return an error indicating that
300
+
iflen(outdatedNCs) >0 {
301
+
returnlen(programmedNCs), errors.Errorf("unable to update some NCs: %v, missing or bad response from NMA or IMDS", outdatedNCs)
0 commit comments