From a02c90a8fbb7ea3c6daec7c350a598e0869c919e Mon Sep 17 00:00:00 2001 From: aknysh Date: Sat, 2 Nov 2024 10:48:20 -0400 Subject: [PATCH 1/3] updates --- examples/quick-start-advanced/Dockerfile | 2 +- go.mod | 23 ++++++------- go.sum | 44 ++++++++++++------------ internal/exec/help.go | 9 ++--- internal/exec/terraform.go | 33 +++++++++++------- internal/exec/terraform_utils.go | 12 +++++++ internal/exec/utils.go | 6 +++- pkg/utils/file_utils.go | 12 ++++--- website/docs/integrations/atlantis.mdx | 2 +- website/package-lock.json | 8 ++--- website/package.json | 2 +- 11 files changed, 90 insertions(+), 63 deletions(-) diff --git a/examples/quick-start-advanced/Dockerfile b/examples/quick-start-advanced/Dockerfile index bdfa09dc0..4e5fb3d20 100644 --- a/examples/quick-start-advanced/Dockerfile +++ b/examples/quick-start-advanced/Dockerfile @@ -6,7 +6,7 @@ ARG GEODESIC_OS=debian # https://atmos.tools/ # https://github.com/cloudposse/atmos # https://github.com/cloudposse/atmos/releases -ARG ATMOS_VERSION=1.99.0 +ARG ATMOS_VERSION=1.100.0 # Terraform: https://github.com/hashicorp/terraform/releases ARG TF_VERSION=1.9.8 diff --git a/go.mod b/go.mod index c4262a9f3..445b0e8a0 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/charmbracelet/bubbles v0.20.0 github.com/charmbracelet/bubbletea v1.1.2 github.com/charmbracelet/glamour v0.8.0 - github.com/charmbracelet/lipgloss v0.13.1 + github.com/charmbracelet/lipgloss v1.0.0 github.com/elewis787/boa v0.1.2 github.com/fatih/color v1.18.0 github.com/go-git/go-git/v5 v5.12.0 @@ -31,7 +31,7 @@ require ( github.com/lrstanley/bubblezone v0.0.0-20240914071701-b48c55a5e78e github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/mapstructure v1.5.0 - github.com/open-policy-agent/opa v0.69.0 + github.com/open-policy-agent/opa v0.70.0 github.com/otiai10/copy v1.14.0 github.com/pkg/errors v0.9.1 github.com/samber/lo v1.47.0 @@ -93,12 +93,12 @@ require ( github.com/cenkalti/backoff/v3 v3.2.2 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chainguard-dev/git-urls v1.0.2 // indirect - github.com/charmbracelet/x/ansi v0.4.0 // indirect + github.com/charmbracelet/x/ansi v0.4.2 // indirect github.com/charmbracelet/x/term v0.2.0 // indirect github.com/cloudflare/circl v1.3.7 // indirect github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect - github.com/containerd/containerd v1.7.22 // indirect - github.com/containerd/errdefs v0.2.0 // indirect + github.com/containerd/containerd v1.7.23 // indirect + github.com/containerd/errdefs v0.3.0 // indirect github.com/containerd/log v0.1.0 // indirect github.com/containerd/platforms v0.2.1 // indirect github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect @@ -191,7 +191,7 @@ require ( github.com/pierrec/lz4 v2.6.1+incompatible // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.20.4 // indirect + github.com/prometheus/client_golang v1.20.5 // indirect github.com/prometheus/client_model v0.6.1 // indirect github.com/prometheus/common v0.55.0 // indirect github.com/prometheus/procfs v0.15.1 // indirect @@ -235,28 +235,27 @@ require ( go4.org/intern v0.0.0-20230205224052-192e9f60865c // indirect go4.org/unsafe/assume-no-moving-gc v0.0.0-20230525183740-e7c30c78aeb2 // indirect gocloud.dev v0.25.1-0.20220408200107-09b10f7359f7 // indirect - golang.org/x/crypto v0.27.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect golang.org/x/mod v0.18.0 // indirect - golang.org/x/net v0.29.0 // indirect + golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.22.0 // indirect golang.org/x/sync v0.8.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/term v0.25.0 // indirect - golang.org/x/text v0.18.0 // indirect - golang.org/x/time v0.6.0 // indirect + golang.org/x/text v0.19.0 // indirect + golang.org/x/time v0.7.0 // indirect golang.org/x/tools v0.22.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect google.golang.org/api v0.171.0 // indirect google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20240814211410-ddb44dafa142 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect - google.golang.org/grpc v1.67.0 // indirect + google.golang.org/grpc v1.67.1 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect inet.af/netaddr v0.0.0-20230525184311-b8eac61e914a // indirect k8s.io/client-go v0.26.2 // indirect k8s.io/utils v0.0.0-20230220204549-a5ecb0141aa5 // indirect diff --git a/go.sum b/go.sum index f541d2b47..cc52dfecc 100644 --- a/go.sum +++ b/go.sum @@ -399,10 +399,10 @@ github.com/charmbracelet/bubbletea v1.1.2 h1:naQXF2laRxyLyil/i7fxdpiz1/k06IKquhm github.com/charmbracelet/bubbletea v1.1.2/go.mod h1:9HIU/hBV24qKjlehyj8z1r/tR9TYTQEag+cWZnuXo8E= github.com/charmbracelet/glamour v0.8.0 h1:tPrjL3aRcQbn++7t18wOpgLyl8wrOHUEDS7IZ68QtZs= github.com/charmbracelet/glamour v0.8.0/go.mod h1:ViRgmKkf3u5S7uakt2czJ272WSg2ZenlYEZXT2x7Bjw= -github.com/charmbracelet/lipgloss v0.13.1 h1:Oik/oqDTMVA01GetT4JdEC033dNzWoQHdWnHnQmXE2A= -github.com/charmbracelet/lipgloss v0.13.1/go.mod h1:zaYVJ2xKSKEnTEEbX6uAHabh2d975RJ+0yfkFpRBz5U= -github.com/charmbracelet/x/ansi v0.4.0 h1:NqwHA4B23VwsDn4H3VcNX1W1tOmgnvY1NDx5tOXdnOU= -github.com/charmbracelet/x/ansi v0.4.0/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg= +github.com/charmbracelet/lipgloss v1.0.0/go.mod h1:U5fy9Z+C38obMs+T+tJqst9VGzlOYGj4ri9reL3qUlo= +github.com/charmbracelet/x/ansi v0.4.2 h1:0JM6Aj/g/KC154/gOP4vfxun0ff6itogDYk41kof+qk= +github.com/charmbracelet/x/ansi v0.4.2/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b h1:MnAMdlwSltxJyULnrYbkZpp4k58Co7Tah3ciKhSNo0Q= github.com/charmbracelet/x/exp/golden v0.0.0-20240815200342-61de596daa2b/go.mod h1:wDlXFlCrmJ8J+swcL/MnGUuYnqgQdW9rhSD61oNMb6U= github.com/charmbracelet/x/term v0.2.0 h1:cNB9Ot9q8I711MyZ7myUR5HFWL/lc3OpU8jZ4hwm0x0= @@ -430,12 +430,12 @@ github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be h1:J5BL github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be/go.mod h1:mk5IQ+Y0ZeO87b858TlA645sVcEcbiX6YqP98kt+7+w= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= -github.com/containerd/containerd v1.7.22 h1:nZuNnNRA6T6jB975rx2RRNqqH2k6ELYKDZfqTHqwyy0= -github.com/containerd/containerd v1.7.22/go.mod h1:e3Jz1rYRUZ2Lt51YrH9Rz0zPyJBOlSvB3ghr2jbVD8g= +github.com/containerd/containerd v1.7.23 h1:H2CClyUkmpKAGlhQp95g2WXHfLYc7whAuvZGBNYOOwQ= +github.com/containerd/containerd v1.7.23/go.mod h1:7QUzfURqZWCZV7RLNEn1XjUCQLEf0bkaK4GjUaZehxw= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= github.com/containerd/continuity v0.4.2/go.mod h1:F6PTNCKepoxEaXLQp3wDAjygEnImnZ/7o4JzpodfroQ= -github.com/containerd/errdefs v0.2.0 h1:XllDESRfJtVrMwMmR2mCabxyvBK4UlbyyiWI3MvRw0o= -github.com/containerd/errdefs v0.2.0/go.mod h1:C28ixlj3dKhQS9hsQ13b+HIb4X7+s2G4FYhbSPcRDLM= +github.com/containerd/errdefs v0.3.0 h1:FSZgGOeK4yuT/+DnF07/Olde/q4KBoMsaamhXxIMDp4= +github.com/containerd/errdefs v0.3.0/go.mod h1:+YBYIdtsnF4Iw6nWZhJcqGSg/dwvV7tyJ/kCkyJ2k+M= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/containerd/platforms v0.2.1 h1:zvwtM3rz2YHPQsF2CHYM8+KtB5dvhISiXh5ZpSBQv6A= @@ -1027,8 +1027,8 @@ github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/open-policy-agent/opa v0.69.0 h1:s2igLw2Z6IvGWGuXSfugWkVultDMsM9pXiDuMp7ckWw= -github.com/open-policy-agent/opa v0.69.0/go.mod h1:+qyXJGkpEJ6kpB1kGo8JSwHtVXbTdsGdQYPWWNYNj+4= +github.com/open-policy-agent/opa v0.70.0 h1:B3cqCN2iQAyKxK6+GI+N40uqkin+wzIrM7YA60t9x1U= +github.com/open-policy-agent/opa v0.70.0/go.mod h1:Y/nm5NY0BX0BqjBriKUiV81sCl8XOjjvqQG7dXrggtI= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -1060,8 +1060,8 @@ github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSg github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.20.4 h1:Tgh3Yr67PaOv/uTqloMsCEdeuFTatm5zIq5+qNN23vI= -github.com/prometheus/client_golang v1.20.4/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= +github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= +github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1290,8 +1290,8 @@ golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20220331220935-ae2d96664a29/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= -golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1392,8 +1392,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= -golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1550,16 +1550,16 @@ golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= -golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20220224211638-0e9765cccd65/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= -golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.7.0 h1:ntUhktv3OPE6TgYxXWv9vKvUSJyIFJlyohwbkEwPrKQ= +golang.org/x/time v0.7.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1858,8 +1858,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.67.0 h1:IdH9y6PF5MPSdAntIcpjQ+tXO41pcQsfZV2RxtQgVcw= -google.golang.org/grpc v1.67.0/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= +google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E= +google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/internal/exec/help.go b/internal/exec/help.go index 6ea39c856..e28c8a98c 100644 --- a/internal/exec/help.go +++ b/internal/exec/help.go @@ -15,7 +15,7 @@ func processHelp( command string, ) error { if len(command) == 0 { - u.PrintMessage(fmt.Sprintf("'atmos' supports all native '%s' commands.\n", componentType)) + u.PrintMessage(fmt.Sprintf("Atmos supports all native '%s' commands.\n", componentType)) u.PrintMessage("In addition, the 'component' argument and 'stack' flag are required to generate the variables and backend config for the component in the stack.\n") u.PrintMessage(fmt.Sprintf("atmos %s -s [options]", componentType)) u.PrintMessage(fmt.Sprintf("atmos %s --stack [options]", componentType)) @@ -104,10 +104,11 @@ func processHelp( "Usage: atmos terraform workspace -s \n\n" + "For more details refer to https://atmos.tools/cli/commands/terraform/workspace\n") } else { - u.PrintMessage(fmt.Sprintf("'atmos' supports native '%s %s' command with all the options, arguments and flags.\n", componentType, command)) + u.PrintMessage(fmt.Sprintf("\nAtmos supports native '%s' commands with all the options, arguments and flags.\n", componentType)) u.PrintMessage("In addition, 'component' and 'stack' are required in order to generate variables for the component in the stack.\n") - u.PrintMessage(fmt.Sprintf("atmos %s %s -s [options]", componentType, command)) - u.PrintMessage(fmt.Sprintf("atmos %s %s --stack [options]", componentType, command)) + u.PrintMessage(fmt.Sprintf("atmos %s -s [options]", componentType)) + u.PrintMessage(fmt.Sprintf("atmos %s --stack [options]", componentType)) + u.PrintMessage(fmt.Sprintf("\nFor more details, execute '%s --help'\n", componentType)) } return nil diff --git a/internal/exec/terraform.go b/internal/exec/terraform.go index b782d325e..7b3153fd4 100644 --- a/internal/exec/terraform.go +++ b/internal/exec/terraform.go @@ -238,19 +238,6 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error { } } - // Run `terraform init` before running other commands - runTerraformInit := true - if info.SubCommand == "init" || - info.SubCommand == "clean" || - (info.SubCommand == "deploy" && !cliConfig.Components.Terraform.DeployRunInit) { - runTerraformInit = false - } - - if info.SkipInit { - u.LogDebug(cliConfig, "Skipping over 'terraform init' due to '--skip-init' flag being passed") - runTerraformInit = false - } - // Set `TF_IN_AUTOMATION` ENV var to `true` to suppress verbose instructions after terraform commands // https://developer.hashicorp.com/terraform/cli/config/environment-variables#tf_in_automation info.ComponentEnvList = append(info.ComponentEnvList, "TF_IN_AUTOMATION=true") @@ -273,11 +260,28 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error { } } + // Run `terraform init` before running other commands + runTerraformInit := true + if info.SubCommand == "init" || + info.SubCommand == "clean" || + (info.SubCommand == "deploy" && !cliConfig.Components.Terraform.DeployRunInit) { + runTerraformInit = false + } + + if info.SkipInit { + u.LogDebug(cliConfig, "Skipping over 'terraform init' due to '--skip-init' flag being passed") + runTerraformInit = false + } + if runTerraformInit { initCommandWithArguments := []string{"init"} if info.SubCommand == "workspace" || cliConfig.Components.Terraform.InitRunReconfigure { initCommandWithArguments = []string{"init", "-reconfigure"} } + + // Before executing `terraform init`, delete the `.terraform/environment` file from the component directory + cleanTerraformWorkspace(componentPath) + err = ExecuteShellCommand( cliConfig, info.Command, @@ -359,6 +363,9 @@ func ExecuteTerraform(info schema.ConfigAndStacksInfo) error { allArgsAndFlags = append(allArgsAndFlags, []string{varFileFlag, varFile}...) } case "init": + // Before executing `terraform init`, delete the `.terraform/environment` file from the component directory + cleanTerraformWorkspace(componentPath) + if cliConfig.Components.Terraform.InitRunReconfigure { allArgsAndFlags = append(allArgsAndFlags, []string{"-reconfigure"}...) } diff --git a/internal/exec/terraform_utils.go b/internal/exec/terraform_utils.go index 2228208d0..db92103d6 100644 --- a/internal/exec/terraform_utils.go +++ b/internal/exec/terraform_utils.go @@ -1,6 +1,9 @@ package exec import ( + "os" + "path" + "github.com/pkg/errors" "github.com/cloudposse/atmos/pkg/schema" @@ -14,3 +17,12 @@ func checkTerraformConfig(cliConfig schema.CliConfiguration) error { return nil } + +// cleanTerraformWorkspace deletes the `.terraform/environment` file from the component directory. +// The `.terraform/environment` file contains the name of the currently selected workspace, +// helping Terraform identify the active workspace context for managing your infrastructure. +// We delete the file to prevent the Terraform prompt asking o select the default or the +// previously used workspace. This happens when different backends are used for the same component. +func cleanTerraformWorkspace(componentPath string) { + _ = os.Remove(path.Join(componentPath, ".terraform", "environment")) +} diff --git a/internal/exec/utils.go b/internal/exec/utils.go index 93697c0b6..8eea02068 100644 --- a/internal/exec/utils.go +++ b/internal/exec/utils.go @@ -509,7 +509,7 @@ func ProcessStacks( configAndStacksInfo.ComponentSection = componentSectionConverted - // Process Atmos manifest sections + // Process Atmos manifest sections after processing `Go` templates if i, ok := configAndStacksInfo.ComponentSection[cfg.ProvidersSectionName].(map[string]any); ok { configAndStacksInfo.ComponentProvidersSection = i } @@ -545,6 +545,10 @@ func ProcessStacks( if i, ok := configAndStacksInfo.ComponentSection[cfg.ComponentSectionName].(string); ok { configAndStacksInfo.Component = i } + + if i, ok := configAndStacksInfo.ComponentSection[cfg.CommandSectionName].(string); ok { + configAndStacksInfo.Command = i + } } // Spacelift stack diff --git a/pkg/utils/file_utils.go b/pkg/utils/file_utils.go index 4c0d752a1..2cdb7204f 100644 --- a/pkg/utils/file_utils.go +++ b/pkg/utils/file_utils.go @@ -197,20 +197,21 @@ func SearchConfigFile(path string) (string, bool) { // IsURL checks if a string is a URL func IsURL(s string) bool { - url, err := url.Parse(s) + u, err := url.Parse(s) if err != nil { return false } + validSchemes := []string{"http", "https"} schemeValid := false for _, scheme := range validSchemes { - if url.Scheme == scheme { + if u.Scheme == scheme { schemeValid = true break } } - return schemeValid + return schemeValid } // GetFileNameFromURL extracts the file name from a URL @@ -218,16 +219,19 @@ func GetFileNameFromURL(rawURL string) (string, error) { if rawURL == "" { return "", fmt.Errorf("empty URL provided") } + parsedURL, err := url.Parse(rawURL) if err != nil { return "", err } + // Extract the path from the URL urlPath := parsedURL.Path + + // Get the base name of the path fileName := path.Base(urlPath) if fileName == "/" || fileName == "." { return "", fmt.Errorf("unable to extract filename from URL: %s", rawURL) } - // Get the base name of the path return fileName, nil } diff --git a/website/docs/integrations/atlantis.mdx b/website/docs/integrations/atlantis.mdx index 7efdcbfad..310f204d0 100644 --- a/website/docs/integrations/atlantis.mdx +++ b/website/docs/integrations/atlantis.mdx @@ -673,7 +673,7 @@ on: branches: [ main ] env: - ATMOS_VERSION: 1.99.0 + ATMOS_VERSION: 1.100.0 ATMOS_CLI_CONFIG_PATH: ./ jobs: diff --git a/website/package-lock.json b/website/package-lock.json index 8ffdc2112..42286b623 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -30,7 +30,7 @@ "marked": "^14.1.3", "node-fetch": "^3.3.2", "posthog-docusaurus": "^2.0.1", - "posthog-js": "^1.178.0", + "posthog-js": "^1.180.1", "prism-react-renderer": "^2.4.0", "raw-loader": "^4.0.2", "react": "^18.3.1", @@ -13652,9 +13652,9 @@ } }, "node_modules/posthog-js": { - "version": "1.178.0", - "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.178.0.tgz", - "integrity": "sha512-ILD4flNh72d5dycc4ZouKORlaVr+pDzl5TlZr1JgP0NBAoduHjhE7XZYwk7zdYkry7u0qAIpfv2306zJCW2vGg==", + "version": "1.180.1", + "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.180.1.tgz", + "integrity": "sha512-LV65maVrpqkAh0wu32YvU7FpCSEjg6o+sZFYCs1+6tnEa9VvXuz8J6ReLiyRpJABI4j1qX/PB2jaVY5tDbLalQ==", "license": "MIT", "dependencies": { "core-js": "^3.38.1", diff --git a/website/package.json b/website/package.json index bdec0e610..6fc1cddcd 100644 --- a/website/package.json +++ b/website/package.json @@ -36,7 +36,7 @@ "marked": "^14.1.3", "node-fetch": "^3.3.2", "posthog-docusaurus": "^2.0.1", - "posthog-js": "^1.178.0", + "posthog-js": "^1.180.1", "prism-react-renderer": "^2.4.0", "raw-loader": "^4.0.2", "react": "^18.3.1", From 747ecf10cda39bf8393cf262b1794c1ae9ef4722 Mon Sep 17 00:00:00 2001 From: aknysh Date: Sat, 2 Nov 2024 11:02:39 -0400 Subject: [PATCH 2/3] updates --- website/docs/core-concepts/stacks/templates/templates.mdx | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/core-concepts/stacks/templates/templates.mdx b/website/docs/core-concepts/stacks/templates/templates.mdx index cf8305327..0493e2ac9 100644 --- a/website/docs/core-concepts/stacks/templates/templates.mdx +++ b/website/docs/core-concepts/stacks/templates/templates.mdx @@ -244,6 +244,7 @@ You can use `Go` templates in the following Atmos sections to refer to values in - `backend_type` - `component` - `metadata.component` + - `command` :::tip In the template tokens, you can refer to any value in any section that the Atmos command From c0f72899dbb1057c0135958863452ae05999a369 Mon Sep 17 00:00:00 2001 From: aknysh Date: Sat, 2 Nov 2024 11:12:13 -0400 Subject: [PATCH 3/3] updates --- internal/exec/terraform_utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/exec/terraform_utils.go b/internal/exec/terraform_utils.go index db92103d6..a3ebca61b 100644 --- a/internal/exec/terraform_utils.go +++ b/internal/exec/terraform_utils.go @@ -21,7 +21,7 @@ func checkTerraformConfig(cliConfig schema.CliConfiguration) error { // cleanTerraformWorkspace deletes the `.terraform/environment` file from the component directory. // The `.terraform/environment` file contains the name of the currently selected workspace, // helping Terraform identify the active workspace context for managing your infrastructure. -// We delete the file to prevent the Terraform prompt asking o select the default or the +// We delete the file to prevent the Terraform prompt asking to select the default or the // previously used workspace. This happens when different backends are used for the same component. func cleanTerraformWorkspace(componentPath string) { _ = os.Remove(path.Join(componentPath, ".terraform", "environment"))