Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter map in info #528

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apis/meta/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apis/meta/v1alpha1/resourcelayout_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type PageBlockLayout struct {
View *PageBlockTableDefinition `json:"view,omitempty"`

RequiredFeatureSets map[string]FeatureList `json:"requiredFeatureSets,omitempty"`
Filters map[string]bool `json:"filters,omitempty"`
}

type FeatureList []string
Expand Down
7 changes: 7 additions & 0 deletions apis/meta/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions crds/meta.k8s.appscode.com_resourcelayouts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about an image used
Expand Down Expand Up @@ -300,6 +304,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about
Expand Down Expand Up @@ -571,6 +579,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about
Expand Down Expand Up @@ -815,6 +827,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about
Expand Down Expand Up @@ -1096,6 +1112,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about an image used
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.9.0
github.com/yudai/gojsondiff v1.0.0
go.bytebuilders.dev/license-verifier v0.14.2
go.bytebuilders.dev/license-verifier v0.14.4
golang.org/x/net v0.33.0
gomodules.xyz/encoding v0.0.8
gomodules.xyz/jsonpath v0.0.2
Expand All @@ -29,7 +29,7 @@ require (
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20240703190633-0aa61b46e8c2
kmodules.xyz/apiversion v0.2.0
kmodules.xyz/client-go v0.30.43
kmodules.xyz/client-go v0.30.44
kmodules.xyz/crd-schema-fuzz v0.29.1
kmodules.xyz/go-containerregistry v0.0.12
kmodules.xyz/offshoot-api v0.30.1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/xxh3 v1.0.2 h1:xZmwmqxHZA8AI603jOQ0tMqmBr9lPeFwGg6d+xy9DC0=
github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
go.bytebuilders.dev/license-verifier v0.14.2 h1:syPjdKV9YC9ERpm4vofpHf7coZtntqbSXweN0XFQJBQ=
go.bytebuilders.dev/license-verifier v0.14.2/go.mod h1:bNNaVbry3TZbu54pf57LkhjsFX94T6O62w0roiy1yiE=
go.bytebuilders.dev/license-verifier v0.14.4 h1:JwTGQFew4nudwv8Pk3BdfQRts8KfgUQ5xhu138w1wt4=
go.bytebuilders.dev/license-verifier v0.14.4/go.mod h1:LqWXJKee5ofDcCYM6T5WilYlUc4NlKeZz58tHwO8GEs=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
Expand Down Expand Up @@ -334,8 +334,8 @@ k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCI
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kmodules.xyz/apiversion v0.2.0 h1:vAQYqZFm4xu4pbB1cAdHbFEPES6EQkcR4wc06xdTOWk=
kmodules.xyz/apiversion v0.2.0/go.mod h1:oPX8g8LvlPdPX3Yc5YvCzJHQnw3YF/X4/jdW0b1am80=
kmodules.xyz/client-go v0.30.43 h1:ygH5e1+0oht4YV9NyT42YoWAlp9wrAUMH6FsB9vAlbk=
kmodules.xyz/client-go v0.30.43/go.mod h1:T9Kiu20wXEn65dLBQeegf4+y7oahJBR9ZJO2zGEVLIY=
kmodules.xyz/client-go v0.30.44 h1:mLOBXQhvCIhdega9WoN4Px/usqobuKTT2vOPQcbGhXQ=
kmodules.xyz/client-go v0.30.44/go.mod h1:T9Kiu20wXEn65dLBQeegf4+y7oahJBR9ZJO2zGEVLIY=
kmodules.xyz/crd-schema-fuzz v0.29.1 h1:zJTlWYOrT5dsVVHW8HGcnR/vaWfxQfNh11QwTtkYpcs=
kmodules.xyz/crd-schema-fuzz v0.29.1/go.mod h1:n708z9YQqLMP2KNLQVgBcRJw1QpSWLvpNCEi+KJDOYE=
kmodules.xyz/go-containerregistry v0.0.12 h1:Tl32QGmSqRVm9PUEb/f3dgDeu9zW5fVzt3qmAFIE37I=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about an image used
Expand Down Expand Up @@ -322,6 +326,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about
Expand Down Expand Up @@ -589,6 +597,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about
Expand Down Expand Up @@ -833,6 +845,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about
Expand Down Expand Up @@ -1114,6 +1130,10 @@ spec:
type: string
fieldPath:
type: string
filters:
additionalProperties:
type: boolean
type: object
icons:
items:
description: ImageSpec contains information about an image used
Expand Down
8 changes: 8 additions & 0 deletions pkg/layouts/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,14 @@ func GetResourceLayout(kc client.Client, outline *rsapi.ResourceOutline) (*rsapi
return nil, fmt.Errorf("ResourceOutline %s page %s uses multiple basic blocks", outline.Name, section.Name)
}
section.Info = &tables[0]

section.Info.Filters = make(map[string]bool)
for typ, show := range sectionFilter.Info {
if typ == "basic" {
continue
}
section.Info.Filters[typ] = show
}
}
if sectionOutline.Insight != nil && sectionFilter.Insight {
tables, err := FlattenPageBlockOutline(kc, src, *sectionOutline.Insight, rsapi.Field)
Expand Down
3 changes: 2 additions & 1 deletion vendor/kmodules.xyz/client-go/api/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,15 @@ type ClusterInfo struct {
CAPI *CAPIClusterInfo `json:"capi" protobuf:"bytes,4,opt,name=capi"`
}

// +kubebuilder:validation:Enum=capa;capg;capz
// +kubebuilder:validation:Enum=capa;capg;capz;caph;capk
type CAPIProvider string

const (
CAPIProviderCAPA CAPIProvider = "capa"
CAPIProviderCAPG CAPIProvider = "capg"
CAPIProviderCAPZ CAPIProvider = "capz"
CAPIProviderCAPH CAPIProvider = "caph"
CAPIProviderCAPK CAPIProvider = "capk"
)

type ClusterClaimInfo struct {
Expand Down
9 changes: 3 additions & 6 deletions vendor/kmodules.xyz/client-go/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,7 @@ func CreateOrPatchE(ctx context.Context, c client.Client, obj client.Object, tra

func CreateOrPatch(ctx context.Context, c client.Client, obj client.Object, transform TransformFunc, opts ...client.PatchOption) (kutil.VerbType, error) {
return CreateOrPatchE(ctx, c, obj, func(obj client.Object, createOp bool) (client.Object, error) {
transform(obj, createOp)
return obj, nil
return transform(obj, createOp), nil
}, opts...)
}

Expand Down Expand Up @@ -188,8 +187,7 @@ func PatchE(ctx context.Context, c client.Client, obj client.Object, transform P

func Patch(ctx context.Context, c client.Client, obj client.Object, transform PatchFunc, opts ...client.PatchOption) (kutil.VerbType, error) {
return PatchE(ctx, c, obj, func(obj client.Object) (client.Object, error) {
transform(obj)
return obj, nil
return transform(obj), nil
}, opts...)
}

Expand Down Expand Up @@ -232,8 +230,7 @@ func PatchStatusE(ctx context.Context, c client.Client, obj client.Object, trans

func PatchStatus(ctx context.Context, c client.Client, obj client.Object, transform PatchFunc, opts ...client.SubResourcePatchOption) (kutil.VerbType, error) {
return PatchStatusE(ctx, c, obj, func(obj client.Object) (client.Object, error) {
transform(obj)
return obj, nil
return transform(obj), nil
}, opts...)
}

Expand Down
2 changes: 2 additions & 0 deletions vendor/kmodules.xyz/client-go/cluster/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ func getProviderName(kind string) kmapi.CAPIProvider {
return kmapi.CAPIProviderCAPG
case "HetznerCluster":
return kmapi.CAPIProviderCAPH
case "KubevirtCluster":
return kmapi.CAPIProviderCAPK
}
return ""
}
Expand Down
4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ github.com/yudai/golcs
# github.com/zeebo/xxh3 v1.0.2
## explicit; go 1.17
github.com/zeebo/xxh3
# go.bytebuilders.dev/license-verifier v0.14.2
# go.bytebuilders.dev/license-verifier v0.14.4
## explicit; go 1.21
go.bytebuilders.dev/license-verifier/apis/licenses
go.bytebuilders.dev/license-verifier/info
Expand Down Expand Up @@ -745,7 +745,7 @@ k8s.io/utils/trace
# kmodules.xyz/apiversion v0.2.0
## explicit; go 1.14
kmodules.xyz/apiversion
# kmodules.xyz/client-go v0.30.43
# kmodules.xyz/client-go v0.30.44
## explicit; go 1.22.0
kmodules.xyz/client-go
kmodules.xyz/client-go/api/v1
Expand Down
Loading