You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit introduces 3 changes to the container contribution mechanism:
1. The `controller.devfile.io/merge-contribution` component attribute is no longer required in order to define a target for container contributions. The first container component in a DevWorkspace (that is not imported by a plugin or parent DevWorkspace) is automatically selected as a merge target if the `controller.devfile.io/container-contribution` is used on at least one other DevWorkspace component. However, if the `controller.devfile.io/merge-contribution` attribute is set to `true` for a container component, it will be selected as a target for container contributions.
2. Users can opt out a container component from being implicitly selected as a container contribution merge target by setting the `controller.devfile.io/merge-contribution` attribute to false.
3. If a DevWorkspace has multiple container components with the `controller.devfile.io/merge-contribution` attribute set to true, the workspace fails.
Fix#993
Signed-off-by: Andrew Obuchowicz <[email protected]>
returnfalse, fmt.Errorf("multiple components have the %s attribute set to true. Only a single component may have the %s attribute set to true", constants.MergeContributionAttribute, constants.MergeContributionAttribute)
158
+
}
159
+
explicitTarget=true
149
160
hasTarget=true
150
161
}
151
162
iferrHolder!=nil {
152
163
returnfalse, fmt.Errorf("failed to parse %s attribute on component %s as true or false", constants.MergeContributionAttribute, component.Name)
// Finds a component that is a suitable merge target for container contributions and returns its name.
218
+
// The following rules are followed when finding a merge target:
219
+
//
220
+
// - A container component that has the merge-contribution: true attribute will automatically be selected as a merge target.
221
+
//
222
+
// - A container component that has the merge-contribution: false attribute will be never be selected as a merge target.
223
+
//
224
+
// - Otherwise, the first container component found that was not imported by a plugin or parent devworkspace (i.e. the controller.devfile.io/imported-by attribute is not present)
225
+
// will be selected as a merge target.
226
+
//
227
+
// If no suitable merge target is found, an error is returned.
0 commit comments