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

🐛 Fix logger arguments #1284

Merged
merged 1 commit into from
Jul 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/cloud/services/compute/instance_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (is *InstanceStatus) NetworkStatus() (*InstanceNetworkStatus, error) {

// Only consider IPv4
if address.Version != 4 {
is.logger.V(6).Info("Ignoring IPv%d address %s: only IPv4 is supported", address.Version, address.Address)
is.logger.V(6).Info("Ignoring IP address: only IPv4 is supported", "version", address.Version, "address", address.Address)
continue
}

Expand All @@ -168,7 +168,7 @@ func (is *InstanceStatus) NetworkStatus() (*InstanceNetworkStatus, error) {
case "fixed":
addressType = corev1.NodeInternalIP
default:
is.logger.V(6).Info("Ignoring address %s with unknown type '%s'", address.Address, address.Type)
is.logger.V(6).Info("Ignoring address with unknown type", "address", address.Address, "type", address.Type)
continue
}

Expand Down
31 changes: 31 additions & 0 deletions pkg/cloud/services/compute/instance_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,37 @@ func TestInstanceNetworkStatus(t *testing.T) {
wantIP: "192.168.0.1",
wantFloatingIP: "10.0.0.1",
},
{
name: "Ignore unknown address type",
addresses: map[string][]networkAddress{
"primary": {
{
Version: 4,
Addr: "192.168.0.2",
Type: "not-valid",
MacAddr: macAddr1,
}, {
Version: 4,
Addr: "192.168.0.3",
Type: "unknown",
MacAddr: macAddr2,
}, {
Version: 4,
Addr: "10.0.0.1",
Type: "floating",
MacAddr: macAddr3,
}, {
Version: 4,
Addr: "192.168.0.1",
Type: "fixed",
MacAddr: macAddr4,
},
},
},
networkName: "primary",
wantIP: "192.168.0.1",
wantFloatingIP: "10.0.0.1",
},
{
name: "Multiple networks",
addresses: map[string][]networkAddress{
Expand Down