Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

fix contorller: check the number of workloads before applying workloads #329

Merged
merged 1 commit into from
May 28, 2021
Merged

fix contorller: check the number of workloads before applying workloads #329

merged 1 commit into from
May 28, 2021

Conversation

yangsoon
Copy link
Contributor

fix #327

check the number of workloads before applying workloads,
fix the problem that the array is out of bounds.

@@ -100,6 +100,9 @@ type workloads struct {
}

func (a *workloads) Apply(ctx context.Context, status []v1alpha2.WorkloadStatus, w []Workload, ao ...resource.ApplyOption) error {
if len(w) == 0 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add reason for this change and add tests

Signed-off-by: yangsoon <yangsoonlx@gmail.com>
@wonderflow wonderflow merged commit 11536e0 into crossplane:master May 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] delete component and modify appConfig's components to null array lead to panic
3 participants