-
Notifications
You must be signed in to change notification settings - Fork 208
Rename deployment chain configuration struct field #2820
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -552,9 +552,9 @@ func (p *PostSync) Validate() error { | |
|
|
||
| // DeploymentChain provides all configurations used to trigger a chain of deployments. | ||
| type DeploymentChain struct { | ||
| // Nodes provides list of DeploymentChainNodes which contain filters to be used | ||
| // ApplicationMatchers provides list of ChainApplicationMatcher which contain filters to be used | ||
| // to find applications to deploy as chain node. It's required to not empty. | ||
| Nodes []*DeploymentChainNode `json:"applications"` | ||
| ApplicationMatchers []*ChainApplicationMatcher `json:"applications"` | ||
| // Conditions provides configuration used to determine should the piped in charge in | ||
| // the first applications in the chain trigger a whole new deployment chain or not. | ||
| // If this field is not set, always trigger a whole new deployment chain when the current | ||
|
|
@@ -564,12 +564,12 @@ type DeploymentChain struct { | |
| } | ||
|
|
||
| func (dc *DeploymentChain) Validate() error { | ||
| if len(dc.Nodes) == 0 { | ||
| if len(dc.ApplicationMatchers) == 0 { | ||
| return fmt.Errorf("missing specified applications that will be triggered on this chain of deployment") | ||
| } | ||
|
|
||
| for _, n := range dc.Nodes { | ||
| if err := n.Validate(); err != nil { | ||
| for _, m := range dc.ApplicationMatchers { | ||
| if err := m.Validate(); err != nil { | ||
| return err | ||
| } | ||
| } | ||
|
|
@@ -583,16 +583,16 @@ func (dc *DeploymentChain) Validate() error { | |
| return nil | ||
| } | ||
|
|
||
| // DeploymentChainNode provides filters used to find the right applications to trigger | ||
| // ChainApplicationMatcher provides filters used to find the right applications to trigger | ||
| // as a part of the deployment chain. | ||
| type DeploymentChainNode struct { | ||
| type ChainApplicationMatcher struct { | ||
| AppName string `json:"name"` | ||
|
||
| AppKind string `json:"kind"` | ||
| AppLabels map[string]string `json:"labels"` | ||
| } | ||
|
|
||
| func (n *DeploymentChainNode) Validate() error { | ||
| hasFilterCond := n.AppName != "" || n.AppKind != "" || len(n.AppLabels) != 0 | ||
| func (m *ChainApplicationMatcher) Validate() error { | ||
| hasFilterCond := m.AppName != "" || m.AppKind != "" || len(m.AppLabels) != 0 | ||
|
|
||
| if !hasFilterCond { | ||
| return fmt.Errorf("at least one of \"name\", \"kind\" or \"labels\" must be set to find applications to deploy") | ||
|
|
||
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
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.
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.
Don't need to use pointer.