Skip to content

Commit 0fb7a17

Browse files
committed
Add explanatory comment
Signed-off-by: jose.vazquez <[email protected]>
1 parent 06b6f9b commit 0fb7a17

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/openapi2crd/pkg/plugins/print_conditions.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@ func (p *PrintConditions) Name() string {
1111
}
1212

1313
func (p *PrintConditions) Process(req *MappingProcessorRequest) error {
14+
// Given that new SDK versions are supported by different spec subfields, it
15+
// is unlikely there will be more than one supported Kubernetes version.
16+
//
17+
// The CRD validation fails if all versions use the same print columns, in
18+
// such case they have to be set at the top level to avoid errors.
19+
// Note that the produced YAML still places the print columns at the version
20+
// level anyways.
21+
//
22+
// Check out the upstream code for more details:
23+
// https://github.com/kubernetes/apiextensions-apiserver/blob/a780e0393511161d7ef1e6466035181a4f84f347/pkg/apis/apiextensions/validation/validation.go#L438C5-L438C34
24+
// https://github.com/kubernetes/apiextensions-apiserver/blob/a780e0393511161d7ef1e6466035181a4f84f347/pkg/apis/apiextensions/validation/validation.go#L762
1425
req.CRD.Spec.AdditionalPrinterColumns = []apiextensions.CustomResourceColumnDefinition{
1526
{
1627
JSONPath: `.status.conditions[?(@.type=="Ready")].status`,

0 commit comments

Comments
 (0)