-
Notifications
You must be signed in to change notification settings - Fork 4
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
[APP-7692] Fix empty config errors on new install #73
Changes from all commits
aa0f6ae
5f7dd46
8de200a
c1d09e7
1c3d7b9
e64ce4e
ac4d66d
f27fd21
2b2ccff
dc37b02
be9f404
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,9 +39,9 @@ func (n *Networking) GetSmartMachineStatus(ctx context.Context, | |
|
||
ret := &pb.GetSmartMachineStatusResponse{ | ||
ProvisioningInfo: &pb.ProvisioningInfo{ | ||
FragmentId: n.cfg.FragmentID, | ||
Model: n.cfg.Model, | ||
Manufacturer: n.cfg.Manufacturer, | ||
FragmentId: n.Config().FragmentID, | ||
Model: n.Config().Model, | ||
Manufacturer: n.Config().Manufacturer, | ||
Comment on lines
+42
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's one fix in config.go, the rest is a related fix around config locking (potential race.) Overlooked during 0.14.0 development. |
||
}, | ||
HasSmartMachineCredentials: n.connState.getConfigured(), | ||
IsOnline: n.connState.getOnline(), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -195,7 +195,9 @@ func LoadConfigFromCache() (AgentConfig, error) { | |
//nolint:gosec | ||
cacheBytes, err := os.ReadFile(cachePath) | ||
if err != nil { | ||
if !errors.Is(err, fs.ErrNotExist) { | ||
if errors.Is(err, fs.ErrNotExist) { | ||
return StackConfigs(&pb.DeviceAgentConfigResponse{}) | ||
} else { | ||
Comment on lines
+198
to
+200
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the actual fix. |
||
cfg, newErr := StackConfigs(&pb.DeviceAgentConfigResponse{}) | ||
return cfg, errors.Join(errw.Wrap(err, "reading config cache"), newErr) | ||
} | ||
|
@@ -513,6 +515,6 @@ func (t *Timeout) UnmarshalJSON(b []byte) error { | |
*t = Timeout(tmp) | ||
return nil | ||
default: | ||
return errw.Errorf("invalid duration: %+v", v) | ||
return errw.Errorf("invalid duration: %#v", v) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be non-fatal always now.