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

netdog: Add IP validation to node_ip() #1680

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

zmrow
Copy link
Contributor

@zmrow zmrow commented Jul 30, 2021

Issue number:
Requested in #1664

Description of changes:

Previously the `node-ip` subcommand, which runs the `node_ip()`
function, would read the current IP from file and return it directly as
JSON.  This change validates what we read from the file is an actual
proper IP address.

Testing done:

  • Run an aws-k8s-1.19 node, it joins the cluster and runs a pod just fine.
  • Manually change /var/lib/netdog/current_ip to an invalid IP 1.2.3, run netdog node-ip by hand and (correctly) receive an error.
bash-5.0# netdog node-ip
Invalid IP address '1.2.3': invalid IP address syntax

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@zmrow zmrow requested review from bcressey and etungsten July 30, 2021 15:37
Previously the `node-ip` subcommand, which runs the `node_ip()`
function, would read the current IP from file and return it directly as
JSON.  This change validates what we read from the file is an actual
proper IP address.
@zmrow
Copy link
Contributor Author

zmrow commented Jul 30, 2021

^ changed _valid_ip to _

@zmrow zmrow requested a review from arnaldo2792 July 30, 2021 19:29
@zmrow zmrow merged commit 6567dd1 into bottlerocket-os:develop Jul 30, 2021
@zmrow zmrow deleted the valid-node-ip branch July 30, 2021 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants