mirror of
https://github.com/imjasonh/kontain.me
synced 2026-07-07 00:32:28 +00:00
put the train back on its rails
Signed-off-by: Jason Hall <jason@chainguard.dev>
This commit is contained in:
parent
63d4d47f3b
commit
dc96e41aa3
17 changed files with 125 additions and 112 deletions
2
.github/workflows/deploy.yaml
vendored
2
.github/workflows/deploy.yaml
vendored
|
|
@ -22,7 +22,7 @@ jobs:
|
|||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version-file: 'go.mod'
|
||||
go-version: stable
|
||||
- uses: hashicorp/setup-terraform@v2
|
||||
- uses: imjasonh/setup-crane@v0.3
|
||||
|
||||
|
|
|
|||
143
.terraform.lock.hcl
generated
143
.terraform.lock.hcl
generated
|
|
@ -2,92 +2,113 @@
|
|||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.terraform.io/chainguard-dev/cosign" {
|
||||
version = "0.0.17"
|
||||
version = "0.0.22"
|
||||
hashes = [
|
||||
"h1:TZiXAVFxOcup4F6QtVUd4t/yPUbRkF/wBqqwOfABCVQ=",
|
||||
"zh:3dbdbc57fec9c070549fe7e7fd338d83029e9423afe0dcfc98bb6fa09a441867",
|
||||
"h1:TGIB3u4KlmRhISf+x3755NPGzgv9Ktq8F2e7k7cQZoc=",
|
||||
"zh:2110b35f99e355433575633d384f17b889618e12a005e65d4b92e39624aea528",
|
||||
"zh:3ba7a1365b3d9d723552eb67df1da27221312854110b9fa4455f5ae0860e2f33",
|
||||
"zh:52862fe94b370548f70f800b619751fc89c856224c330fffca79306b6fe23f9c",
|
||||
"zh:6f54b410b988faf24afea467a8cb23f499012b3dea36d6aca526485ea834aba1",
|
||||
"zh:890df766e9b839623b1f0437355032a3c006226a6c200cd911e15ee1a9014e9f",
|
||||
"zh:a9112193dae9a674420472f473a3dd036e83302bacae9a3121d6dfa090658556",
|
||||
"zh:b67876f1fde78971320e377409dfb91fe9fe2e4ede4c37b6a7fb11475d7b355a",
|
||||
"zh:d71628767b2d38a161e86252ab1cb908325e0ee0db65dddaaaae481dc31b552e",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.terraform.io/hashicorp/google" {
|
||||
version = "5.10.0"
|
||||
version = "6.20.0"
|
||||
constraints = ">= 4.79.0"
|
||||
hashes = [
|
||||
"h1:upxt/hLnX1r+yyYTF1zA0Lx3xoTHTtkYF3VjWBr1W4s=",
|
||||
"zh:0f6a1feb5b3a128be6ef5fe0400ed800310a67e799c18aec7442161bb6d3ba36",
|
||||
"zh:13d591ba78e424c94ce5caaf176ab6b087b0e3af08a7b6bcd963673698cdefda",
|
||||
"zh:3bef54a2b24b06eef99f3df02e0fe4ac97f018c89f83e0faeb4ade921962565b",
|
||||
"zh:3f3755b8f5b9db1611d42a02c21f03c54577e4aad3cf93323792f131c671c050",
|
||||
"zh:61516eec734714ac48b565bee93cc2532160d1b4bd0320753799b829083b7060",
|
||||
"zh:9160848ad0b9becb522a0744dcb89474849906aa2436ed945c658fe201a724b0",
|
||||
"zh:aa5e79b01949cfedd874bf52958f90cf8f7d202600126c872127a9a156a3c17b",
|
||||
"zh:cef73a67031008b7d7ef3edfbcd5e1a9b04c0f2580d815401248025b741bc8e4",
|
||||
"zh:d2ad21ff9e9d2ad04146591c1b5784075e6df73e2bd243efd8d227d764b80b6e",
|
||||
"h1:Wo8fqu73OOylxVykdz593VVuWntAaHQMtRkh4eKow60=",
|
||||
"zh:3dbdc8b3c7d9ef13ec3f69607232f23d29ed85df871d017a9a2338427dfae19b",
|
||||
"zh:4ac9a128c3a957e22100eb3f813f62ffa0ab47d2e1ac0c9a1370779bafcd5fac",
|
||||
"zh:4be504e8267709295708b12aa1ab9fbc93dbb801600347cfd82a27a204c3e04c",
|
||||
"zh:5c65452be9ec6ccf728fc122616dff284d3497591736228d7571222511926ede",
|
||||
"zh:76eca544918f9ed4bcf62178644216ef27163d6c763b11ee161fa654f7794d8a",
|
||||
"zh:7c142461e3059b709cb84dae9a135c72769c127986eede40516664ea25ff18d5",
|
||||
"zh:9636dcbf914d47e54ffdcf3a27c6dbbba63ea83e690fa8bf640bdf0421f352be",
|
||||
"zh:a307597b41e08281120e182aa58cb77490fd3fddeb4131daa967025e039aad9b",
|
||||
"zh:b6087dbaf762f4848449910476f22571712f22b7108c68ab2c173a8fff185518",
|
||||
"zh:d0ff076ad9d2c5b85b24d39b104a2ac255588aa1ea6a2eaf5344445de81c8006",
|
||||
"zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c",
|
||||
"zh:fb727a1cc6f2238059aa61baa84658dc5c348823d796f72921d030ff35a2723c",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.terraform.io/hashicorp/google-beta" {
|
||||
version = "6.20.0"
|
||||
constraints = ">= 4.79.0"
|
||||
hashes = [
|
||||
"h1:AgnC4F95gu1clyMeCqTg2H8oqtlI2cARqoc5C0d0DcM=",
|
||||
"zh:0500efa8db90436f3d0dc86f40e3c351249545a3d5927a9df6b8248d25214061",
|
||||
"zh:18fdf86beb5fc9fce0a7c053d5629c230a3795d07327f0241a2d4bac90d7366e",
|
||||
"zh:1a9a378679ac913b2c66197a6194250f2a601ea3c42829127a020814470b6866",
|
||||
"zh:24f2bccd99cc419ac8f72064f3e3cca93903b89b98b26f6e1bb41cf944f2bf53",
|
||||
"zh:44835cae5a5eae707330985423284191c34043ec2cf5a7a92e0370e2960f7541",
|
||||
"zh:48a2196edc1a88a31c1ce5dec1f084b8821f1d41d9fbf83c38738f6c1b5e27d8",
|
||||
"zh:592317cec2a061bcfd538c4ca7d4b5733c47d70a378086287732f4c6dc8d8f25",
|
||||
"zh:8f6743bf5ae0754e4ea5c6cb4f40114a24e2eb3823b332fe0cb8fa9e777bcd2c",
|
||||
"zh:a54164bc670c658efb3183a24785e383b1c516dc82b374103a3b587a9c3d9d80",
|
||||
"zh:b5ab872bb770de30b1a4e0e5b396f14aed333541c7373bb71ced38d06666bddd",
|
||||
"zh:d7a2c540a21eeb8ac933736e795fccc7592e7bcf69b48cdf79fd47240f977383",
|
||||
"zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c",
|
||||
"zh:f58b145081d20bce52e14bee0de73f5c018bc39b8c4736e23e1329df32f8bd45",
|
||||
"zh:fb82f6b5d1f992243ab8fe417659cdf9831202cf1e16fe7593d3967888b035cc",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.terraform.io/hashicorp/null" {
|
||||
version = "3.2.2"
|
||||
version = "3.2.3"
|
||||
hashes = [
|
||||
"h1:IMVAUHKoydFrlPrl9OzasDnw/8ntZFerCC9iXw1rXQY=",
|
||||
"zh:3248aae6a2198f3ec8394218d05bd5e42be59f43a3a7c0b71c66ec0df08b69e7",
|
||||
"zh:32b1aaa1c3013d33c245493f4a65465eab9436b454d250102729321a44c8ab9a",
|
||||
"zh:38eff7e470acb48f66380a73a5c7cdd76cc9b9c9ba9a7249c7991488abe22fe3",
|
||||
"zh:4c2f1faee67af104f5f9e711c4574ff4d298afaa8a420680b0cb55d7bbc65606",
|
||||
"zh:544b33b757c0b954dbb87db83a5ad921edd61f02f1dc86c6186a5ea86465b546",
|
||||
"zh:696cf785090e1e8cf1587499516b0494f47413b43cb99877ad97f5d0de3dc539",
|
||||
"zh:6e301f34757b5d265ae44467d95306d61bef5e41930be1365f5a8dcf80f59452",
|
||||
"h1:I0Um8UkrMUb81Fxq/dxbr3HLP2cecTH2WMJiwKSrwQY=",
|
||||
"zh:22d062e5278d872fe7aed834f5577ba0a5afe34a3bdac2b81f828d8d3e6706d2",
|
||||
"zh:23dead00493ad863729495dc212fd6c29b8293e707b055ce5ba21ee453ce552d",
|
||||
"zh:28299accf21763ca1ca144d8f660688d7c2ad0b105b7202554ca60b02a3856d3",
|
||||
"zh:55c9e8a9ac25a7652df8c51a8a9a422bd67d784061b1de2dc9fe6c3cb4e77f2f",
|
||||
"zh:756586535d11698a216291c06b9ed8a5cc6a4ec43eee1ee09ecd5c6a9e297ac1",
|
||||
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
|
||||
"zh:913a929070c819e59e94bb37a2a253c228f83921136ff4a7aa1a178c7cce5422",
|
||||
"zh:aa9015926cd152425dbf86d1abdbc74bfe0e1ba3d26b3db35051d7b9ca9f72ae",
|
||||
"zh:bb04798b016e1e1d49bcc76d62c53b56c88c63d6f2dfe38821afef17c416a0e1",
|
||||
"zh:c23084e1b23577de22603cff752e59128d83cfecc2e6819edadd8cf7a10af11e",
|
||||
"zh:9d5eea62fdb587eeb96a8c4d782459f4e6b73baeece4d04b4a40e44faaee9301",
|
||||
"zh:a6355f596a3fb8fc85c2fb054ab14e722991533f87f928e7169a486462c74670",
|
||||
"zh:b5a65a789cff4ada58a5baffc76cb9767dc26ec6b45c00d2ec8b1b027f6db4ed",
|
||||
"zh:db5ab669cf11d0e9f81dc380a6fdfcac437aea3d69109c7aef1a5426639d2d65",
|
||||
"zh:de655d251c470197bcbb5ac45d289595295acb8f829f6c781d4a75c8c8b7c7dd",
|
||||
"zh:f5c68199f2e6076bce92a12230434782bf768103a427e9bb9abee99b116af7b5",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.terraform.io/hashicorp/random" {
|
||||
version = "3.6.0"
|
||||
version = "3.6.3"
|
||||
hashes = [
|
||||
"h1:I8MBeauYA8J8yheLJ8oSMWqB0kovn16dF/wKZ1QTdkk=",
|
||||
"zh:03360ed3ecd31e8c5dac9c95fe0858be50f3e9a0d0c654b5e504109c2159287d",
|
||||
"zh:1c67ac51254ba2a2bb53a25e8ae7e4d076103483f55f39b426ec55e47d1fe211",
|
||||
"zh:24a17bba7f6d679538ff51b3a2f378cedadede97af8a1db7dad4fd8d6d50f829",
|
||||
"zh:30ffb297ffd1633175d6545d37c2217e2cef9545a6e03946e514c59c0859b77d",
|
||||
"zh:454ce4b3dbc73e6775f2f6605d45cee6e16c3872a2e66a2c97993d6e5cbd7055",
|
||||
"h1:zG9uFP8l9u+yGZZvi5Te7PV62j50azpgwPunq2vTm1E=",
|
||||
"zh:04ceb65210251339f07cd4611885d242cd4d0c7306e86dda9785396807c00451",
|
||||
"zh:448f56199f3e99ff75d5c0afacae867ee795e4dfda6cb5f8e3b2a72ec3583dd8",
|
||||
"zh:4b4c11ccfba7319e901df2dac836b1ae8f12185e37249e8d870ee10bb87a13fe",
|
||||
"zh:4fa45c44c0de582c2edb8a2e054f55124520c16a39b2dfc0355929063b6395b1",
|
||||
"zh:588508280501a06259e023b0695f6a18149a3816d259655c424d068982cbdd36",
|
||||
"zh:737c4d99a87d2a4d1ac0a54a73d2cb62974ccb2edbd234f333abd079a32ebc9e",
|
||||
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
|
||||
"zh:91df0a9fab329aff2ff4cf26797592eb7a3a90b4a0c04d64ce186654e0cc6e17",
|
||||
"zh:aa57384b85622a9f7bfb5d4512ca88e61f22a9cea9f30febaa4c98c68ff0dc21",
|
||||
"zh:c4a3e329ba786ffb6f2b694e1fd41d413a7010f3a53c20b432325a94fa71e839",
|
||||
"zh:e2699bc9116447f96c53d55f2a00570f982e6f9935038c3810603572693712d0",
|
||||
"zh:e747c0fd5d7684e5bfad8aa0ca441903f15ae7a98a737ff6aca24ba223207e2c",
|
||||
"zh:f1ca75f417ce490368f047b63ec09fd003711ae48487fba90b4aba2ccf71920e",
|
||||
"zh:a357ab512e5ebc6d1fda1382503109766e21bbfdfaa9ccda43d313c122069b30",
|
||||
"zh:c51bfb15e7d52cc1a2eaec2a903ac2aff15d162c172b1b4c17675190e8147615",
|
||||
"zh:e0951ee6fa9df90433728b96381fb867e3db98f66f735e0c3e24f8f16903f0ad",
|
||||
"zh:e3cdcb4e73740621dabd82ee6a37d6cfce7fee2a03d8074df65086760f5cf556",
|
||||
"zh:eff58323099f1bd9a0bec7cb04f717e7f1b2774c7d612bf7581797e1622613a0",
|
||||
]
|
||||
}
|
||||
|
||||
provider "registry.terraform.io/ko-build/ko" {
|
||||
version = "0.0.10"
|
||||
version = "0.0.16"
|
||||
hashes = [
|
||||
"h1:atipfOFFoba9i4sl8bzxbmr4wXacYk7sO0DuNLz1WMM=",
|
||||
"zh:0a14b59cf4913a4dc816cf22441c240e8956d1f22e72756abc4143604b09fccc",
|
||||
"zh:13262ff100585897c9d0d3eae2d22b9311cc14bf1e56a36793530ab12cb1a339",
|
||||
"zh:24b494fa7cd0a78bb9c284d9e1ab4270c7216ac2959364fcc87a2716479b752d",
|
||||
"zh:2f07f1cf48dce87e904b54b05120ef854e4650249edb1825494ad2ff8c2b6123",
|
||||
"zh:42230fba13bfdcdc05f0aef9521d03b35fe3509fde1fc1847426679584e4334a",
|
||||
"zh:4d8b1c367f90dbf2841e500b7993e6a1a3a3089569d931e6755818eb292a508d",
|
||||
"zh:67967e0798988db767b7da42ba44a17c5318ff4580f9103bafb838ff5429bca8",
|
||||
"zh:8283eb24427a63ed562e077a6424f1d631238c3e4cde5e507e0e234d12ad313a",
|
||||
"zh:ad463e8ccd561f2de3eacfe5ba9f07e2ea7559b385211900e692e8dc0a19b01f",
|
||||
"zh:b024ec4ae5a4ca02c39c607f2f08f8e1de4b981df254132e3fd3638842a0d9e7",
|
||||
"zh:b86be36e0b68a053831df9d8cbbb5bdb32f84d9177e54af36f25ddaed88d73ed",
|
||||
"zh:ca2fafc4235a399dfc03b09e441889f6a88efe06a4e5035c18f7f92e3c710ec8",
|
||||
"zh:cfa16c10b254b73517030cfc319ba2326a277541f9567523703289ab2f82db56",
|
||||
"zh:d1fc27ca9a7f4a4c746985a12cb4ec5c3bf7aaab7f6eca4db683a7500c771a6b",
|
||||
"h1:BiXf7iHxcNgHvHmWD7ER5oONn4w45oRtv9mmrjCptAI=",
|
||||
"zh:11d984cb76b3d76617a6f3a4971056798fb3a7e1648b05015b5363cc647d8e20",
|
||||
"zh:1d97538a2defe2f3830966689659ae226cdda86bb9ced36d6b52e580f6323c86",
|
||||
"zh:1e29cc8ceaf0445f6c90bd749582ac60ebbf768b0ec41f7a837cb68b7070df32",
|
||||
"zh:67eaf65c2b936b435d626db0162f25df3ea6143444e28c9f53302eab61ac3317",
|
||||
"zh:6e7b2e0fe6c58f02cbc97e82ac929d1d4819911911d2b2fb8adf6260c5640825",
|
||||
"zh:8561a5bec9a9514bfd494846c14cc6054acff1f6db9be495c1f85ef93a94aa5a",
|
||||
"zh:9264ba2931dd6bc4a6b507387faab9ccb518921ad723e4f1eb0bdd1ff6465cfc",
|
||||
"zh:998da6ca255d2c57b01255b17995f85df6fbaaf7af48321a2290c530f01497cd",
|
||||
"zh:bd33dba257fa263533a821bf5c889321c4b88e191f05678ad9d664f19785c1bb",
|
||||
"zh:cef593277e0b097672f77c987481b514ea8b2dfc7071fd0164881e0d81398390",
|
||||
"zh:dbe0f30448e8b5a15df02bf5a6bb28d1eb7a9eb842b8d5f3a1b822f20664548c",
|
||||
"zh:dfe537254b5f2f67b79895b330dcd4555f7d88f0d859813fddaa0d77570a552f",
|
||||
"zh:ed865bf4f7c68d1869f7443ff9c7639f5971cce178cb0c11ea072e30be795d51",
|
||||
"zh:f0e4faa3121ae4196103d7d87df1dd683d83118469e5df605be5eff010bddf13",
|
||||
"zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c",
|
||||
]
|
||||
}
|
||||
|
|
|
|||
2
apps.tf
2
apps.tf
|
|
@ -34,7 +34,7 @@ locals {
|
|||
container_concurrency = 1000
|
||||
timeout_seconds = 60 # 1m
|
||||
base_image = "cgr.dev/chainguard/static:latest-glibc"
|
||||
alert_id = module.prober.alert_id
|
||||
//alert_id = module.prober.alert_id
|
||||
}
|
||||
wait : {
|
||||
cpu = 1
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"chainguard.dev/apko/pkg/apk/fs"
|
||||
"chainguard.dev/apko/pkg/build"
|
||||
"chainguard.dev/apko/pkg/build/types"
|
||||
"github.com/chainguard-dev/go-apk/pkg/fs"
|
||||
"github.com/chainguard-dev/clog/gcp"
|
||||
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||
"github.com/google/go-containerregistry/pkg/v1/empty"
|
||||
"github.com/google/go-containerregistry/pkg/v1/mutate"
|
||||
"github.com/imjasonh/gcpslog"
|
||||
"github.com/imjasonh/kontain.me/pkg/serve"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
|
@ -29,7 +29,7 @@ func main() {
|
|||
slog.ErrorContext(ctx, "serve.NewStorage", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
http.Handle("/v2/", gcpslog.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/v2/", gcp.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/main/cmd/apko", http.StatusSeeOther))
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
|
|
@ -160,8 +160,7 @@ func (s *server) build(ctx context.Context, ic types.ImageConfiguration) (v1.Ima
|
|||
bc, err := build.New(ctx, fs.DirFS(wd),
|
||||
build.WithImageConfiguration(ic),
|
||||
build.WithArch(amd64), // TODO: multiarch
|
||||
build.WithBuildDate(time.Time{}.Format(time.RFC3339)),
|
||||
build.WithAssertions(build.RequireGroupFile(true), build.RequirePasswdFile(true)))
|
||||
build.WithBuildDate(time.Time{}.Format(time.RFC3339)))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/chainguard-dev/clog/gcp"
|
||||
"github.com/google/go-containerregistry/pkg/name"
|
||||
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||
"github.com/google/go-containerregistry/pkg/v1/empty"
|
||||
|
|
@ -16,7 +17,6 @@ import (
|
|||
"github.com/google/go-containerregistry/pkg/v1/remote"
|
||||
"github.com/google/go-containerregistry/pkg/v1/tarball"
|
||||
"github.com/google/go-containerregistry/pkg/v1/types"
|
||||
"github.com/imjasonh/gcpslog"
|
||||
"github.com/imjasonh/kontain.me/pkg/serve"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
|
@ -28,7 +28,7 @@ func main() {
|
|||
slog.ErrorContext(ctx, "serve.NewStorage", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
http.Handle("/v2/", gcpslog.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/v2/", gcp.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/main/cmd/flatten", http.StatusSeeOther))
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
|
|
|
|||
|
|
@ -7,19 +7,18 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/chainguard-dev/clog/gcp"
|
||||
"github.com/google/go-containerregistry/pkg/name"
|
||||
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||
"github.com/google/go-containerregistry/pkg/v1/remote"
|
||||
"github.com/google/go-containerregistry/pkg/v1/types"
|
||||
"github.com/google/ko/pkg/build"
|
||||
"github.com/imjasonh/gcpslog"
|
||||
"github.com/imjasonh/kontain.me/pkg/serve"
|
||||
"golang.org/x/mod/module"
|
||||
"golang.org/x/mod/zip"
|
||||
|
|
@ -33,7 +32,7 @@ func main() {
|
|||
slog.ErrorContext(ctx, "serve.NewStorage", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
http.Handle("/v2/", gcpslog.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/v2/", gcp.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/main/cmd/ko", http.StatusSeeOther))
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
|
|
@ -248,7 +247,7 @@ func (s *server) fetchAndBuild(ctx context.Context, mod, version, filepath strin
|
|||
defer resp.Body.Close()
|
||||
|
||||
// Write a temp zip file.
|
||||
tmpzip, err := ioutil.TempFile("", "")
|
||||
tmpzip, err := os.CreateTemp("", "ko-*")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
@ -260,16 +259,16 @@ func (s *server) fetchAndBuild(ctx context.Context, mod, version, filepath strin
|
|||
|
||||
// Create a tempdir and cd into it
|
||||
// (This is only safe because concurrency=1)
|
||||
tmpdir, err := ioutil.TempDir("", "")
|
||||
tmpdir, err := os.CreateTemp("", "ko-*")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// Clean up the temp dir. If building is successful, we'll serve a
|
||||
// cached manifest and not need to rebuild.
|
||||
defer os.RemoveAll(tmpdir)
|
||||
defer os.RemoveAll(tmpdir.Name())
|
||||
|
||||
// Unzip and validate the module zip file.
|
||||
if err := zip.Unzip(tmpdir, module.Version{
|
||||
if err := zip.Unzip(tmpdir.Name(), module.Version{
|
||||
Path: mod,
|
||||
Version: version,
|
||||
}, tmpzip.Name()); err != nil {
|
||||
|
|
@ -278,7 +277,7 @@ func (s *server) fetchAndBuild(ctx context.Context, mod, version, filepath strin
|
|||
|
||||
// ko build the package.
|
||||
g, err := build.NewGo(
|
||||
ctx, tmpdir,
|
||||
ctx, tmpdir.Name(),
|
||||
build.WithBaseImages(s.getBaseImage),
|
||||
build.WithPlatforms("all"),
|
||||
build.WithConfig(map[string]build.Config{
|
||||
|
|
@ -289,7 +288,7 @@ func (s *server) fetchAndBuild(ctx context.Context, mod, version, filepath strin
|
|||
Flags: build.FlagArray{"-mod=mod"},
|
||||
},
|
||||
}),
|
||||
build.WithCreationTime(v1.Time{time.Unix(0, 0)}),
|
||||
build.WithCreationTime(v1.Time{Time: time.Unix(0, 0)}),
|
||||
build.WithDisabledSBOM(),
|
||||
)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -8,11 +8,11 @@ import (
|
|||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/chainguard-dev/clog/gcp"
|
||||
"github.com/google/go-containerregistry/pkg/name"
|
||||
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||
"github.com/google/go-containerregistry/pkg/v1/remote"
|
||||
"github.com/google/go-containerregistry/pkg/v1/types"
|
||||
"github.com/imjasonh/gcpslog"
|
||||
"github.com/imjasonh/kontain.me/pkg/serve"
|
||||
)
|
||||
|
||||
|
|
@ -23,7 +23,7 @@ func main() {
|
|||
slog.ErrorContext(ctx, "serve.NewStorage", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
http.Handle("/v2/", gcpslog.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/v2/", gcp.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/main/cmd/mirror", http.StatusSeeOther))
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/chainguard-dev/terraform-google-prober/pkg/prober"
|
||||
"github.com/chainguard-dev/terraform-infra-common/pkg/prober"
|
||||
"github.com/google/go-containerregistry/pkg/name"
|
||||
"github.com/google/go-containerregistry/pkg/v1/remote"
|
||||
"github.com/google/go-containerregistry/pkg/v1/validate"
|
||||
|
|
|
|||
|
|
@ -10,8 +10,8 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/chainguard-dev/clog/gcp"
|
||||
"github.com/google/go-containerregistry/pkg/v1/random"
|
||||
"github.com/imjasonh/gcpslog"
|
||||
"github.com/imjasonh/kontain.me/pkg/serve"
|
||||
)
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ func main() {
|
|||
slog.ErrorContext(ctx, "serve.NewStorage", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
http.Handle("/v2/", gcpslog.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/v2/", gcp.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/main/cmd/random", http.StatusSeeOther))
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
|
|
|
|||
|
|
@ -11,18 +11,18 @@ import (
|
|||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"github.com/chainguard-dev/clog/gcp"
|
||||
humanize "github.com/dustin/go-humanize"
|
||||
"github.com/google/go-containerregistry/pkg/name"
|
||||
v1 "github.com/google/go-containerregistry/pkg/v1"
|
||||
"github.com/google/go-containerregistry/pkg/v1/remote"
|
||||
"github.com/imjasonh/gcpslog"
|
||||
"github.com/tmc/dot"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
http.Handle("/v2/", gcpslog.WithCloudTraceContext(&server{}))
|
||||
http.Handle("/v2/", gcp.WithCloudTraceContext(&server{}))
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
if port == "" {
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/chainguard-dev/clog/gcp"
|
||||
"github.com/google/go-containerregistry/pkg/v1/random"
|
||||
"github.com/imjasonh/delay/pkg/delay"
|
||||
"github.com/imjasonh/gcpslog"
|
||||
"github.com/imjasonh/kontain.me/pkg/serve"
|
||||
)
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ func main() {
|
|||
slog.ErrorContext(ctx, "serve.NewStorage", "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
http.Handle("/v2/", gcpslog.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/v2/", gcp.WithCloudTraceContext(&server{storage: st}))
|
||||
http.Handle("/", http.RedirectHandler("https://github.com/imjasonh/kontain.me/blob/main/cmd/random", http.StatusSeeOther))
|
||||
|
||||
port := os.Getenv("PORT")
|
||||
|
|
|
|||
5
go.mod
5
go.mod
|
|
@ -5,14 +5,12 @@ go 1.23.4
|
|||
require (
|
||||
chainguard.dev/apko v0.25.0
|
||||
cloud.google.com/go/storage v1.50.0
|
||||
github.com/chainguard-dev/go-apk v0.0.0-20240605175618-f3471089c263
|
||||
github.com/chainguard-dev/terraform-google-prober v0.5.0
|
||||
github.com/chainguard-dev/clog v1.6.1
|
||||
github.com/chainguard-dev/terraform-infra-common v0.6.123
|
||||
github.com/dustin/go-humanize v1.0.1
|
||||
github.com/google/go-containerregistry v0.20.3
|
||||
github.com/google/ko v0.17.1
|
||||
github.com/imjasonh/delay v0.0.0-20210102151318-8339250e8458
|
||||
github.com/imjasonh/gcpslog v0.0.0-20240209190558-0c01a0f0b68e
|
||||
github.com/kelseyhightower/envconfig v1.4.0
|
||||
github.com/tmc/dot v0.2.0
|
||||
golang.org/x/mod v0.23.0
|
||||
|
|
@ -46,7 +44,6 @@ require (
|
|||
github.com/blang/semver v3.5.1+incompatible // indirect
|
||||
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/chainguard-dev/clog v1.6.1 // indirect
|
||||
github.com/charmbracelet/lipgloss v1.0.0 // indirect
|
||||
github.com/charmbracelet/log v0.4.0 // indirect
|
||||
github.com/charmbracelet/x/ansi v0.8.0 // indirect
|
||||
|
|
|
|||
6
go.sum
6
go.sum
|
|
@ -102,10 +102,6 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
|
|||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/chainguard-dev/clog v1.6.1 h1:CeOhEqKQsO/QMESgOTqv/miI27P1eNcgGgL7uiofOvU=
|
||||
github.com/chainguard-dev/clog v1.6.1/go.mod h1:4+WFhRMsGH79etYXY3plYdp+tCz/KCkU8fAr0HoaPvs=
|
||||
github.com/chainguard-dev/go-apk v0.0.0-20240605175618-f3471089c263 h1:QdAJbQBBxp66anqRHxjpjjexXrftaRE6vT6rT7DlU9k=
|
||||
github.com/chainguard-dev/go-apk v0.0.0-20240605175618-f3471089c263/go.mod h1:v769rnCfbxecQI4NitG1KJKi7q4qtTrwEaES/H4LXTo=
|
||||
github.com/chainguard-dev/terraform-google-prober v0.5.0 h1:sNIyDWgrg7J907TprZsuE8RaJZH5YwMI53IP1Bvt7+g=
|
||||
github.com/chainguard-dev/terraform-google-prober v0.5.0/go.mod h1:iNB5dtB3lRC0Yh7aCcae2BIZ1JRygg6EYhTxhNKgD/U=
|
||||
github.com/chainguard-dev/terraform-infra-common v0.6.123 h1:/FjfK6v3A9PThBVCGwGpnMcNZsLWg/e2EuwG9a/uFvI=
|
||||
github.com/chainguard-dev/terraform-infra-common v0.6.123/go.mod h1:HtkeMpC4mgZVv+qiOLQO5ncaKNXqHswM80nZH0Uo9iQ=
|
||||
github.com/charmbracelet/lipgloss v1.0.0 h1:O7VkGDvqEdGi93X+DeqsQ7PKHDgtQfF8j8/O2qFMQNg=
|
||||
|
|
@ -316,8 +312,6 @@ github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:
|
|||
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||
github.com/imjasonh/delay v0.0.0-20210102151318-8339250e8458 h1:KSkVhq4WEv9rlP6GvAbJFRMb0WtPSUOYiFyk52SoqMU=
|
||||
github.com/imjasonh/delay v0.0.0-20210102151318-8339250e8458/go.mod h1:Fa7ozpRszH4I+tsBQpsszFbSKnzIXPCvv2RorJijAMg=
|
||||
github.com/imjasonh/gcpslog v0.0.0-20240209190558-0c01a0f0b68e h1:nUgXwDygztBS66aLkhp9vBlp3tF2XQbgZMkJUBsrXAs=
|
||||
github.com/imjasonh/gcpslog v0.0.0-20240209190558-0c01a0f0b68e/go.mod h1:crwolI91kTDe1DETZVPJL3X+Yp/TTk0z85M/QYeEKEs=
|
||||
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
|
||||
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
|
||||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A=
|
||||
|
|
|
|||
10
main.tf
10
main.tf
|
|
@ -37,11 +37,15 @@ variable "notification_channels" {
|
|||
}
|
||||
|
||||
module "dashboard" {
|
||||
for_each = tomap(local.apps)
|
||||
source = "git::https://github.com/chainguard-dev/terraform-infra-common//dashboard/service?ref=main"
|
||||
for_each = tomap(local.apps)
|
||||
source = "git::https://github.com/chainguard-dev/terraform-infra-common//modules/dashboard/service?ref=main"
|
||||
|
||||
project_id = var.project_id
|
||||
service_name = each.key
|
||||
|
||||
alerts = lookup(each.value, "alert_id", "") == "" ? [] : [each.value.alert_id]
|
||||
//alerts = lookup(each.value, "alert_id", "") == "" ? [] : [each.value.alert_id]
|
||||
|
||||
notification_channels = var.notification_channels
|
||||
}
|
||||
|
||||
resource "google_storage_bucket" "bucket" {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ func Do(command string) error {
|
|||
cmd.Stdout = io.MultiWriter(os.Stdout, &out)
|
||||
cmd.Stderr = io.MultiWriter(os.Stderr, &out)
|
||||
if err := cmd.Run(); err != nil {
|
||||
return fmt.Errorf("Error running %q: %s\n=====Command output=====\n%s", command, err, string(out.Bytes()))
|
||||
return fmt.Errorf("Error running %q: %s\n=====Command output=====\n%s", command, err, out.String())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
|
@ -152,14 +151,14 @@ func (s *Storage) ServeIndex(w http.ResponseWriter, r *http.Request, idx v1.Imag
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.writeBlob(ctx, digest.String(), digest, ioutil.NopCloser(bytes.NewReader(b)), string(mt)); err != nil {
|
||||
if err := s.writeBlob(ctx, digest.String(), digest, io.NopCloser(bytes.NewReader(b)), string(mt)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, a := range also {
|
||||
a := a
|
||||
g.Go(func() error {
|
||||
return s.writeBlob(ctx, a, digest, ioutil.NopCloser(bytes.NewReader(b)), string(mt))
|
||||
return s.writeBlob(ctx, a, digest, io.NopCloser(bytes.NewReader(b)), string(mt))
|
||||
})
|
||||
}
|
||||
if err := g.Wait(); err != nil {
|
||||
|
|
@ -194,7 +193,7 @@ func (s *Storage) WriteImage(ctx context.Context, img v1.Image, also ...string)
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.writeBlob(ctx, ch.String(), ch, ioutil.NopCloser(bytes.NewReader(cb)), "application/json"); err != nil {
|
||||
if err := s.writeBlob(ctx, ch.String(), ch, io.NopCloser(bytes.NewReader(cb)), "application/json"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -239,17 +238,16 @@ func (s *Storage) WriteImage(ctx context.Context, img v1.Image, also ...string)
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.writeBlob(ctx, digest.String(), digest, ioutil.NopCloser(bytes.NewReader(b)), string(mt)); err != nil {
|
||||
if err := s.writeBlob(ctx, digest.String(), digest, io.NopCloser(bytes.NewReader(b)), string(mt)); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, a := range also {
|
||||
a := a
|
||||
g.Go(func() error {
|
||||
return s.writeBlob(ctx, a, digest, ioutil.NopCloser(bytes.NewReader(b)), string(mt))
|
||||
return s.writeBlob(ctx, a, digest, io.NopCloser(bytes.NewReader(b)), string(mt))
|
||||
})
|
||||
}
|
||||
return g.Wait()
|
||||
return nil
|
||||
}
|
||||
|
||||
// ServeManifest writes config and layer blobs for the image, then writes and
|
||||
|
|
|
|||
|
|
@ -3,11 +3,11 @@ resource "google_service_account" "no-auth" {
|
|||
display_name = "Prober SA with no permissions"
|
||||
}
|
||||
|
||||
/*
|
||||
module "prober" {
|
||||
//source = "chainguard-dev/prober/google"
|
||||
//version = "v0.5.0"
|
||||
source = "git::https://github.com/chainguard-dev/terraform-infra-common//modules/prober?ref=main"
|
||||
|
||||
source = "git::https://github.com/chainguard-dev/terraform-google-prober?ref=main"
|
||||
regions = module.networking.regions
|
||||
|
||||
name = "random-prober"
|
||||
project_id = var.project_id
|
||||
|
|
@ -23,3 +23,4 @@ module "prober" {
|
|||
enable_alert = true
|
||||
notification_channels = tolist(var.notification_channels)
|
||||
}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue