File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,14 @@ import (
24
24
// KnownPackages overrides types in some comment packages that have custom validation
25
25
// but don't have validation markers on them (since they're from core Kubernetes).
26
26
var KnownPackages = map [string ]PackageOverride {
27
+ "k8s.io/api/core/v1" : func (p * Parser , pkg * loader.Package ) {
28
+ // Explicit defaulting for the corev1.Protocol type in lieu of https://github.com/kubernetes/enhancements/pull/1928
29
+ p .Schemata [TypeIdent {Name : "Protocol" , Package : pkg }] = apiext.JSONSchemaProps {
30
+ Type : "string" ,
31
+ Default : & apiext.JSON {Raw : []byte (`"TCP"` )},
32
+ }
33
+ p .AddPackage (pkg )
34
+ },
27
35
28
36
"k8s.io/apimachinery/pkg/apis/meta/v1" : func (p * Parser , pkg * loader.Package ) {
29
37
// ObjectMeta is managed by the Kubernetes API server, so no need to
Original file line number Diff line number Diff line change @@ -1619,6 +1619,7 @@ spec:
1619
1619
can be referred to by services.
1620
1620
type : string
1621
1621
protocol :
1622
+ default : TCP
1622
1623
description : Protocol for port. Must be
1623
1624
UDP, TCP, or SCTP. Defaults to "TCP".
1624
1625
type : string
@@ -2828,6 +2829,7 @@ spec:
2828
2829
can be referred to by services.
2829
2830
type : string
2830
2831
protocol :
2832
+ default : TCP
2831
2833
description : Protocol for port. Must be
2832
2834
UDP, TCP, or SCTP. Defaults to "TCP".
2833
2835
type : string
You can’t perform that action at this time.
0 commit comments