Add optional field to CopyOperation#371
Open
sohel2020 wants to merge 1 commit into
Open
Conversation
Per issue fluxcd#368, copy operations that match no files now support an `optional` flag. When true, glob no-match, all-excluded, and non-glob path-not-found errors are silently skipped instead of failing reconciliation. Default false preserves existing behavior. Signed-off-by: Tarikur Rahaman <sohel2020@gmail.com>
86230d8 to
845d4e9
Compare
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.
Summary
Closes #368
Adds a per-copy-entry
optionalflag toCopyOperationso users can control whether a copy operation that matches no files fails or silently skips.Optional boolfield toCopyOperationinapi/v1beta1/artifactgenerator_types.gomake generate && make manifestsdocs/spec/v1beta1/artifactgenerators.mdBehavior
optional: false(default)optional: trueBackward compatible:
Optionalisboolwith zero valuefalse. Existing CRs without this field preserve current error behavior. The CRD change is additive.Changes
api/v1beta1/artifactgenerator_types.go- newOptionalfield onCopyOperationconfig/crd/bases/source.extensions.fluxcd.io_artifactgenerators.yaml- regenerated CRDinternal/builder/builder.go- checkop.Optionalbefore returning no-match errorsinternal/builder/builder_test.go- three new test cases inTestBuildErrorsdocs/spec/v1beta1/artifactgenerators.md- documentedoptionalin Copy Operations sectionTest plan
go test ./internal/builder/ -run TestBuild -count=1passes (all existing + new tests)go vet ./...cleango fmt ./...cleanmake test(full suite, requires network for CRD fetch)