fix typo and fix validation

This commit is contained in:
aliamerj
2025-09-02 16:36:30 +03:00
parent 08641b735d
commit 171925d3c9
2 changed files with 4 additions and 4 deletions

View File

@@ -946,7 +946,7 @@ func (e *Engine) receiveJobEvents() {
}
func (e *Engine) handleBundle(params *mgmProto.BundleParameters) (string, error) {
// todo: implement with real deamon address
// todo: implement with real daemon address
conn, err := e.getPeerClient("unix:///var/run/netbird.sock")
if err != nil {
return "", err
@@ -981,7 +981,7 @@ func (e *Engine) handleBundle(params *mgmProto.BundleParameters) (string, error)
}
func (e *Engine) getStatusOutput(anon bool) (string, error) {
// todo: implement with real deamon address
// todo: implement with real daemon address
conn, err := e.getPeerClient("unix:///var/run/netbird.sock")
if err != nil {
return "", err

View File

@@ -136,8 +136,8 @@ func validateAndBuildBundleParams(req api.WorkloadRequest, workload *Workload) e
if err != nil {
return fmt.Errorf("invalid parameters for bundle job")
}
// validate bundle_for_time <= 5 minutes
if bundle.Parameters.BundleForTime < 1 || bundle.Parameters.BundleForTime > 5 {
// validate bundle_for_time <= 5 minutes if BundleFor is enabled
if bundle.Parameters.BundleFor && bundle.Parameters.BundleForTime < 1 || bundle.Parameters.BundleForTime > 5 {
return fmt.Errorf("bundle_for_time must be between 1 and 5, got %d", bundle.Parameters.BundleForTime)
}
// validate log-file-count ≥ 1 and ≤ 1000