Skip to content

Commit

Permalink
Update kubedb script generator
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Nov 24, 2024
1 parent f158f0b commit 6729940
Show file tree
Hide file tree
Showing 23 changed files with 159 additions and 88 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ require (
k8s.io/client-go v0.30.2
k8s.io/component-base v0.30.2
k8s.io/klog/v2 v2.130.1
kmodules.xyz/client-go v0.30.38
kmodules.xyz/client-go v0.30.40
kmodules.xyz/go-containerregistry v0.0.12
kmodules.xyz/resource-metadata v0.22.5
kmodules.xyz/resource-metadata v0.22.6
kubeops.dev/scanner v0.0.19
sigs.k8s.io/yaml v1.4.0
)
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -591,12 +591,12 @@ k8s.io/kube-openapi v0.0.0-20240703190633-0aa61b46e8c2 h1:T5TEV4a+pEjc+j9Xui3MGG
k8s.io/kube-openapi v0.0.0-20240703190633-0aa61b46e8c2/go.mod h1:UxDHUPsUwTOOxSU+oXURfFBcAS6JwiRXTYqYwfuGowc=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0 h1:jgGTlFYnhF1PM1Ax/lAlxUPE+KfCIXHaathvJg1C3ak=
k8s.io/utils v0.0.0-20240502163921-fe8a2dddb1d0/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
kmodules.xyz/client-go v0.30.38 h1:kAQ3FdgX2HbkmfFGEoeKz7fmJYWo1Ndgdum50aaHyI0=
kmodules.xyz/client-go v0.30.38/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
kmodules.xyz/client-go v0.30.40 h1:X9Ic8D19D5Gy4C5UvQWSU/kyIObULFHG0B2HHx8ZW+E=
kmodules.xyz/client-go v0.30.40/go.mod h1:CAu+JlA8RVGtj6LQHu0Q1w2mnFUajuti49c7T1AvGdM=
kmodules.xyz/go-containerregistry v0.0.12 h1:Tl32QGmSqRVm9PUEb/f3dgDeu9zW5fVzt3qmAFIE37I=
kmodules.xyz/go-containerregistry v0.0.12/go.mod h1:KgeNg0hDsgeda+qc0NzWk0iVRdF0+ZIg/oRzGoYh78I=
kmodules.xyz/resource-metadata v0.22.5 h1:CO83J09Gxru3ILdxW1+pzuFyRoGdGKkU6JrbwRxYfsI=
kmodules.xyz/resource-metadata v0.22.5/go.mod h1:zq0gtycDR21iPzhhqrbOGF4lwffIgQ9xiS8T34aJqjk=
kmodules.xyz/resource-metadata v0.22.6 h1:3AbZi7n5rC565nXKq3e7G9DA+PDntRWlWvexoAZ1gHI=
kmodules.xyz/resource-metadata v0.22.6/go.mod h1:zq27dG0YA8WEdOOoyfsLn4TQK5Xxox13dwJKtr66eqU=
kubeops.dev/scanner v0.0.19 h1:J8C94k4j3NY3Y8UGHcG4nCZtmpSqPneCmkuvGNUOv4s=
kubeops.dev/scanner v0.0.19/go.mod h1:FAKPsS+FhrOPwsbwXJOE1vLvIFWBcBcSXpaAztezvu4=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
14 changes: 12 additions & 2 deletions pkg/cmds/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ func NewCmdListImages() *cobra.Command {
for key, list := range lib.GroupImages(imgmap) {
gk := schema.ParseGroupKind(key)
if gk.Group == "catalog.kubedb.com" {
dirScript := filepath.Join(outDir, "scripts", strings.ToLower(strings.TrimSuffix(gk.Kind, "Version")))
err = os.MkdirAll(dirScript, 0o755)
if err != nil {
return err
}
sort.Strings(list)
err := write(list, filepath.Join(outDir, "scripts", strings.ToLower(gk.Kind)+"s.yaml"))
err = write(list, filepath.Join(dirScript, "imagelist.yaml"))
if err != nil {
return err
}
Expand All @@ -64,8 +69,13 @@ func NewCmdListImages() *cobra.Command {
}
}

dirScript := filepath.Join(outDir, "scripts", "operator")
err = os.MkdirAll(dirScript, 0o755)
if err != nil {
return err
}
sort.Strings(rest)
err = write(rest, filepath.Join(outDir, "scripts", "operator.yaml"))
err = write(rest, filepath.Join(dirScript, "imagelist.yaml"))
if err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions vendor/kmodules.xyz/client-go/api/v1/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const (
ClusterNameKey string = "cluster.appscode.com/name"
ClusterDisplayNameKey string = "cluster.appscode.com/display-name"
ClusterProviderNameKey string = "cluster.appscode.com/provider"
ClusterProfileLabel string = "cluster.appscode.com/profile"

AceOrgIDKey string = "ace.appscode.com/org-id"
ClientOrgKey string = "ace.appscode.com/client-org"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,33 @@ spec:
name: Scaling
- items:
- editor:
name: autoscalingkubedbcom-elasticsearchautoscaler-editor
name: kubedbcom-elasticsearch-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/compute.svg
type: image/svg+xml
name: Compute
operationId: create-opsrequest-compute
operationId: edit-self-compute-autoscaler
- editor:
name: autoscalingkubedbcom-elasticsearchautoscaler-editor
name: kubedbcom-elasticsearch-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/storage.svg
type: image/svg+xml
name: Storage
operationId: create-opsrequest-storage
operationId: edit-self-storage-autoscaler
name: Autoscaling
- items:
- disabledTemplate: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,33 +114,33 @@ spec:
name: Scaling
- items:
- editor:
name: autoscalingkubedbcom-kafkaautoscaler-editor
name: kubedbcom-kafka-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/compute.svg
type: image/svg+xml
name: Compute
operationId: create-opsrequest-compute
operationId: edit-self-compute-autoscaler
- editor:
name: autoscalingkubedbcom-kafkaautoscaler-editor
name: kubedbcom-kafka-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/storage.svg
type: image/svg+xml
name: Storage
operationId: create-opsrequest-storage
operationId: edit-self-storage-autoscaler
name: Autoscaling
- items:
- editor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,33 @@ spec:
name: Scaling
- items:
- editor:
name: autoscalingkubedbcom-mariadbautoscaler-editor
name: kubedbcom-mariadb-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/compute.svg
type: image/svg+xml
name: Compute
operationId: create-opsrequest-compute
operationId: edit-self-compute-autoscaler
- editor:
name: autoscalingkubedbcom-mariadbautoscaler-editor
name: kubedbcom-mariadb-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/storage.svg
type: image/svg+xml
name: Storage
operationId: create-opsrequest-storage
operationId: edit-self-storage-autoscaler
name: Autoscaling
- items:
- editor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,19 @@ spec:
name: Scaling
- items:
- editor:
name: autoscalingkubedbcom-memcachedautoscaler-editor
name: kubedbcom-memcached-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/compute.svg
type: image/svg+xml
name: Compute
operationId: create-opsrequest-compute
operationId: edit-self-compute-autoscaler
name: Autoscaling
- items:
- editor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,33 @@ spec:
name: Scaling
- items:
- editor:
name: autoscalingkubedbcom-mysqlautoscaler-editor
name: kubedbcom-mysql-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/compute.svg
type: image/svg+xml
name: Compute
operationId: create-opsrequest-compute
operationId: edit-self-compute-autoscaler
- editor:
name: autoscalingkubedbcom-mysqlautoscaler-editor
name: kubedbcom-mysql-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/storage.svg
type: image/svg+xml
name: Storage
operationId: create-opsrequest-storage
operationId: edit-self-storage-autoscaler
name: Autoscaling
- items:
- editor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,33 +100,33 @@ spec:
name: Scaling
- items:
- editor:
name: autoscalingkubedbcom-perconaxtradbautoscaler-editor
name: kubedbcom-perconaxtradb-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/compute.svg
type: image/svg+xml
name: Compute
operationId: create-opsrequest-compute
operationId: edit-self-compute-autoscaler
- editor:
name: autoscalingkubedbcom-perconaxtradbautoscaler-editor
name: kubedbcom-perconaxtradb-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/storage.svg
type: image/svg+xml
name: Storage
operationId: create-opsrequest-storage
operationId: edit-self-storage-autoscaler
name: Autoscaling
- items:
- editor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ spec:
name: Scaling
- items:
- editor:
name: autoscalingkubedbcom-pgbouncerautoscaler-editor
name: kubedbcom-pgbouncer-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/compute.svg
type: image/svg+xml
name: Compute
operationId: create-opsrequest-compute
operationId: edit-self-compute-autoscaler
name: Autoscaling
- items:
- editor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,33 +144,33 @@ spec:
name: Scaling
- items:
- editor:
name: autoscalingkubedbcom-postgresautoscaler-editor
name: kubedbcom-postgres-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/compute.svg
type: image/svg+xml
name: Compute
operationId: create-opsrequest-compute
operationId: edit-self-compute-autoscaler
- editor:
name: autoscalingkubedbcom-postgresautoscaler-editor
name: kubedbcom-postgres-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/storage.svg
type: image/svg+xml
name: Storage
operationId: create-opsrequest-storage
operationId: edit-self-storage-autoscaler
name: Autoscaling
- items:
- editor:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ spec:
name: Scaling
- items:
- editor:
name: autoscalingkubedbcom-proxysqlautoscaler-editor
name: kubedbcom-proxysql-editor
sourceRef:
apiGroup: source.toolkit.fluxcd.io
kind: HelmRepository
name: appscode-charts-oci
version: v0.10.0
enforceQuota: true
flow: standalone-create
flow: standalone-edit
icons:
- src: https://cdn.appscode.com/k8s/icons/action-icons/compute.svg
type: image/svg+xml
name: Compute
operationId: create-opsrequest-compute
operationId: edit-self-compute-autoscaler
name: Autoscaling
- items:
- editor:
Expand Down
Loading

0 comments on commit 6729940

Please sign in to comment.