Skip to content

Commit

Permalink
remove gotohelm in favor of operator gotohelm
Browse files Browse the repository at this point in the history
Prior to this commit `gotohelm` was duplicated in the `redpanda-operator` repo.

This commit removes `pkg/gotohelm` and instead depends on `pkg/gotohelm` from
the redpanda-operator repository. Due to the use of `replace` directives in the
go.mod of `redpanda-operator/gotohelm`, it's not currently possible to `go
install` it. As a temporary workaround, the `main.go` for gotohelm has been
preserved in this repository.

As gotohelm now requires go >= 1.23, this commit also syncs the `flake.lock`
for this repository with the redpanda-operator.
  • Loading branch information
chrisseto committed Dec 16, 2024
1 parent b0a8f61 commit 3bfb076
Show file tree
Hide file tree
Showing 194 changed files with 1,468 additions and 15,112 deletions.
2 changes: 0 additions & 2 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ tasks:
- task: chart:generate:connectors
# Ensure go deps are up to date
- go mod tidy
# Ensure go deps in the gotohelm test package are up to date
- cd ./pkg/gotohelm/testdata/src/example && go mod tidy
- go work sync
# Ensure flake.nix has been formatted.
- nix fmt
Expand Down
2 changes: 1 addition & 1 deletion charts/connect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ logger:
```

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

## Source Code

Expand Down
2 changes: 1 addition & 1 deletion charts/connectors/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This page describes the official Redpanda Connectors Helm Chart. In particular,
For instructions on how to install and use the chart, including how to override and customize the chart’s values, refer to the [deployment documentation](https://docs.redpanda.com/current/deploy/deployment-option/self-hosted/kubernetes/k-deploy-connectors/).

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

## Source Code

Expand Down
4 changes: 2 additions & 2 deletions charts/connectors/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
_ "embed"

monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/redpanda-data/helm-charts/pkg/gotohelm"
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
"github.com/redpanda-data/helm-charts/pkg/kube"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/scheme"
Expand Down
2 changes: 1 addition & 1 deletion charts/connectors/chart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"

fuzz "github.com/google/gofuzz"
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
"github.com/redpanda-data/helm-charts/pkg/helm"
"github.com/redpanda-data/helm-charts/pkg/kube"
"github.com/redpanda-data/helm-charts/pkg/testutil"
Expand Down
2 changes: 1 addition & 1 deletion charts/connectors/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package connectors
import (
"fmt"

"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion charts/connectors/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package connectors
import (
"fmt"

"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
)

func Name(dot *helmette.Dot) string {
Expand Down
2 changes: 1 addition & 1 deletion charts/connectors/podmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package connectors

import (
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion charts/connectors/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package connectors

import (
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down
2 changes: 1 addition & 1 deletion charts/connectors/serviceaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package connectors

import (
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
47 changes: 15 additions & 32 deletions charts/connectors/templates/_shims.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,6 @@
{{- end -}}
{{- end -}}

{{- define "_shims.compact" -}}
{{- $args := (index .a 0) -}}
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $out := (dict ) -}}
{{- range $i, $e := $args -}}
{{- $_ := (set $out (printf "T%d" ((add (1 | int) $i) | int)) $e) -}}
{{- end -}}
{{- if $_is_returning -}}
{{- break -}}
{{- end -}}
{{- $_is_returning = true -}}
{{- (dict "r" $out) | toJson -}}
{{- break -}}
{{- end -}}
{{- end -}}

{{- define "_shims.deref" -}}
{{- $ptr := (index .a 0) -}}
{{- range $_ := (list 1) -}}
Expand Down Expand Up @@ -223,9 +206,9 @@
{{- $reprStr := (toString $repr) -}}
{{- $unit := (regexFind "(k|m|M|G|T|P|Ki|Mi|Gi|Ti|Pi)$" $repr) -}}
{{- $numeric := (float64 (substr (0 | int) ((sub ((get (fromJson (include "_shims.len" (dict "a" (list $reprStr) ))) "r") | int) ((get (fromJson (include "_shims.len" (dict "a" (list $unit) ))) "r") | int)) | int) $reprStr)) -}}
{{- $tmp_tuple_1 := (get (fromJson (include "_shims.compact" (dict "a" (list (get (fromJson (include "_shims.dicttest" (dict "a" (list (dict "" 1.0 "m" 0.001 "k" (1000 | int) "M" (1000000 | int) "G" (1000000000 | int) "T" (1000000000000 | int) "P" (1000000000000000 | int) "Ki" (1024 | int) "Mi" (1048576 | int) "Gi" (1073741824 | int) "Ti" (1099511627776 | int) "Pi" (1125899906842624 | int) ) $unit (coalesce nil)) ))) "r")) ))) "r") -}}
{{- $ok := $tmp_tuple_1.T2 -}}
{{- $scale := ($tmp_tuple_1.T1 | float64) -}}
{{- $_184_scale_ok := (get (fromJson (include "_shims.dicttest" (dict "a" (list (dict "" 1.0 "m" 0.001 "k" (1000 | int) "M" (1000000 | int) "G" (1000000000 | int) "T" (1000000000000 | int) "P" (1000000000000000 | int) "Ki" (1024 | int) "Mi" (1048576 | int) "Gi" (1073741824 | int) "Ti" (1099511627776 | int) "Pi" (1125899906842624 | int) ) $unit (float64 0)) ))) "r") -}}
{{- $scale := ((index $_184_scale_ok 0) | float64) -}}
{{- $ok := (index $_184_scale_ok 1) -}}
{{- if (not $ok) -}}
{{- $_ := (fail (printf "unknown unit: %q" $unit)) -}}
{{- end -}}
Expand All @@ -239,9 +222,9 @@
{{- $repr := (index .a 0) -}}
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $tmp_tuple_2 := (get (fromJson (include "_shims.compact" (dict "a" (list (get (fromJson (include "_shims.parseResource" (dict "a" (list $repr) ))) "r")) ))) "r") -}}
{{- $scale := ($tmp_tuple_2.T2 | float64) -}}
{{- $numeric := ($tmp_tuple_2.T1 | float64) -}}
{{- $_207_numeric_scale := (get (fromJson (include "_shims.parseResource" (dict "a" (list $repr) ))) "r") -}}
{{- $numeric := ((index $_207_numeric_scale 0) | float64) -}}
{{- $scale := ((index $_207_numeric_scale 1) | float64) -}}
{{- $strs := (list "" "m" "k" "M" "G" "T" "P" "Ki" "Mi" "Gi" "Ti" "Pi") -}}
{{- $scales := (list 1.0 0.001 (1000 | int) (1000000 | int) (1000000000 | int) (1000000000000 | int) (1000000000000000 | int) (1024 | int) (1048576 | int) (1073741824 | int) (1099511627776 | int) (1125899906842624 | int)) -}}
{{- $idx := -1 -}}
Expand All @@ -267,9 +250,9 @@
{{- $repr := (index .a 0) -}}
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $tmp_tuple_3 := (get (fromJson (include "_shims.compact" (dict "a" (list (get (fromJson (include "_shims.parseResource" (dict "a" (list $repr) ))) "r")) ))) "r") -}}
{{- $scale := ($tmp_tuple_3.T2 | float64) -}}
{{- $numeric := ($tmp_tuple_3.T1 | float64) -}}
{{- $_234_numeric_scale := (get (fromJson (include "_shims.parseResource" (dict "a" (list $repr) ))) "r") -}}
{{- $numeric := ((index $_234_numeric_scale 0) | float64) -}}
{{- $scale := ((index $_234_numeric_scale 1) | float64) -}}
{{- $_is_returning = true -}}
{{- (dict "r" (int64 (ceil ((mulf $numeric $scale) | float64)))) | toJson -}}
{{- break -}}
Expand All @@ -280,9 +263,9 @@
{{- $repr := (index .a 0) -}}
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $tmp_tuple_4 := (get (fromJson (include "_shims.compact" (dict "a" (list (get (fromJson (include "_shims.parseResource" (dict "a" (list $repr) ))) "r")) ))) "r") -}}
{{- $scale := ($tmp_tuple_4.T2 | float64) -}}
{{- $numeric := ($tmp_tuple_4.T1 | float64) -}}
{{- $_239_numeric_scale := (get (fromJson (include "_shims.parseResource" (dict "a" (list $repr) ))) "r") -}}
{{- $numeric := ((index $_239_numeric_scale 0) | float64) -}}
{{- $scale := ((index $_239_numeric_scale 1) | float64) -}}
{{- $_is_returning = true -}}
{{- (dict "r" (int64 (ceil ((mulf ((mulf $numeric 1000.0) | float64) $scale) | float64)))) | toJson -}}
{{- break -}}
Expand All @@ -293,7 +276,7 @@
{{- $repr := (index .a 0) -}}
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $unitMap := (dict "s" (1000000000 | int64) "m" (60000000000 | int64) "h" (3600000000000 | int64) ) -}}
{{- $unitMap := (dict "s" ((1000000000 | int64) | int64) "m" ((60000000000 | int64) | int64) "h" ((3600000000000 | int64) | int64) ) -}}
{{- $original := $repr -}}
{{- $value := ((0 | int64) | int64) -}}
{{- if (eq $repr "") -}}
Expand All @@ -318,7 +301,7 @@
{{- $_ := (fail (printf "invalid Duration: %q" $original)) -}}
{{- end -}}
{{- $repr = (substr ((get (fromJson (include "_shims.len" (dict "a" (list $unit) ))) "r") | int) -1 $repr) -}}
{{- $value = ((add $value (((mul (int64 $n) (index $unitMap $unit)) | int64))) | int64) -}}
{{- $value = ((add $value (((mul (int64 $n) (ternary (index $unitMap $unit) 0 (hasKey $unitMap $unit))) | int64))) | int64) -}}
{{- end -}}
{{- if $_is_returning -}}
{{- break -}}
Expand All @@ -334,7 +317,7 @@
{{- range $_ := (list 1) -}}
{{- $_is_returning := false -}}
{{- $_is_returning = true -}}
{{- (dict "r" (duration ((div $dur (1000000000 | int64)) | int64))) | toJson -}}
{{- (dict "r" (duration ((div $dur ((1000000000 | int64) | int64)) | int64))) | toJson -}}
{{- break -}}
{{- end -}}
{{- end -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/connectors/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
_ "embed"

monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
Expand Down
2 changes: 1 addition & 1 deletion charts/console/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ For instructions on how to install and use the chart, refer to the [deployment d
For instructions on how to override and customize the chart’s values, see [Configure Redpanda Console](https://docs.redpanda.com/docs/manage/kubernetes/configure-helm-chart/#configure-redpanda-console).

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)

## Source Code

Expand Down
4 changes: 2 additions & 2 deletions charts/console/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ package console
import (
_ "embed"

"github.com/redpanda-data/helm-charts/pkg/gotohelm"
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
"github.com/redpanda-data/helm-charts/pkg/kube"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/scheme"
Expand Down
2 changes: 1 addition & 1 deletion charts/console/chart_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"testing"

fuzz "github.com/google/gofuzz"
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
"github.com/redpanda-data/helm-charts/pkg/helm"
"github.com/redpanda-data/helm-charts/pkg/kube"
"github.com/redpanda-data/helm-charts/pkg/testutil"
Expand Down
2 changes: 1 addition & 1 deletion charts/console/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package console
import (
"fmt"

"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
2 changes: 1 addition & 1 deletion charts/console/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package console
import (
"fmt"

"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion charts/console/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"strings"

"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
)

// Expand the name of the chart.
Expand Down
2 changes: 1 addition & 1 deletion charts/console/hpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package console

import (
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
autoscalingv2 "k8s.io/api/autoscaling/v2"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down
2 changes: 1 addition & 1 deletion charts/console/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package console

import (
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
networkingv1 "k8s.io/api/networking/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down
2 changes: 1 addition & 1 deletion charts/console/notes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package console
import (
"fmt"

"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
)

func Notes(dot *helmette.Dot) []string {
Expand Down
2 changes: 1 addition & 1 deletion charts/console/secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package console

import (
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
Expand Down
2 changes: 1 addition & 1 deletion charts/console/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package console

import (
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down
2 changes: 1 addition & 1 deletion charts/console/serviceaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package console

import (
"github.com/redpanda-data/helm-charts/pkg/gotohelm/helmette"
"github.com/redpanda-data/redpanda-operator/pkg/gotohelm/helmette"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/utils/ptr"
Expand Down
6 changes: 3 additions & 3 deletions charts/console/templates/_deployment.go.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
{{- $listenPort = $values.service.targetPort -}}
{{- end -}}
{{- $configListenPort := (dig "server" "listenPort" (coalesce nil) $values.console.config) -}}
{{- $tmp_tuple_1 := (get (fromJson (include "_shims.compact" (dict "a" (list (get (fromJson (include "_shims.asintegral" (dict "a" (list $configListenPort) ))) "r")) ))) "r") -}}
{{- $ok_2 := $tmp_tuple_1.T2 -}}
{{- $asInt_1 := ($tmp_tuple_1.T1 | int) -}}
{{- $_42_asInt_1_ok_2 := (get (fromJson (include "_shims.asintegral" (dict "a" (list $configListenPort) ))) "r") -}}
{{- $asInt_1 := ((index $_42_asInt_1_ok_2 0) | int) -}}
{{- $ok_2 := (index $_42_asInt_1_ok_2 1) -}}
{{- if $ok_2 -}}
{{- $_is_returning = true -}}
{{- (dict "r" ($asInt_1 | int)) | toJson -}}
Expand Down
Loading

0 comments on commit 3bfb076

Please sign in to comment.