You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(agent): don't initialize agent when hostname and identity are empty
A MAC address can be empty when the network interface used to
communicate with the external world isn't a physical one. In this case,
we should be able to define a custom value for MAC's field using the
[PREFERRED_IDENTITY] variable. If the hostname is also empty,
[PREFERRED_HOSTNAME] could be defined to provide a fallback identifier
for the device. This ensures that even if both the MAC address and
hostname is missing, we have a way to identify the device uniquely.
When it occurs, and no variable was defined, the agent should fail to
initialize.
Copy file name to clipboardExpand all lines: pkg/agent/agent.go
+19-2Lines changed: 19 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -343,17 +343,34 @@ func (a *Agent) probeServerInfo() error {
343
343
returnerr
344
344
}
345
345
346
+
varErrNoIdentityAndHostname=errors.New("the device doesn't have a valid hostname and identity. Set PREFERRED_IDENTITY or PREFERRED_HOSTNAME to specify the device's name and identity")
347
+
346
348
// authorize send auth request to the server with device information in order to register it in the namespace.
0 commit comments