Add --dry-run and --ignore-no-collector-configured flags to node push commands - #1047
Merged
Conversation
cgalibern
requested changes
Jun 22, 2026
cgalibern
left a comment
Contributor
There was a problem hiding this comment.
need fix --ignore-no-collector-configured
cgalibern
self-requested a review
June 23, 2026 12:27
cgalibern
approved these changes
Jun 23, 2026
cgalibern
reviewed
Jun 24, 2026
| "github.com/opensvc/om3/v3/util/scsi" | ||
| ) | ||
|
|
||
| var ErrCollectorNotConfigured = errors.New("collector is not configured") |
Contributor
There was a problem hiding this comment.
The error is already define: collector.ErrConfig
Contributor
There was a problem hiding this comment.
var (
ErrConfig = errors.New("collector is not configured: empty configuration keyword node.dbopensvc")
ErrUnregistered = errors.New("this node is not registered. try 'om node register'")
)
Add --ignore-no-collector-configured flag to om/ox node push asset, disk, and pkg commands to silently ignore errors caused by a missing collector configuration.
Add --dry-run flag to both om and ox node push asset/disk/pkg commands. When set, the command displays the data that would be pushed without actually sending it to the collector. The output is identical to a real run, allowing users to preview the collected information safely.
Add --ignore-no-collector-configured to om and ox node sysreport commands, allowing the command to succeed silently when no collector is configured.
Add --ignore-no-collector-configured flag to both om and ox object push resinfo commands. When set, errors caused by a missing collector configuration are silently ignored, allowing the command to succeed or continue with other objects.
Replace string matching with errors.Is for "collector is not configured" detection, making the --ignore-no-collector-configured flag robust against message changes. - Add ErrCollectorNotConfigured sentinel in object package. - Wrap errors from CollectorFeeder/CollectorFeedClient with %w so all push commands (asset, disk, pkg, sysreport, resinfo) benefit. - Update isNoCollectorError helper in omcmd and oxcmd to use errors.Is. - Remove redundant %w wrappers in individual push functions.
Make the audit command survive daemon restarts by retrying the connection, following the same pattern as om daemon events.
Replace the newly introduced ErrCollectorNotConfigured sentinel with the already defined collector.ErrConfig to avoid duplication. Update isNoCollectorError helpers to use errors.Is(err, collector.ErrConfig). Remove the duplicate error variable from the object package.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.