Skip to content

Commit

Permalink
Merge pull request #107 from kubewarden/updatecli_main_166a5703c33673…
Browse files Browse the repository at this point in the history
…85967dba81feafe6a23affcb71b79a70cdaf654a33cc886556

Update third_party directory with files from Kubernetes v1.32.0
  • Loading branch information
flavio authored Dec 16, 2024
2 parents 0c4788b + 8396d40 commit 77cf670
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 7 deletions.
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/kubewarden/policy-sdk-go v0.11.0
github.com/opencontainers/image-spec v1.1.0
github.com/stretchr/testify v1.10.0
k8s.io/apiserver v1.31.3
k8s.io/apiserver v1.32.0
)

replace github.com/go-openapi/strfmt => github.com/kubewarden/strfmt v0.1.3
Expand All @@ -21,13 +21,15 @@ replace (
k8s.io/apiserver v1.31.1 => ./third_party/k8s.io/apiserver/
k8s.io/apiserver v1.31.2 => ./third_party/k8s.io/apiserver/
k8s.io/apiserver v1.31.3 => ./third_party/k8s.io/apiserver/
k8s.io/apiserver v1.32.0 => ./third_party/k8s.io/apiserver/
)

replace (
k8s.io/apimachinery v0.29.1 => ./third_party/k8s.io/apimachinery/
k8s.io/apimachinery v1.31.1 => ./third_party/k8s.io/apimachinery/
k8s.io/apimachinery v1.31.2 => ./third_party/k8s.io/apimachinery/
k8s.io/apimachinery v1.31.3 => ./third_party/k8s.io/apimachinery/
k8s.io/apimachinery v1.32.0 => ./third_party/k8s.io/apimachinery/
)

require (
Expand Down
2 changes: 1 addition & 1 deletion third_party/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ This folder contains third-party code from kubernetes:
- [kubernetes/apiserver](https://github.com/kubernetes/apiserver).
- [kubernetes/apimachinery](https://github.com/kubernetes/apimachinery).

The current version is based on kubernetes v1.31.3 (apiserver/apimachinery v0.31.3).
The current version is based on kubernetes v1.32.0 (apiserver/apimachinery v0.32.0).

All code in this folder is licensed under the Apache License 2.0, see [LICENSE](LICENSE).
10 changes: 9 additions & 1 deletion third_party/k8s.io/apiserver/pkg/cel/library/lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,15 @@ var listsLib = &lists{}
type lists struct{}

func (*lists) LibraryName() string {
return "k8s.lists"
return "kubernetes.lists"
}

func (*lists) Types() []*cel.Type {
return []*cel.Type{}
}

func (*lists) declarations() map[string][]cel.FunctionOpt {
return listsLibraryDecls
}

var paramA = cel.TypeParamType("A")
Expand Down
10 changes: 9 additions & 1 deletion third_party/k8s.io/apiserver/pkg/cel/library/regex.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ var regexLib = &regex{}
type regex struct{}

func (*regex) LibraryName() string {
return "k8s.regex"
return "kubernetes.regex"
}

func (*regex) Types() []*cel.Type {
return []*cel.Type{}
}

func (*regex) declarations() map[string][]cel.FunctionOpt {
return regexLibraryDecls
}

var regexLibraryDecls = map[string][]cel.FunctionOpt{
Expand Down
2 changes: 1 addition & 1 deletion third_party/k8s.io/apiserver/pkg/cel/library/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type testLib struct {
}

func (*testLib) LibraryName() string {
return "k8s.test"
return "kubernetes.test"
}

type TestOption func(*testLib) *testLib
Expand Down
10 changes: 9 additions & 1 deletion third_party/k8s.io/apiserver/pkg/cel/library/urls.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,15 @@ var urlsLib = &urls{}
type urls struct{}

func (*urls) LibraryName() string {
return "k8s.urls"
return "kubernetes.urls"
}

func (*urls) Types() []*cel.Type {
return []*cel.Type{apiservercel.URLType}
}

func (*urls) declarations() map[string][]cel.FunctionOpt {
return urlLibraryDecls
}

var urlLibraryDecls = map[string][]cel.FunctionOpt{
Expand Down
2 changes: 2 additions & 0 deletions third_party/k8s.io/apiserver/pkg/cel/limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ const (
// MinNumberSize is the length of literal 0
MinNumberSize = 1

// MaxFormatSize is the maximum size we allow for format strings
MaxFormatSize = 64
MaxNameFormatRegexSize = 128
)
2 changes: 1 addition & 1 deletion third_party/k8s.io/apiserver/pkg/cel/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ func (rt *DeclTypeProvider) FindStructType(typeName string) (*types.Type, bool)
declType, found := rt.findDeclType(typeName)
if found {
expT := declType.CelType()
return expT, found
return types.NewTypeTypeWithParam(expT), found
}
return rt.typeProvider.FindStructType(typeName)
}
Expand Down

0 comments on commit 77cf670

Please sign in to comment.