Skip to content

Commit b1b08b7

Browse files
committed
Update known_types to add x-kubernetes-int-or-string for intStr
Signed-off-by: Tamal Saha <[email protected]>
1 parent 73ac12a commit b1b08b7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

pkg/crd/known_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ var KnownPackages = map[string]PackageOverride{
7777

7878
"k8s.io/apimachinery/pkg/util/intstr": func(p *Parser, pkg *loader.Package) {
7979
p.Schemata[TypeIdent{Name: "IntOrString", Package: pkg}] = apiext.JSONSchemaProps{
80+
XIntOrString: true,
8081
AnyOf: []apiext.JSONSchemaProps{
8182
{Type: "string"},
8283
{Type: "integer"},

pkg/crd/testdata/testdata.kubebuilder.io_cronjobs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,7 @@ spec:
12611261
port to access on the container.
12621262
Number must be in the range 1
12631263
to 65535. Name must be an IANA_SVC_NAME.
1264+
x-kubernetes-int-or-string: true
12641265
scheme:
12651266
description: Scheme to use for connecting
12661267
to the host. Defaults to HTTP.
@@ -1287,6 +1288,7 @@ spec:
12871288
port to access on the container.
12881289
Number must be in the range 1
12891290
to 65535. Name must be an IANA_SVC_NAME.
1291+
x-kubernetes-int-or-string: true
12901292
required:
12911293
- port
12921294
type: object
@@ -1376,6 +1378,7 @@ spec:
13761378
port to access on the container.
13771379
Number must be in the range 1
13781380
to 65535. Name must be an IANA_SVC_NAME.
1381+
x-kubernetes-int-or-string: true
13791382
scheme:
13801383
description: Scheme to use for connecting
13811384
to the host. Defaults to HTTP.
@@ -1402,6 +1405,7 @@ spec:
14021405
port to access on the container.
14031406
Number must be in the range 1
14041407
to 65535. Name must be an IANA_SVC_NAME.
1408+
x-kubernetes-int-or-string: true
14051409
required:
14061410
- port
14071411
type: object
@@ -1484,6 +1488,7 @@ spec:
14841488
to access on the container. Number
14851489
must be in the range 1 to 65535. Name
14861490
must be an IANA_SVC_NAME.
1491+
x-kubernetes-int-or-string: true
14871492
scheme:
14881493
description: Scheme to use for connecting
14891494
to the host. Defaults to HTTP.
@@ -1528,6 +1533,7 @@ spec:
15281533
to access on the container. Number
15291534
must be in the range 1 to 65535. Name
15301535
must be an IANA_SVC_NAME.
1536+
x-kubernetes-int-or-string: true
15311537
required:
15321538
- port
15331539
type: object
@@ -1671,6 +1677,7 @@ spec:
16711677
to access on the container. Number
16721678
must be in the range 1 to 65535. Name
16731679
must be an IANA_SVC_NAME.
1680+
x-kubernetes-int-or-string: true
16741681
scheme:
16751682
description: Scheme to use for connecting
16761683
to the host. Defaults to HTTP.
@@ -1715,6 +1722,7 @@ spec:
17151722
to access on the container. Number
17161723
must be in the range 1 to 65535. Name
17171724
must be an IANA_SVC_NAME.
1725+
x-kubernetes-int-or-string: true
17181726
required:
17191727
- port
17201728
type: object
@@ -2446,6 +2454,7 @@ spec:
24462454
port to access on the container.
24472455
Number must be in the range 1
24482456
to 65535. Name must be an IANA_SVC_NAME.
2457+
x-kubernetes-int-or-string: true
24492458
scheme:
24502459
description: Scheme to use for connecting
24512460
to the host. Defaults to HTTP.
@@ -2472,6 +2481,7 @@ spec:
24722481
port to access on the container.
24732482
Number must be in the range 1
24742483
to 65535. Name must be an IANA_SVC_NAME.
2484+
x-kubernetes-int-or-string: true
24752485
required:
24762486
- port
24772487
type: object
@@ -2561,6 +2571,7 @@ spec:
25612571
port to access on the container.
25622572
Number must be in the range 1
25632573
to 65535. Name must be an IANA_SVC_NAME.
2574+
x-kubernetes-int-or-string: true
25642575
scheme:
25652576
description: Scheme to use for connecting
25662577
to the host. Defaults to HTTP.
@@ -2587,6 +2598,7 @@ spec:
25872598
port to access on the container.
25882599
Number must be in the range 1
25892600
to 65535. Name must be an IANA_SVC_NAME.
2601+
x-kubernetes-int-or-string: true
25902602
required:
25912603
- port
25922604
type: object
@@ -2669,6 +2681,7 @@ spec:
26692681
to access on the container. Number
26702682
must be in the range 1 to 65535. Name
26712683
must be an IANA_SVC_NAME.
2684+
x-kubernetes-int-or-string: true
26722685
scheme:
26732686
description: Scheme to use for connecting
26742687
to the host. Defaults to HTTP.
@@ -2713,6 +2726,7 @@ spec:
27132726
to access on the container. Number
27142727
must be in the range 1 to 65535. Name
27152728
must be an IANA_SVC_NAME.
2729+
x-kubernetes-int-or-string: true
27162730
required:
27172731
- port
27182732
type: object
@@ -2856,6 +2870,7 @@ spec:
28562870
to access on the container. Number
28572871
must be in the range 1 to 65535. Name
28582872
must be an IANA_SVC_NAME.
2873+
x-kubernetes-int-or-string: true
28592874
scheme:
28602875
description: Scheme to use for connecting
28612876
to the host. Defaults to HTTP.
@@ -2900,6 +2915,7 @@ spec:
29002915
to access on the container. Number
29012916
must be in the range 1 to 65535. Name
29022917
must be an IANA_SVC_NAME.
2918+
x-kubernetes-int-or-string: true
29032919
required:
29042920
- port
29052921
type: object

0 commit comments

Comments
 (0)