Skip to content

Commit

Permalink
Add custom versions to kubedb-catalog
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Aug 12, 2024
1 parent ab3a1d4 commit 45e21cb
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 10 deletions.
12 changes: 7 additions & 5 deletions apis/installer/v1alpha1/kubedb_catalog_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)

const (
Expand Down Expand Up @@ -45,11 +46,12 @@ type KubedbCatalogSpec struct {
//+optional
FullnameOverride string `json:"fullnameOverride"`
//+optional
Proxies RegistryProxies `json:"proxies"`
FeatureGates map[string]bool `json:"featureGates"`
Psp PSP `json:"psp"`
SkipDeprecated bool `json:"skipDeprecated"`
EnableVersions map[string][]string `json:"enableVersions"`
Proxies RegistryProxies `json:"proxies"`
FeatureGates map[string]bool `json:"featureGates"`
Psp PSP `json:"psp"`
SkipDeprecated bool `json:"skipDeprecated"`
EnableVersions map[string][]string `json:"enableVersions"`
CustomVersions map[string]*runtime.RawExtension `json:"customVersions"`
}

type RegistryProxies struct {
Expand Down
15 changes: 15 additions & 0 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

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

4 changes: 4 additions & 0 deletions catalog/kubedb/fmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,10 @@ func main() {
if err != nil {
panic(err)
}
err = os.Rename(filepath.Join(dir, "charts", "kubedb-catalog", "templates", "custom.yaml"), filepath.Join(dir, "charts", "kubedb-catalog", "new_templates", "custom.yaml"))
if err != nil {
panic(err)
}
err = os.RemoveAll(filepath.Join(dir, "charts", "kubedb-catalog", "templates"))
if err != nil {
panic(err)
Expand Down
1 change: 1 addition & 0 deletions charts/kubedb-catalog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ The following table lists the configurable parameters of the `kubedb-catalog` ch
| enableVersions.Singlestore | | <code>[]</code> |
| enableVersions.Solr | | <code>[]</code> |
| enableVersions.ZooKeeper | | <code>[]</code> |
| customVersions | | <code>{}</code> |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
Expand Down
4 changes: 4 additions & 0 deletions charts/kubedb-catalog/templates/custom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{ range $obj:= .Values.customVersions }}
{{ $obj | toYaml }}
---
{{ end }}
6 changes: 6 additions & 0 deletions charts/kubedb-catalog/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
properties:
customVersions:
additionalProperties:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
enableVersions:
additionalProperties:
items:
Expand Down Expand Up @@ -144,6 +149,7 @@ properties:
skipDeprecated:
type: boolean
required:
- customVersions
- enableVersions
- featureGates
- psp
Expand Down
2 changes: 2 additions & 0 deletions charts/kubedb-catalog/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ enableVersions:
Singlestore: []
Solr: []
ZooKeeper: []

customVersions: {}
6 changes: 6 additions & 0 deletions charts/kubedb/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2607,6 +2607,11 @@ properties:
type: object
kubedb-catalog:
properties:
customVersions:
additionalProperties:
type: object
x-kubernetes-preserve-unknown-fields: true
type: object
enableVersions:
additionalProperties:
items:
Expand Down Expand Up @@ -2754,6 +2759,7 @@ properties:
skipDeprecated:
type: boolean
required:
- customVersions
- enableVersions
- enabled
- featureGates
Expand Down
7 changes: 2 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ require (
stash.appscode.dev/installer v0.12.2-0.20240420190034-95f958de0f1e
)

require (
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
)

require (
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0 // indirect
Expand All @@ -39,6 +34,7 @@ require (
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
github.com/evanphx/json-patch v5.9.0+incompatible // indirect
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
Expand Down Expand Up @@ -74,6 +70,7 @@ require (
github.com/vbatts/tar-split v0.11.3 // indirect
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sync v0.7.0 // indirect
Expand Down

0 comments on commit 45e21cb

Please sign in to comment.