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

Do not panic if the pod details are not found #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chauhanshubham
Copy link
Contributor

No description provided.

hemantavi
hemantavi previously approved these changes Nov 16, 2021
@@ -677,7 +677,7 @@ func Initialize() {
// No need to save the Pod metadata, if running AMKO locally.
pod, err := kubeClient.CoreV1().Pods(gslbutils.AVISystem).Get(context.TODO(), os.Getenv("POD_NAME"), metav1.GetOptions{})
if err != nil {
gslbutils.LogAndPanic("error getting AMKO pod details: " + err.Error())
gslbutils.Warnf("Error getting AMKO pod details, %s.", err.Error())
}
amkoControlConfig.SaveAMKOPodObjectMeta(pod.DeepCopy())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't panic in 680, won't we crash here? Assuming pod is nil, pod.DeepCopy() will cause a runtime panic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right, fixed. thanks

@chauhanshubham
Copy link
Contributor Author

build amko

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants