Skip to content

Commit 872c2fc

Browse files
committed
found the first bug thanks to the e2e tests: the remaining version in the CRD must be served/stored
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent b6f2abb commit 872c2fc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

internal/controller/apiresourceschema/controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,14 @@ func (r *Reconciler) createAPIResourceSchema(ctx context.Context, log *zap.Sugar
181181
return v.Name != selectedVersion
182182
})
183183

184+
if len(projectedCRD.Spec.Versions) != 1 {
185+
// This should never happen because of checks earlier in the reconciler.
186+
return fmt.Errorf("invalid CRD: cannot find selected version %q", selectedVersion)
187+
}
188+
189+
projectedCRD.Spec.Versions[0].Served = true
190+
projectedCRD.Spec.Versions[0].Storage = true
191+
184192
// prefix is irrelevant as the reconciling framework will use arsName anyway
185193
converted, err := kcpdevv1alpha1.CRDToAPIResourceSchema(projectedCRD, "irrelevant")
186194
if err != nil {

0 commit comments

Comments
 (0)