Skip to content
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

Manage merge keys of top-level lists in a more consistent way #122

Merged
merged 33 commits into from
Sep 2, 2020
Merged
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
600f8ee
move commands and components merge key to top-level
kadel Aug 20, 2020
11cfd4f
update generated schemas
kadel Aug 20, 2020
65d38c1
remove unit_test.go for now
kadel Aug 21, 2020
b726b6f
update generated schemas
kadel Aug 21, 2020
defce88
Only bring the Command ID at the top-level
davidfestal Aug 26, 2020
d8c0c68
Manage the key move in PluginComponentsOverride
davidfestal Aug 26, 2020
fa9a641
Refactor / Simplify the overriding and merging ...
davidfestal Aug 26, 2020
14dd37d
Update overriding and merging test yamls
davidfestal Aug 26, 2020
c3894e0
Update samples
davidfestal Aug 26, 2020
b73fa61
Generate CRDs and schemas
davidfestal Aug 26, 2020
045d6be
Fix the mandatory name description
davidfestal Aug 26, 2020
e081817
Update the package name after the K8S API upgrade
davidfestal Aug 26, 2020
397d6e6
Regenerate CRDs and schemas
davidfestal Aug 26, 2020
92a034b
Fix Go formatting
davidfestal Aug 26, 2020
2609a33
Make starterProjects overridable by child devfile
davidfestal Aug 26, 2020
03d3400
Use reflection and `TopLevelListContainer` interface ...
davidfestal Aug 31, 2020
dde4da0
Format code
davidfestal Aug 31, 2020
9582560
Fail-fast during overriding.
davidfestal Aug 31, 2020
b1b2de3
Fix trailing new line
davidfestal Sep 1, 2020
6e8a7c8
Fix formating
davidfestal Sep 1, 2020
3c18672
Add documentation to Keyed and related types...
davidfestal Sep 1, 2020
eed552e
Update pkg/utils/overriding/merging.go
davidfestal Sep 1, 2020
b613251
Update pkg/utils/overriding/merging.go
davidfestal Sep 1, 2020
907f8e6
Update pkg/utils/overriding/keys.go
davidfestal Sep 1, 2020
b56fb71
Update pkg/utils/overriding/keys.go
davidfestal Sep 1, 2020
ba4ff66
Fix a non-compiling fix
davidfestal Sep 1, 2020
af9e127
Fix formatting after accepting a suggestion
davidfestal Sep 1, 2020
ae2615b
Bring exported functions at the top of the file
davidfestal Sep 1, 2020
f5bcbc6
Add comments in the function
davidfestal Sep 1, 2020
88d00ae
Try to simplify the `merging` function...
davidfestal Sep 1, 2020
7b8dbe0
typo
davidfestal Sep 1, 2020
ef7ba59
Simplify checkKeys function
amisevsk Sep 1, 2020
08efbc1
Fix overriding test to account for Go's map traversal order
amisevsk Sep 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fail-fast during overriding.
Signed-off-by: David Festal <[email protected]>
davidfestal committed Aug 31, 2020
commit 958256030c7a0b565dc47ab4fad115e1fb728e6b
8 changes: 4 additions & 4 deletions pkg/utils/overriding/overriding.go
Original file line number Diff line number Diff line change
@@ -72,6 +72,10 @@ func OverrideDevWorkspaceTemplateSpecBytes(originalBytes []byte, patchBytes []by
//
// The result is a transformed `DevfileWorkspaceTemplateSpec` object.
func OverrideDevWorkspaceTemplateSpec(original *workspaces.DevWorkspaceTemplateSpecContent, patch workspaces.Overrides) (*workspaces.DevWorkspaceTemplateSpecContent, error) {
if err := ensureOnlyExistingElementsAreOverridden(original, patch); err != nil {
return nil, err
}

if err := unions.Normalize(&original); err != nil {
return nil, err
}
@@ -98,10 +102,6 @@ func OverrideDevWorkspaceTemplateSpec(original *workspaces.DevWorkspaceTemplateS
return nil, err
}

if err := ensureOnlyExistingElementsAreOverridden(original, patch); err != nil {
return nil, err
}

schema, err := strategicpatch.NewPatchMetaFromStruct(original)
if err != nil {
return nil, err