Skip to content

Commit

Permalink
PreflightValidation: populate old status keys (#1068)
Browse files Browse the repository at this point in the history
Also populate old-style, un-namespaced status keys to remain compatible
with clients designed for pre-2.1 KMM.

Upstream-Commit: 3a87a9c
  • Loading branch information
qbarrand authored Mar 28, 2024
1 parent 2d1ac65 commit d072588
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions api/v1beta1/preflightvalidation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ func v1beta1StatusFromV1beta2(s v1beta2.PreflightValidationStatus) PreflightVali
for _, v := range s.Modules {
v := v
res.CRStatuses[v.Namespace+"/"+v.Name] = &v.CRBaseStatus

// This may lead to collisions, but at least we preserve backwards compatibility.
res.CRStatuses[v.Name] = &v.CRBaseStatus
}
}

Expand Down
2 changes: 2 additions & 0 deletions api/v1beta1/preflightvalidation_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ var _ = Describe("PreflightValidation_ConvertFrom", func() {
Status: PreflightValidationStatus{
CRStatuses: map[string]*CRStatus{
"namespace-1/module-1": &baseStatus1,
"module-1": &baseStatus1,
"namespace-2/module-2": &baseStatus2,
"module-2": &baseStatus2,
},
},
}
Expand Down

0 comments on commit d072588

Please sign in to comment.