mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Merge pull request #124779 from cici37/updateEnv
Update CEL default compatibility environment version to 1.30
This commit is contained in:
commit
8339711e1f
@ -2039,6 +2039,27 @@ func TestValidationExpressions(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedCost: 7,
|
expectedCost: 7,
|
||||||
},
|
},
|
||||||
|
{name: "IP and CIDR",
|
||||||
|
obj: objs("20", "200M"),
|
||||||
|
schema: schemas(stringType, stringType),
|
||||||
|
valid: []string{
|
||||||
|
`isIP("192.168.0.1")`,
|
||||||
|
`ip.isCanonical("127.0.0.1")`,
|
||||||
|
`ip("192.168.0.1").family() > 0`,
|
||||||
|
`ip("0.0.0.0").isUnspecified()`,
|
||||||
|
`ip("127.0.0.1").isLoopback()`,
|
||||||
|
`ip("224.0.0.1").isLinkLocalMulticast()`,
|
||||||
|
`ip("192.168.0.1").isGlobalUnicast()`,
|
||||||
|
`type(ip("192.168.0.1")) == net.IP`,
|
||||||
|
`cidr("192.168.0.0/24").containsIP(ip("192.168.0.1"))`,
|
||||||
|
`cidr("192.168.0.0/24").containsCIDR("192.168.0.0/25")`,
|
||||||
|
`cidr("2001:db8::/32").containsCIDR(cidr("2001:db8::/33"))`,
|
||||||
|
`type(cidr("2001:db8::/32").ip()) == net.IP`,
|
||||||
|
`cidr('192.168.0.0/24') == cidr('192.168.0.0/24').masked()`,
|
||||||
|
`cidr('192.168.0.0/16').prefixLength() == 16`,
|
||||||
|
`cidr('::1/128').ip().family() == 6`,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range tests {
|
for i := range tests {
|
||||||
|
@ -43,7 +43,7 @@ import (
|
|||||||
// desirable because it means that CEL expressions are portable across a wider range
|
// desirable because it means that CEL expressions are portable across a wider range
|
||||||
// of Kubernetes versions.
|
// of Kubernetes versions.
|
||||||
func DefaultCompatibilityVersion() *version.Version {
|
func DefaultCompatibilityVersion() *version.Version {
|
||||||
return version.MajorMinor(1, 29)
|
return version.MajorMinor(1, 30)
|
||||||
}
|
}
|
||||||
|
|
||||||
var baseOpts = append(baseOptsWithoutStrictCost, StrictCostOpt)
|
var baseOpts = append(baseOptsWithoutStrictCost, StrictCostOpt)
|
||||||
|
Loading…
Reference in New Issue
Block a user