From b2d22d1922645dda2494780f30f6085a2d98a55a Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Wed, 18 Mar 2026 12:48:16 +0100 Subject: [PATCH 1/5] use latest version of polly --- cmd/command/cd/cd_clusters.go | 4 ++-- cmd/command/cd/cd_notifications.go | 2 +- cmd/command/cd/cd_services.go | 6 +++--- cmd/command/up/up.go | 2 +- go.mod | 12 +++++++----- go.sum | 25 ++++++++++++++----------- pkg/api/users.go | 2 +- pkg/cd/control_plane_install.go | 2 +- pkg/cd/template/render.go | 2 +- pkg/client/plural.go | 2 +- pkg/common/validation.go | 2 +- pkg/console/agent.go | 2 +- pkg/console/pipelines.go | 2 +- pkg/crypto/age.go | 4 ++-- pkg/manifest/manifest.go | 2 +- pkg/pr/apply_test.go | 2 +- pkg/pr/crd.go | 2 +- pkg/pr/creates.go | 2 +- pkg/pr/lua.go | 2 +- pkg/pr/utils.go | 2 +- pkg/provider/gcp/client.go | 2 +- pkg/provider/gcp/validation.go | 2 +- pkg/provider/permissions/gcp.go | 2 +- pkg/provider/provider.go | 4 ++-- pkg/scm/bitbucket.go | 2 +- pkg/template/funcs.go | 2 +- pkg/test/e2e/e2e_api_test.go | 2 +- pkg/up/template.go | 2 +- 28 files changed, 52 insertions(+), 47 deletions(-) diff --git a/cmd/command/cd/cd_clusters.go b/cmd/command/cd/cd_clusters.go index a0394bed5..ecadd3b7e 100644 --- a/cmd/command/cd/cd_clusters.go +++ b/cmd/command/cd/cd_clusters.go @@ -8,8 +8,8 @@ import ( "github.com/AlecAivazis/survey/v2" gqlclient "github.com/pluralsh/console/go/client" - "github.com/pluralsh/polly/algorithms" - "github.com/pluralsh/polly/containers" + "github.com/pluralsh/console/go/polly/algorithms" + "github.com/pluralsh/console/go/polly/containers" "github.com/samber/lo" "github.com/urfave/cli" "sigs.k8s.io/yaml" diff --git a/cmd/command/cd/cd_notifications.go b/cmd/command/cd/cd_notifications.go index 35b0ceeb1..ebc3a2515 100644 --- a/cmd/command/cd/cd_notifications.go +++ b/cmd/command/cd/cd_notifications.go @@ -3,9 +3,9 @@ package cd import ( "github.com/AlecAivazis/survey/v2" consoleclient "github.com/pluralsh/console/go/client" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/pluralsh/plural-cli/pkg/common" "github.com/pluralsh/plural-cli/pkg/utils" - "github.com/pluralsh/polly/algorithms" "github.com/urfave/cli" ) diff --git a/cmd/command/cd/cd_services.go b/cmd/command/cd/cd_services.go index 4d7b156ed..4b1c55456 100644 --- a/cmd/command/cd/cd_services.go +++ b/cmd/command/cd/cd_services.go @@ -8,16 +8,16 @@ import ( "sort" "strings" + "github.com/pluralsh/console/go/polly/fs" "github.com/pluralsh/plural-cli/pkg/common" - "github.com/pluralsh/polly/fs" lua "github.com/yuin/gopher-lua" gqlclient "github.com/pluralsh/console/go/client" + "github.com/pluralsh/console/go/polly/containers" + "github.com/pluralsh/console/go/polly/luautils" "github.com/pluralsh/plural-cli/pkg/cd/template" "github.com/pluralsh/plural-cli/pkg/console" "github.com/pluralsh/plural-cli/pkg/utils" - "github.com/pluralsh/polly/containers" - "github.com/pluralsh/polly/luautils" "github.com/samber/lo" "github.com/urfave/cli" "k8s.io/apimachinery/pkg/util/yaml" diff --git a/cmd/command/up/up.go b/cmd/command/up/up.go index 8d6c513e2..88ef81dcc 100644 --- a/cmd/command/up/up.go +++ b/cmd/command/up/up.go @@ -7,7 +7,7 @@ import ( "strings" "github.com/AlecAivazis/survey/v2" - "github.com/pluralsh/polly/algorithms" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/samber/lo" "github.com/urfave/cli" diff --git a/go.mod b/go.mod index d8e2dd1f5..604377b78 100644 --- a/go.mod +++ b/go.mod @@ -38,14 +38,14 @@ require ( github.com/likexian/doh v0.7.1 github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a github.com/mitchellh/go-homedir v1.1.0 - github.com/mitchellh/mapstructure v1.5.0 + github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c github.com/olekukonko/tablewriter v0.0.5 github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c github.com/pluralsh/console/go/client v1.61.0 github.com/pluralsh/console/go/controller v0.0.0-20260129150042-18e31f596bd7 + github.com/pluralsh/console/go/polly v1.0.0 github.com/pluralsh/gqlclient v1.12.2 github.com/pluralsh/plural-operator v0.5.5 - github.com/pluralsh/polly v0.3.7 github.com/posthog/posthog-go v1.4.10 github.com/samber/lo v1.52.0 github.com/urfave/cli v1.22.16 @@ -60,7 +60,7 @@ require ( gotest.tools/v3 v3.5.1 helm.sh/helm/v3 v3.20.0 k8s.io/api v0.35.1 - k8s.io/apimachinery v0.35.1 + k8s.io/apimachinery v0.35.2 k8s.io/client-go v0.35.1 sigs.k8s.io/controller-runtime v0.23.1 sigs.k8s.io/yaml v1.6.0 @@ -172,13 +172,14 @@ require ( github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect github.com/mitchellh/pointerstructure v1.2.1 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/osteele/liquid v1.6.0 // indirect - github.com/osteele/tuesday v1.0.3 // indirect + github.com/osteele/liquid v1.8.1 // indirect + github.com/osteele/tuesday v1.0.4 // indirect github.com/outcaste-io/ristretto v0.2.3 // indirect github.com/philhofer/fwd v1.1.3-0.20240916144458-20a13a1f6b7c // indirect github.com/pjbgf/sha1cd v0.5.0 // indirect github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect github.com/pluralsh/controller-reconcile-helper v0.1.0 // indirect + github.com/pluralsh/polly v0.3.6 // indirect github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect github.com/prometheus/client_golang v1.23.2 // indirect github.com/prometheus/client_model v0.6.2 // indirect @@ -224,6 +225,7 @@ require ( go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/exp v0.0.0-20260218203240-3dfff04db8fa // indirect golang.org/x/mod v0.33.0 // indirect + golang.org/x/tools v0.42.0 // indirect golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect google.golang.org/genproto v0.0.0-20260217215200-42d3e9bedb6d // indirect diff --git a/go.sum b/go.sum index 054df2716..e776bc1b9 100644 --- a/go.sum +++ b/go.sum @@ -284,8 +284,8 @@ github.com/distribution/distribution/v3 v3.0.0 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN github.com/distribution/distribution/v3 v3.0.0/go.mod h1:tRNuFoZsUdyRVegq8xGNeds4KLjwLCRin/tTo6i1DhU= github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= -github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= -github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= +github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/cli v29.2.0+incompatible h1:9oBd9+YM7rxjZLfyMGxjraKBKE4/nVyvVfN4qNl9XRM= github.com/docker/cli v29.2.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk= @@ -565,8 +565,9 @@ github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrk github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c h1:cqn374mizHuIWj+OSJCajGr/phAmuMug9qIX3l9CflE= +github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/pointerstructure v1.2.1 h1:ZhBBeX8tSlRpu/FFhXH4RC4OJzFlqsQhoHZAz4x7TIw= github.com/mitchellh/pointerstructure v1.2.1/go.mod h1:BRAsLI5zgXmw97Lf6s25bs8ohIXc3tViBH44KcwB2g4= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -600,10 +601,10 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8 github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= github.com/opencontainers/image-spec v1.1.1/go.mod h1:qpqAh3Dmcf36wStyyWU+kCeDgrGnAve2nCC8+7h8Q0M= -github.com/osteele/liquid v1.6.0 h1:bTsbZjPIr7F+pU+K6o//Y5//W4McMzvUlMXWGOVvpc0= -github.com/osteele/liquid v1.6.0/go.mod h1:xU0Z2dn2hOQIEFEWNmeltOmCtfhtoW/2fCyiNQeNG+U= -github.com/osteele/tuesday v1.0.3 h1:SrCmo6sWwSgnvs1bivmXLvD7Ko9+aJvvkmDjB5G4FTU= -github.com/osteele/tuesday v1.0.3/go.mod h1:pREKpE+L03UFuR+hiznj3q7j3qB1rUZ4XfKejwWFF2M= +github.com/osteele/liquid v1.8.1 h1:b+uxMOkD1OOLxueaSvrE0yx6nMqf023DZPPAjPWT5eI= +github.com/osteele/liquid v1.8.1/go.mod h1:SFqQ9ddbCoKceuG6RckCLJ0hcxUbGhLpvcXJGmHlCWA= +github.com/osteele/tuesday v1.0.4 h1:iX0xOLW08/FJtXUCr20ngYwOwBE6l/mf7mz8NIv4yl8= +github.com/osteele/tuesday v1.0.4/go.mod h1:5fgEemYhErJF09RNEwU+PdYiwm5Ar7Bknlhs1CD/Ol8= github.com/outcaste-io/ristretto v0.2.3 h1:AK4zt/fJ76kjlYObOeNwh4T3asEuaCmp26pOvUOL9w0= github.com/outcaste-io/ristretto v0.2.3/go.mod h1:W8HywhmtlopSB1jeMg3JtdIhf+DYkLAr0VN/s4+MHac= github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= @@ -625,6 +626,8 @@ github.com/pluralsh/console/go/client v1.61.0 h1:gy5tglnBLoMA6iBgXoCxXJFGpTUvRWh github.com/pluralsh/console/go/client v1.61.0/go.mod h1:lqN15ajFf+0MtnNQNb9rvQpxkdsuMg47Yd9dSdQDIAk= github.com/pluralsh/console/go/controller v0.0.0-20260129150042-18e31f596bd7 h1:CwBTb7Tvt11nO/XJ1PA9fbCsJSlz9/nDN1OJU0Pddsg= github.com/pluralsh/console/go/controller v0.0.0-20260129150042-18e31f596bd7/go.mod h1:bbAQqSq+Rne2mBzUwAVAaGOcR75sJZhnHdpDmHLTq2U= +github.com/pluralsh/console/go/polly v1.0.0 h1:NRg8CMITGllEJ08oYidNuuG/gJGDdDuga8TM+gdIcFA= +github.com/pluralsh/console/go/polly v1.0.0/go.mod h1:eH42iPlRip2bs6tB+Vg6fxC/sz6oWxyNGVDE9uyA5EY= github.com/pluralsh/controller-reconcile-helper v0.1.0 h1:BV3dYZFH5rn8ZvZjtpkACSv/GmLEtRftNQj/Y4ddHEo= github.com/pluralsh/controller-reconcile-helper v0.1.0/go.mod h1:RxAbvSB4/jkvx616krCdNQXPbpGJXW3J1L3rASxeFOA= github.com/pluralsh/gqlclient v1.12.2 h1:BrEFAASktf4quFw57CIaLAd+NZUTLhG08fe6tnhBQN4= @@ -633,8 +636,8 @@ github.com/pluralsh/oauth v0.9.2 h1:tM9hBK4tCnJUeCOgX0ctxBBCS3hiCDPoxkJLODtedmQ= github.com/pluralsh/oauth v0.9.2/go.mod h1:aTUw/75rzcsbvW+/TLvWtHVDXFIdtFrDtUncOq9vHyM= github.com/pluralsh/plural-operator v0.5.5 h1:57GxniNjUa3hpHgvFr9oDonFgvDUC8XDD5B0e7Xduzk= github.com/pluralsh/plural-operator v0.5.5/go.mod h1:WIXiz26/WDcUn0FA7Q1jPxmfsm98U1/JL8YpIdKVLX0= -github.com/pluralsh/polly v0.3.7 h1:Nc7tvCbKdOGDABRa4jUE+FLifrPOgA2u49hQSCHESoo= -github.com/pluralsh/polly v0.3.7/go.mod h1:R58Twx1xxoc5a5o8ZDsaVJxqcqQp16Aajd/iqmOw3ak= +github.com/pluralsh/polly v0.3.6 h1:mzPz+xqszE/WxM75GpL2OjaRIeIa/2tvV9yETJqQ28k= +github.com/pluralsh/polly v0.3.6/go.mod h1:R58Twx1xxoc5a5o8ZDsaVJxqcqQp16Aajd/iqmOw3ak= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= @@ -1042,8 +1045,8 @@ k8s.io/api v0.35.1 h1:0PO/1FhlK/EQNVK5+txc4FuhQibV25VLSdLMmGpDE/Q= k8s.io/api v0.35.1/go.mod h1:28uR9xlXWml9eT0uaGo6y71xK86JBELShLy4wR1XtxM= k8s.io/apiextensions-apiserver v0.35.1 h1:p5vvALkknlOcAqARwjS20kJffgzHqwyQRM8vHLwgU7w= k8s.io/apiextensions-apiserver v0.35.1/go.mod h1:2CN4fe1GZ3HMe4wBr25qXyJnJyZaquy4nNlNmb3R7AQ= -k8s.io/apimachinery v0.35.1 h1:yxO6gV555P1YV0SANtnTjXYfiivaTPvCTKX6w6qdDsU= -k8s.io/apimachinery v0.35.1/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= +k8s.io/apimachinery v0.35.2 h1:NqsM/mmZA7sHW02JZ9RTtk3wInRgbVxL8MPfzSANAK8= +k8s.io/apimachinery v0.35.2/go.mod h1:jQCgFZFR1F4Ik7hvr2g84RTJSZegBc8yHgFWKn//hns= k8s.io/apiserver v0.35.1 h1:potxdhhTL4i6AYAa2QCwtlhtB1eCdWQFvJV6fXgJzxs= k8s.io/apiserver v0.35.1/go.mod h1:BiL6Dd3A2I/0lBnteXfWmCFobHM39vt5+hJQd7Lbpi4= k8s.io/cli-runtime v0.35.1 h1:uKcXFe8J7AMAM4Gm2JDK4mp198dBEq2nyeYtO+JfGJE= diff --git a/pkg/api/users.go b/pkg/api/users.go index cf786efc8..c7d7831e1 100644 --- a/pkg/api/users.go +++ b/pkg/api/users.go @@ -3,8 +3,8 @@ package api import ( "fmt" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/pluralsh/gqlclient" - "github.com/pluralsh/polly/algorithms" "github.com/samber/lo" ) diff --git a/pkg/cd/control_plane_install.go b/pkg/cd/control_plane_install.go index 3e45924d9..c97bc8370 100644 --- a/pkg/cd/control_plane_install.go +++ b/pkg/cd/control_plane_install.go @@ -10,7 +10,7 @@ import ( "gopkg.in/yaml.v3" "github.com/AlecAivazis/survey/v2" - pollytemplate "github.com/pluralsh/polly/template" + pollytemplate "github.com/pluralsh/console/go/polly/template" "github.com/pluralsh/plural-cli/pkg/api" "github.com/pluralsh/plural-cli/pkg/bundle" diff --git a/pkg/cd/template/render.go b/pkg/cd/template/render.go index 37e3be582..a81dec351 100644 --- a/pkg/cd/template/render.go +++ b/pkg/cd/template/render.go @@ -6,7 +6,7 @@ import ( "strings" console "github.com/pluralsh/console/go/client" - "github.com/pluralsh/polly/template" + "github.com/pluralsh/console/go/polly/template" ) func RenderYaml(path string, bindings map[string]interface{}) ([]byte, error) { diff --git a/pkg/client/plural.go b/pkg/client/plural.go index 584ad0b17..901c427e6 100644 --- a/pkg/client/plural.go +++ b/pkg/client/plural.go @@ -7,8 +7,8 @@ import ( "os/exec" "strings" + "github.com/pluralsh/console/go/polly/algorithms" gitutils "github.com/pluralsh/plural-cli/pkg/utils/git" - "github.com/pluralsh/polly/algorithms" "github.com/samber/lo" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/common/validation.go b/pkg/common/validation.go index 5a1d3d617..75fcdb8cb 100644 --- a/pkg/common/validation.go +++ b/pkg/common/validation.go @@ -4,8 +4,8 @@ import ( "fmt" "os" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/pluralsh/plural-cli/pkg/provider" - "github.com/pluralsh/polly/algorithms" "github.com/AlecAivazis/survey/v2" "github.com/pluralsh/plural-cli/pkg/api" diff --git a/pkg/console/agent.go b/pkg/console/agent.go index 65a34ff73..faa45f0f7 100644 --- a/pkg/console/agent.go +++ b/pkg/console/agent.go @@ -10,9 +10,9 @@ import ( "time" "github.com/pkg/errors" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/pluralsh/plural-cli/pkg/helm" "github.com/pluralsh/plural-cli/pkg/utils" - "github.com/pluralsh/polly/algorithms" "helm.sh/helm/v3/pkg/action" "helm.sh/helm/v3/pkg/chart" "helm.sh/helm/v3/pkg/chart/loader" diff --git a/pkg/console/pipelines.go b/pkg/console/pipelines.go index 0215c9b40..b1745042f 100644 --- a/pkg/console/pipelines.go +++ b/pkg/console/pipelines.go @@ -4,9 +4,9 @@ import ( "strings" gqlclient "github.com/pluralsh/console/go/client" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/pluralsh/plural-cli/pkg/api" "github.com/pluralsh/plural-cli/pkg/utils" - "github.com/pluralsh/polly/algorithms" "github.com/samber/lo" "sigs.k8s.io/yaml" ) diff --git a/pkg/crypto/age.go b/pkg/crypto/age.go index 1f75d94f7..605be5e64 100644 --- a/pkg/crypto/age.go +++ b/pkg/crypto/age.go @@ -10,13 +10,13 @@ import ( "time" "filippo.io/age" + "github.com/pluralsh/console/go/polly/algorithms" + "github.com/pluralsh/console/go/polly/containers" "github.com/pluralsh/plural-cli/pkg/api" "github.com/pluralsh/plural-cli/pkg/config" "github.com/pluralsh/plural-cli/pkg/utils" "github.com/pluralsh/plural-cli/pkg/utils/git" "github.com/pluralsh/plural-cli/pkg/utils/pathing" - "github.com/pluralsh/polly/algorithms" - "github.com/pluralsh/polly/containers" "github.com/samber/lo" "gopkg.in/yaml.v2" ) diff --git a/pkg/manifest/manifest.go b/pkg/manifest/manifest.go index b43fea5be..0c666ff0e 100644 --- a/pkg/manifest/manifest.go +++ b/pkg/manifest/manifest.go @@ -9,10 +9,10 @@ import ( "github.com/AlecAivazis/survey/v2" "gopkg.in/yaml.v2" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/pluralsh/plural-cli/pkg/api" "github.com/pluralsh/plural-cli/pkg/utils" "github.com/pluralsh/plural-cli/pkg/utils/pathing" - "github.com/pluralsh/polly/algorithms" ) const pluralDomain = "onplural.sh" diff --git a/pkg/pr/apply_test.go b/pkg/pr/apply_test.go index 0da2cfe41..a3a9e7b38 100644 --- a/pkg/pr/apply_test.go +++ b/pkg/pr/apply_test.go @@ -6,7 +6,7 @@ import ( "path/filepath" "testing" - "github.com/pluralsh/polly/algorithms" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/samber/lo" "gotest.tools/v3/assert" diff --git a/pkg/pr/crd.go b/pkg/pr/crd.go index 654b9fca9..ddf987f51 100644 --- a/pkg/pr/crd.go +++ b/pkg/pr/crd.go @@ -14,7 +14,7 @@ import ( "github.com/pluralsh/plural-cli/pkg/utils" "github.com/pluralsh/console/go/controller/api/v1alpha1" - "github.com/pluralsh/polly/algorithms" + "github.com/pluralsh/console/go/polly/algorithms" "sigs.k8s.io/yaml" ) diff --git a/pkg/pr/creates.go b/pkg/pr/creates.go index 154840910..f405b5270 100644 --- a/pkg/pr/creates.go +++ b/pkg/pr/creates.go @@ -3,8 +3,8 @@ package pr import ( "path/filepath" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/pluralsh/plural-cli/pkg/utils" - "github.com/pluralsh/polly/algorithms" ) type replacement struct { diff --git a/pkg/pr/lua.go b/pkg/pr/lua.go index e33d8ca95..2b277cc56 100644 --- a/pkg/pr/lua.go +++ b/pkg/pr/lua.go @@ -10,7 +10,7 @@ import ( "strings" "dario.cat/mergo" - "github.com/pluralsh/polly/luautils" + "github.com/pluralsh/console/go/polly/luautils" lua "github.com/yuin/gopher-lua" ) diff --git a/pkg/pr/utils.go b/pkg/pr/utils.go index 05c4b5942..7610f7f43 100644 --- a/pkg/pr/utils.go +++ b/pkg/pr/utils.go @@ -5,7 +5,7 @@ import ( "path/filepath" "github.com/hashicorp/go-bexpr" - "github.com/pluralsh/polly/template" + "github.com/pluralsh/console/go/polly/template" ) func templateReplacement(data []byte, ctx map[string]interface{}) ([]byte, error) { diff --git a/pkg/provider/gcp/client.go b/pkg/provider/gcp/client.go index 70d559c81..842f42827 100644 --- a/pkg/provider/gcp/client.go +++ b/pkg/provider/gcp/client.go @@ -13,7 +13,7 @@ import ( "cloud.google.com/go/resourcemanager/apiv3/resourcemanagerpb" serviceusage "cloud.google.com/go/serviceusage/apiv1" "cloud.google.com/go/storage" - "github.com/pluralsh/polly/algorithms" + "github.com/pluralsh/console/go/polly/algorithms" "golang.org/x/oauth2/google" "google.golang.org/api/dns/v1" "google.golang.org/api/iterator" diff --git a/pkg/provider/gcp/validation.go b/pkg/provider/gcp/validation.go index b7b15efa7..2b900c06d 100644 --- a/pkg/provider/gcp/validation.go +++ b/pkg/provider/gcp/validation.go @@ -6,7 +6,7 @@ import ( "strings" "cloud.google.com/go/serviceusage/apiv1/serviceusagepb" - "github.com/pluralsh/polly/algorithms" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/pluralsh/plural-cli/pkg/provider/permissions" provUtils "github.com/pluralsh/plural-cli/pkg/provider/utils" diff --git a/pkg/provider/permissions/gcp.go b/pkg/provider/permissions/gcp.go index 3560b93ed..a89dfecd9 100644 --- a/pkg/provider/permissions/gcp.go +++ b/pkg/provider/permissions/gcp.go @@ -6,7 +6,7 @@ import ( "cloud.google.com/go/iam/apiv1/iampb" resourcemanager "cloud.google.com/go/resourcemanager/apiv3" - "github.com/pluralsh/polly/containers" + "github.com/pluralsh/console/go/polly/containers" ) type GcpChecker struct { diff --git a/pkg/provider/provider.go b/pkg/provider/provider.go index 69b103af7..34674a59c 100644 --- a/pkg/provider/provider.go +++ b/pkg/provider/provider.go @@ -5,8 +5,8 @@ import ( "strings" "github.com/AlecAivazis/survey/v2" - "github.com/pluralsh/polly/algorithms" - "github.com/pluralsh/polly/containers" + "github.com/pluralsh/console/go/polly/algorithms" + "github.com/pluralsh/console/go/polly/containers" "github.com/pluralsh/plural-cli/pkg/api" "github.com/pluralsh/plural-cli/pkg/config" diff --git a/pkg/scm/bitbucket.go b/pkg/scm/bitbucket.go index e55c3ac8c..19ed96b7e 100644 --- a/pkg/scm/bitbucket.go +++ b/pkg/scm/bitbucket.go @@ -8,9 +8,9 @@ import ( "github.com/AlecAivazis/survey/v2" "github.com/ktrysmt/go-bitbucket" + "github.com/pluralsh/console/go/polly/algorithms" "github.com/pluralsh/oauth" "github.com/pluralsh/plural-cli/pkg/utils" - "github.com/pluralsh/polly/algorithms" ) var ( diff --git a/pkg/template/funcs.go b/pkg/template/funcs.go index c9a551639..d0771a344 100644 --- a/pkg/template/funcs.go +++ b/pkg/template/funcs.go @@ -10,7 +10,7 @@ import ( "gopkg.in/yaml.v2" - "github.com/pluralsh/polly/retry" + "github.com/pluralsh/console/go/polly/retry" "github.com/pluralsh/plural-cli/pkg/api" "github.com/pluralsh/plural-cli/pkg/config" diff --git a/pkg/test/e2e/e2e_api_test.go b/pkg/test/e2e/e2e_api_test.go index c89e4412c..8465ec1ed 100644 --- a/pkg/test/e2e/e2e_api_test.go +++ b/pkg/test/e2e/e2e_api_test.go @@ -8,7 +8,7 @@ import ( "strings" "testing" - "github.com/pluralsh/polly/containers" + "github.com/pluralsh/console/go/polly/containers" "github.com/stretchr/testify/assert" ) diff --git a/pkg/up/template.go b/pkg/up/template.go index 775ca3e91..519c04d3b 100644 --- a/pkg/up/template.go +++ b/pkg/up/template.go @@ -7,10 +7,10 @@ import ( "text/template" "time" + "github.com/pluralsh/console/go/polly/retry" "github.com/pluralsh/plural-cli/pkg/api" plrltpl "github.com/pluralsh/plural-cli/pkg/template" "github.com/pluralsh/plural-cli/pkg/utils" - "github.com/pluralsh/polly/retry" ) func (ctx *Context) redact(file string) error { From aae53c97b9c4764a18f399af18ee57c7e5b170c6 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Wed, 18 Mar 2026 13:23:57 +0100 Subject: [PATCH 2/5] implement dropdown selection for Azure DNS zones in domain setup --- cmd/command/up/up.go | 47 ++++++++++++++++++++++++++++++++----------- pkg/provider/azure.go | 18 ++++++++--------- 2 files changed, 43 insertions(+), 22 deletions(-) diff --git a/cmd/command/up/up.go b/cmd/command/up/up.go index 88ef81dcc..e228dd93d 100644 --- a/cmd/command/up/up.go +++ b/cmd/command/up/up.go @@ -244,15 +244,37 @@ func askAppDomain(project *manifest.ProjectManifest) error { } var domain string - message := "Enter the domain for your application. It's expected that the root domain already exist in your clouds DNS provider. Leave empty to ignore:" - if project.Provider == api.ProviderGCP { - message = "Enter the DNS zone name for your application. This should be the DNS zone name already configured in your cloud's DNS provider. Leave empty to ignore:" - } - prompt := &survey.Input{ - Message: message, - } - if err := survey.AskOne(prompt, &domain); err != nil { - return err + + switch project.Provider { + case api.ProviderAzure: + dnsZones, err := provider.AzureDNSZones(context.Background(), project.Project) + if err != nil { + return err + } + + const noneOption = "None" + if err := survey.AskOne( + &survey.Select{Message: "Select DNS zone (leave as None to skip):", Options: append([]string{noneOption}, dnsZones...)}, + &domain, + ); err != nil { + return err + } + + if domain == noneOption { + domain = "" + } + case api.ProviderGCP: + if err := survey.AskOne(&survey.Input{ + Message: "Enter the DNS zone name for your application. This should be the DNS zone name already configured in your cloud's DNS provider. Leave empty to ignore:", + }, &domain); err != nil { + return err + } + default: + if err := survey.AskOne(&survey.Input{ + Message: "Enter the domain for your application. It's expected that the root domain already exist in your clouds DNS provider. Leave empty to ignore:", + }, &domain); err != nil { + return err + } } return processAppDomain(domain, project) @@ -271,10 +293,11 @@ func processAppDomain(domain string, project *manifest.ProjectManifest) error { return err } case api.ProviderAzure: - // For Azure, we need to validate that the domain is set up in Azure DNS. - if err := provider.ValidateAzureDomainRegistration(context.Background(), domain, project.Project); err != nil { - return err + // The DNS zone was already selected interactively in askAppDomain; store it in context. + if project.Context == nil { + project.Context = map[string]interface{}{} } + project.Context["DNSZone"] = strings.TrimSuffix(domain, ".") case api.ProviderGCP: // For GCP, besides just validating that the domain is set up, // we also need to determine the managed DNS zone to use. diff --git a/pkg/provider/azure.go b/pkg/provider/azure.go index 40e80a00f..bb09661c0 100644 --- a/pkg/provider/azure.go +++ b/pkg/provider/azure.go @@ -9,7 +9,6 @@ import ( "net/url" "os/exec" "regexp" - "strings" "time" "github.com/Azure/azure-sdk-for-go/sdk/azcore" @@ -471,31 +470,30 @@ func getPathElement(path, indexName string) (string, error) { return "", fmt.Errorf("%s not found", indexName) } -func ValidateAzureDomainRegistration(ctx context.Context, domain, resourceGroup string) error { +func AzureDNSZones(ctx context.Context, resourceGroup string) ([]string, error) { subId, _, _, err := GetAzureAccount() if err != nil { - return err + return nil, err } clients, err := GetClientSet(subId) if err != nil { - return err + return nil, err } - d := strings.TrimSuffix(domain, ".") - + var zones []string pager := clients.Zones.NewListByResourceGroupPager(resourceGroup, nil) for pager.More() { resp, err := pager.NextPage(ctx) if err != nil { - return err + return nil, err } for _, zone := range resp.Value { - if lo.FromPtr(zone.Name) == d { - return nil // Domain is registered, return without error. + if name := lo.FromPtr(zone.Name); name != "" { + zones = append(zones, name) } } } - return fmt.Errorf("domain %s not found", domain) + return zones, nil } From 0f7e0dbbd79372555b5b76b6e67053125437afea Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Wed, 18 Mar 2026 13:29:27 +0100 Subject: [PATCH 3/5] implement dropdown selection for AWS hosted zones in domain setup --- cmd/command/up/up.go | 23 ++++++++++++++++++----- pkg/provider/aws.go | 15 +++++++-------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/cmd/command/up/up.go b/cmd/command/up/up.go index e228dd93d..5d4488e6c 100644 --- a/cmd/command/up/up.go +++ b/cmd/command/up/up.go @@ -26,6 +26,7 @@ import ( const ( defaultBootstrapBranch = "main" + noneOption = "None" ) type Plural struct { @@ -246,13 +247,28 @@ func askAppDomain(project *manifest.ProjectManifest) error { var domain string switch project.Provider { + case api.ProviderAWS: + hostedZones, err := provider.AWSHostedZones(context.Background(), project.Region) + if err != nil { + return err + } + + if err := survey.AskOne( + &survey.Select{Message: "Select hosted zone (leave as None to skip):", Options: append([]string{noneOption}, hostedZones...)}, + &domain, + ); err != nil { + return err + } + + if domain == noneOption { + domain = "" + } case api.ProviderAzure: dnsZones, err := provider.AzureDNSZones(context.Background(), project.Project) if err != nil { return err } - const noneOption = "None" if err := survey.AskOne( &survey.Select{Message: "Select DNS zone (leave as None to skip):", Options: append([]string{noneOption}, dnsZones...)}, &domain, @@ -288,10 +304,7 @@ func processAppDomain(domain string, project *manifest.ProjectManifest) error { switch project.Provider { case api.ProviderAWS: - // For AWS, we need to validate that the domain is set up in Route 53. - if err := provider.ValidateAWSDomainRegistration(context.Background(), domain, project.Region); err != nil { - return err - } + // The hosted zone was already selected interactively in askAppDomain; nothing more to do. case api.ProviderAzure: // The DNS zone was already selected interactively in askAppDomain; store it in context. if project.Context == nil { diff --git a/pkg/provider/aws.go b/pkg/provider/aws.go index 6eebfccc7..e84897914 100644 --- a/pkg/provider/aws.go +++ b/pkg/provider/aws.go @@ -270,17 +270,16 @@ func (aws *AWSProvider) Decommision(node *v1.Node) error { return plrlErrors.ErrorWrap(err, "failed to terminate instance") } -func ValidateAWSDomainRegistration(ctx context.Context, domain, region string) error { +func AWSHostedZones(ctx context.Context, region string) ([]string, error) { cfg, err := getAwsConfig(ctx) if err != nil { - return err + return nil, err } - d := strings.TrimSuffix(domain, ".") + "." // Route53 stores zone names with trailing dot. - cfg.Region = region // Route53 is a global service, but AWS SDK requires a region to be set. svc := route53.NewFromConfig(cfg) + var zones []string var marker *string for { input := &route53.ListHostedZonesInput{} @@ -290,12 +289,12 @@ func ValidateAWSDomainRegistration(ctx context.Context, domain, region string) e output, err := svc.ListHostedZones(ctx, input) if err != nil { - return plrlErrors.ErrorWrap(err, "Failed to list hosted zones: ") + return nil, plrlErrors.ErrorWrap(err, "Failed to list hosted zones: ") } for _, hz := range output.HostedZones { - if lo.FromPtr(hz.Name) == d { - return nil // Domain is registered, return without error. + if name := lo.FromPtr(hz.Name); name != "" { + zones = append(zones, strings.TrimSuffix(name, ".")) } } @@ -306,7 +305,7 @@ func ValidateAWSDomainRegistration(ctx context.Context, domain, region string) e } } - return fmt.Errorf("domain %s not found", domain) + return zones, nil } func (aws *AWSProvider) testIamPermissions() error { From 990af86d60da0da3067b2cc0d8612168d082f7be Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Wed, 18 Mar 2026 13:31:31 +0100 Subject: [PATCH 4/5] remove redundant DNS zone selection logic for AWS and Azure --- cmd/command/up/up.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/cmd/command/up/up.go b/cmd/command/up/up.go index 5d4488e6c..21f7e0b2e 100644 --- a/cmd/command/up/up.go +++ b/cmd/command/up/up.go @@ -303,14 +303,6 @@ func processAppDomain(domain string, project *manifest.ProjectManifest) error { } switch project.Provider { - case api.ProviderAWS: - // The hosted zone was already selected interactively in askAppDomain; nothing more to do. - case api.ProviderAzure: - // The DNS zone was already selected interactively in askAppDomain; store it in context. - if project.Context == nil { - project.Context = map[string]interface{}{} - } - project.Context["DNSZone"] = strings.TrimSuffix(domain, ".") case api.ProviderGCP: // For GCP, besides just validating that the domain is set up, // we also need to determine the managed DNS zone to use. From e4cba838683075776e2b6af9d6de048dd53abe17 Mon Sep 17 00:00:00 2001 From: Marcin Maciaszczyk Date: Wed, 18 Mar 2026 13:33:06 +0100 Subject: [PATCH 5/5] streamline GCP provider logic in DNS zone selection --- cmd/command/up/up.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/command/up/up.go b/cmd/command/up/up.go index 21f7e0b2e..a5599c5e9 100644 --- a/cmd/command/up/up.go +++ b/cmd/command/up/up.go @@ -302,8 +302,7 @@ func processAppDomain(domain string, project *manifest.ProjectManifest) error { return nil } - switch project.Provider { - case api.ProviderGCP: + if project.Provider == api.ProviderGCP { // For GCP, besides just validating that the domain is set up, // we also need to determine the managed DNS zone to use. // If there is one it will be automatically selected, if there are multiple,