mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-20 17:26:40 +00:00
fix typo and fix validation
This commit is contained in:
@@ -946,7 +946,7 @@ func (e *Engine) receiveJobEvents() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *Engine) handleBundle(params *mgmProto.BundleParameters) (string, error) {
|
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")
|
conn, err := e.getPeerClient("unix:///var/run/netbird.sock")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
@@ -981,7 +981,7 @@ func (e *Engine) handleBundle(params *mgmProto.BundleParameters) (string, error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *Engine) getStatusOutput(anon bool) (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")
|
conn, err := e.getPeerClient("unix:///var/run/netbird.sock")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|||||||
@@ -136,8 +136,8 @@ func validateAndBuildBundleParams(req api.WorkloadRequest, workload *Workload) e
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("invalid parameters for bundle job")
|
return fmt.Errorf("invalid parameters for bundle job")
|
||||||
}
|
}
|
||||||
// validate bundle_for_time <= 5 minutes
|
// validate bundle_for_time <= 5 minutes if BundleFor is enabled
|
||||||
if bundle.Parameters.BundleForTime < 1 || bundle.Parameters.BundleForTime > 5 {
|
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)
|
return fmt.Errorf("bundle_for_time must be between 1 and 5, got %d", bundle.Parameters.BundleForTime)
|
||||||
}
|
}
|
||||||
// validate log-file-count ≥ 1 and ≤ 1000
|
// validate log-file-count ≥ 1 and ≤ 1000
|
||||||
|
|||||||
Reference in New Issue
Block a user