Skip to content

Commit

Permalink
wip: ping external ip to verify connectivity
Browse files Browse the repository at this point in the history
Signed-off-by: Quique Llorente <[email protected]>
  • Loading branch information
qinqon committed Oct 4, 2019
1 parent 05f0208 commit 09cecb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM fedora:30

RUN sudo dnf install -y nmstate iproute && \
RUN sudo dnf install -y nmstate iproute iputils && \
sudo dnf clean all

# TODO: Delete this line after we update nmstate to include the change
Expand Down
6 changes: 6 additions & 0 deletions pkg/helper/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,16 @@ func ApplyDesiredState(nodeNetworkState *nmstatev1alpha1.NodeNetworkState) (stri
}
}

err = exec.Command("ping", "-c", "3", "8.8.8.8").Run()
if err != nil {
return commandOutput, rollback(fmt.Errorf("error pinging external address after network reconfiguration"))
}

_, err = commit()
if err != nil {
return commandOutput, rollback(err)
}

commandOutput += fmt.Sprintf("setOutput: %s \n", setOutput)
return commandOutput, nil
}
Expand Down

0 comments on commit 09cecb9

Please sign in to comment.