-
Notifications
You must be signed in to change notification settings - Fork 110
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
RSDK-8719: - use maintenance config in RDK #4396
base: main
Are you sure you want to change the base?
RSDK-8719: - use maintenance config in RDK #4396
Conversation
…intenance-reconfige-sensor
if newConfig.MaintenanceConfig == nil { | ||
return true, errors.New("maintenanceConfig undefined. Using default reconfigure") | ||
} |
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.
move this up to where this is called and don't alert users if this does not exist
return true, errors.Errorf("maintenanceAllowedKey %s is not a bool value", maintenanceAllowedKey) | ||
} | ||
|
||
r.logger.Info("maintenanceAllowedKey found canReconfigure set to %t", canReconfigure) |
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.
maintenanceAllowedKey found on readings from maintenance sensor
explicitly say skipping reconfiguration or starting reconfiguration
errorMessage string | ||
}{ | ||
{ | ||
canReconfigure: true, |
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.
add testname field
sensor: newSensor(), | ||
errorMessage: "error getting MaintenanceAllowedKey UnknownKey from sensor reading", | ||
}, | ||
} |
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.
add test for non boolean return
} | ||
|
||
func (r *localRobot) checkMaintenanceSensorReadings(maintenanceAllowedKey string, sensor resource.Sensor) (bool, error) { | ||
readings, err := sensor.Readings(context.Background(), map[string]interface{}{}) |
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.
add context timeout here and add test for the timeout
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.
5 seconds
Feature