Skip to content

Commit

Permalink
fix: return err
Browse files Browse the repository at this point in the history
  • Loading branch information
fanriming committed Feb 28, 2021
1 parent 482e6f7 commit 9dc0690
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/controller/vpc_nat_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,12 +272,6 @@ func (c *Controller) handleAddOrUpdateVpcNatGw(key string) error {
return nil
}

//if _, err := c.config.KubeClient.AppsV1().Deployments(c.config.PodNamespace).
// Update(context.Background(), newDp, metav1.UpdateOptions{}); err != nil {
// klog.Errorf("failed to update deployment %s, err: %v", newDp.Name, err)
// return err
//}

pod, err := c.getNatGwPod(key)
if err != nil {
if k8serrors.IsNotFound(err) {
Expand Down Expand Up @@ -337,7 +331,7 @@ func (c *Controller) handleInitVpcNatGw(key string) error {

if pod.Status.Phase != corev1.PodRunning {
time.Sleep(5 * 1000)
return nil
return fmt.Errorf("failed to init vpc nat gateway, pod is not ready.")
}

if _, hasInit := pod.Annotations[util.VpcNatGatewayInitAnnotation]; hasInit {
Expand Down

0 comments on commit 9dc0690

Please sign in to comment.