Skip to content

Commit

Permalink
Rename preset with variant (#254)
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha authored Sep 29, 2023
1 parent 122eab1 commit b97e34a
Show file tree
Hide file tree
Showing 50 changed files with 1,359 additions and 1,189 deletions.
10 changes: 5 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ require (
kmodules.xyz/custom-resources v0.25.2
kmodules.xyz/go-containerregistry v0.0.11
kmodules.xyz/monitoring-agent-api v0.25.4
kmodules.xyz/resource-metadata v0.17.20
kmodules.xyz/resource-metadata v0.17.21
kmodules.xyz/resource-metrics v0.25.3
kmodules.xyz/sets v0.25.0
kubeops.dev/scanner v0.0.13-0.20230610152531-83d060ed8780
kubepack.dev/lib-helm v0.7.2
kubeops.dev/scanner v0.0.15-0.20230929084557-c991a6514ff9
kubepack.dev/lib-helm v0.7.3
sigs.k8s.io/cli-utils v0.34.0
sigs.k8s.io/controller-runtime v0.13.1
sigs.k8s.io/yaml v1.3.0
x-helm.dev/apimachinery v0.0.11
x-helm.dev/apimachinery v0.0.12
)

require (
Expand Down Expand Up @@ -136,7 +136,7 @@ require (
github.com/josharian/intern v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.11 // indirect
github.com/klauspost/compress v1.16.5 // indirect
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/mailru/easyjson v0.7.7 // indirect
Expand Down
19 changes: 10 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -843,8 +843,9 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o
github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.11.13/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c=
github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM=
github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI=
github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/kmodules/apiserver v0.25.2-0.20230817060727-aa2afd31b825 h1:bqlDzXI0PosMAZRH6aPk405RnjXBxCG/LraI6YXeWYg=
Expand Down Expand Up @@ -2140,16 +2141,16 @@ kmodules.xyz/monitoring-agent-api v0.25.4 h1:OwkvtV23QhUy3f7o9lxPWaAW3jiJMGAMPPR
kmodules.xyz/monitoring-agent-api v0.25.4/go.mod h1:3LhrLDGQKQXhxYcjA/WNaO4HPpopYQzOutsEp2i3008=
kmodules.xyz/offshoot-api v0.25.4 h1:IjJNvkphcdYUG8XO/pBwXpuP8W+jxAWJZ3yH8vgI/as=
kmodules.xyz/offshoot-api v0.25.4/go.mod h1:PUk4EuJFhhyQykCflHj7EgXcljGIqs9vi0IN0RpxtY4=
kmodules.xyz/resource-metadata v0.17.20 h1:WbHckgKzlxmWx3HUtHKg/iTZuAF7o1a+BP2I0+Dwflw=
kmodules.xyz/resource-metadata v0.17.20/go.mod h1:OO4cEJehjCV54pI+l2a/V7zMnaTSDJsBHMKZ4IsGWx8=
kmodules.xyz/resource-metadata v0.17.21 h1:ChALE4P8vhqdltH5Wtk4NQQPr9h99l41PoZ89fFgZN0=
kmodules.xyz/resource-metadata v0.17.21/go.mod h1:tyLxzAVkhlL3/jFdcQcX1RZ8i8h9bs+AJur5RcuaW40=
kmodules.xyz/resource-metrics v0.25.3 h1:g9EjNfYRrUSnbA4r+bUQefQ5Ban6I6rpKjnB3ER+Yew=
kmodules.xyz/resource-metrics v0.25.3/go.mod h1:H7YLdUQJXUSzf5cNI4IYWU4Wsmrua/jpw7gqDnE3BwM=
kmodules.xyz/sets v0.25.0 h1:belY/3trp/M/CKc1TEteA40jb2uCIdwKHhjpvrIxG+8=
kmodules.xyz/sets v0.25.0/go.mod h1:ICWmplgCsxniWkImSBGlJrLT9npqOXKhX/Bwbc7bmEw=
kubeops.dev/scanner v0.0.13-0.20230610152531-83d060ed8780 h1:w4fP2k8lahFVKlWOKah208zfdfWJFPUALFwfdvuGZ5c=
kubeops.dev/scanner v0.0.13-0.20230610152531-83d060ed8780/go.mod h1:XWtmGm+ugCgxjYkYBI2Dcnlf042cYB3EkxQ4zSpu2a4=
kubepack.dev/lib-helm v0.7.2 h1:fNW6K43Hq0pcBzOw9LXuGzyAPrEg2GtpQrK0f5QLW50=
kubepack.dev/lib-helm v0.7.2/go.mod h1:o+1NADbpd2iNsVa5C2uT2wflhrhIQAsPlJy/xIzbUSI=
kubeops.dev/scanner v0.0.15-0.20230929084557-c991a6514ff9 h1:IA6a7TEiugCvxqpA2BQpRQR2iiuR8b5cPY9qtlFczpE=
kubeops.dev/scanner v0.0.15-0.20230929084557-c991a6514ff9/go.mod h1:NOUA+OwkEYNzNcgIL/mUWep8/zuNXOPlAkOcudgXxVw=
kubepack.dev/lib-helm v0.7.3 h1:TsvHCCX/QscHy1+VUoySd7GPMC78pf1B1r21Dk+tJu4=
kubepack.dev/lib-helm v0.7.3/go.mod h1:vY1++mpRC6jRlZTZ/qKPqmr9EMqEwzu+++9ifHm1qdI=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
Expand Down Expand Up @@ -2177,5 +2178,5 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=
sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=
x-helm.dev/apimachinery v0.0.11 h1:tUrxsKeRT84UCw+hHuV7isheWCv9yoS8m8lwWacVkZ4=
x-helm.dev/apimachinery v0.0.11/go.mod h1:jjkebU6uv/cS/8pQGE8tbgK/rB39yh4ETiAglPbDWZc=
x-helm.dev/apimachinery v0.0.12 h1:lEuGH5F+6xqL7/uL+SsoOUXeJZFgC8c2OQgtMMj/fQM=
x-helm.dev/apimachinery v0.0.12/go.mod h1:jjkebU6uv/cS/8pQGE8tbgK/rB39yh4ETiAglPbDWZc=
17 changes: 0 additions & 17 deletions pkg/controllers/projectquota/projectquota_controller_test.go

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/menu/accordion_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func RenderAccordionMenu(kc client.Client, disco discovery.ServerResourcesInterf
mi.Icons = generated.Icons
}
mi.AvailableVariants = generated.AvailableVariants
mi.Preset = generated.Preset
mi.Variant = generated.Variant
} else if gvr, ok := reg.FindGVR(item.Type, true); ok {
rd, _ := reg.LoadByGVR(gvr)
ed, _ := resourceeditors.LoadByGVR(kc, gvr)
Expand All @@ -109,7 +109,7 @@ func RenderAccordionMenu(kc client.Client, disco discovery.ServerResourcesInterf
mi.Installer = ed.Spec.Installer
mi.AvailableVariants = len(ed.Spec.Variants)
if mi.AvailableVariants == 1 {
mi.Preset = ed.Spec.Variants[0].Name
mi.Variant = ed.Spec.Variants[0].Name
}
// mi.LayoutName = ""
} else {
Expand Down
2 changes: 1 addition & 1 deletion pkg/menu/gallery_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func RenderGalleryMenu(kc client.Client, in *rsapi.Menu, opts *rsapi.RenderMenuR
cp.Name = ref.Title
}
// cp.Path = u.String()
cp.Preset = ref.Name
cp.Variant = ref.Name
if len(ref.Icons) > 0 {
cp.Icons = ref.Icons
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/menu/lib.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func GenerateMenuItems(kc client.Client, disco discovery.ServerResourcesInterfac

me.AvailableVariants = len(ed.Spec.Variants)
if me.AvailableVariants == 1 {
me.Preset = ed.Spec.Variants[0].Name
me.Variant = ed.Spec.Variants[0].Name
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/menu/usermenu.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func updateMenuItemVariantsInfo(kc client.Client, in []rsapi.MenuItem) []rsapi.M
if ed, ok := resourceeditors.LoadByGVR(kc, gvr); ok {
item.AvailableVariants = len(ed.Spec.Variants)
if item.AvailableVariants == 1 {
item.Preset = ed.Spec.Variants[0].Name
item.Variant = ed.Spec.Variants[0].Name
}
if len(item.Items) > 0 {
item.Items = updateMenuItemVariantsInfo(kc, item.Items)
Expand Down
2 changes: 1 addition & 1 deletion vendor/github.com/klauspost/compress/.goreleaser.yml

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

56 changes: 55 additions & 1 deletion vendor/github.com/klauspost/compress/README.md

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

31 changes: 15 additions & 16 deletions vendor/github.com/klauspost/compress/fse/compress.go

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

4 changes: 3 additions & 1 deletion vendor/github.com/klauspost/compress/fse/decompress.go

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

8 changes: 2 additions & 6 deletions vendor/github.com/klauspost/compress/huff0/bitreader.go

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

16 changes: 16 additions & 0 deletions vendor/github.com/klauspost/compress/huff0/bitwriter.go

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

Loading

0 comments on commit b97e34a

Please sign in to comment.