From 58d2d0a10405f9e21f53685855a2f124f833c8c3 Mon Sep 17 00:00:00 2001 From: Sushanta Das Date: Fri, 15 Mar 2024 16:58:46 +0530 Subject: [PATCH] Added tests for multi-platform dynamic IBM P&Z --- Makefile | 5 +- go.mod | 23 +- go.sum | 66 ++++ magefiles/magefile.go | 116 ++++--- tests/build/multi-platform.go | 629 +++++++++++++++++++++++++++++++++- 5 files changed, 773 insertions(+), 66 deletions(-) diff --git a/Makefile b/Makefile index b4c508e31a..3b71eb7da9 100644 --- a/Makefile +++ b/Makefile @@ -67,4 +67,7 @@ clean-private-repos: ./mage -v local:cleanupPrivateRepos clean-registered-servers: - ./mage -v CleanupRegisteredPacServers \ No newline at end of file + ./mage -v CleanupRegisteredPacServers + +setup-multi-platform-tests: + ./mage -v SetupMultiPlatformTests diff --git a/go.mod b/go.mod index fb6b335344..506b3b2328 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tektoncd/cli v0.33.0 github.com/tektoncd/pipeline v0.53.3 - golang.org/x/crypto v0.17.0 + golang.org/x/crypto v0.18.0 golang.org/x/oauth2 v0.15.0 golang.org/x/tools v0.16.1 gopkg.in/yaml.v2 v2.4.0 @@ -112,6 +112,8 @@ require ( github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/BurntSushi/toml v1.2.1 // indirect github.com/CycloneDX/cyclonedx-go v0.7.1 // indirect + github.com/IBM/go-sdk-core/v5 v5.15.3 // indirect + github.com/IBM/vpc-go-sdk v0.48.0 // indirect github.com/MakeNowJust/heredoc v1.0.0 // indirect github.com/Masterminds/semver/v3 v3.2.1 // indirect github.com/Microsoft/go-winio v0.6.1 // indirect @@ -119,6 +121,7 @@ require ( github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 // indirect github.com/argoproj/gitops-engine v0.7.1-0.20240122213038-792124280fcc // indirect github.com/argoproj/pkg v0.13.7-0.20230626144333-d56162821bd1 // indirect + github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/aws/aws-sdk-go v1.50.8 // indirect github.com/aws/aws-sdk-go-v2/credentials v1.16.16 // indirect github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.11 // indirect @@ -177,6 +180,7 @@ require ( github.com/felixge/httpsnoop v1.0.3 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect + github.com/gabriel-vasile/mimetype v1.4.3 // indirect github.com/go-errors/errors v1.4.2 // indirect github.com/go-fed/httpsig v1.1.0 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect @@ -186,9 +190,14 @@ require ( github.com/go-logr/logr v1.3.0 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/zapr v1.2.4 // indirect + github.com/go-openapi/errors v0.21.0 // indirect github.com/go-openapi/jsonpointer v0.20.0 // indirect github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/strfmt v0.22.0 // indirect github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.17.0 // indirect github.com/go-redis/cache/v9 v9.0.0 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -216,7 +225,7 @@ require ( github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.4 // indirect + github.com/hashicorp/go-retryablehttp v0.7.5 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect @@ -229,6 +238,7 @@ require ( github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect github.com/klauspost/compress v1.17.2 // indirect + github.com/leodido/go-urn v1.3.0 // indirect github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -237,6 +247,7 @@ require ( github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/moby/buildkit v0.12.5 // indirect github.com/moby/locker v1.0.1 // indirect @@ -250,6 +261,7 @@ require ( github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/oklog/ulid v1.3.1 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc5 // indirect github.com/opencontainers/runc v1.1.12 // indirect @@ -292,6 +304,7 @@ require ( github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xeipuuv/gojsonschema v1.2.0 // indirect github.com/xlab/treeprint v1.2.0 // indirect + go.mongodb.org/mongo-driver v1.13.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect go.opentelemetry.io/otel v1.21.0 // indirect @@ -303,10 +316,10 @@ require ( go.uber.org/zap v1.26.0 // indirect golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa // indirect golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.19.0 // indirect + golang.org/x/net v0.20.0 // indirect golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.15.0 // indirect - golang.org/x/term v0.15.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/term v0.16.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/time v0.5.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 2887018cbe..102a0e4ae9 100644 --- a/go.sum +++ b/go.sum @@ -634,13 +634,20 @@ github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbi github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/CycloneDX/cyclonedx-go v0.7.1 h1:5w1SxjGm9MTMNTuRbEPyw21ObdbaagTWF/KfF0qHTRE= github.com/CycloneDX/cyclonedx-go v0.7.1/go.mod h1:N/nrdWQI2SIjaACyyDs/u7+ddCkyl/zkNs8xFsHF2Ps= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/IBM/go-sdk-core/v5 v5.15.3 h1:yBSSYLuQSO9Ip+j3mONsTcymoYQyxarQ6rh3aU9cVt8= +github.com/IBM/go-sdk-core/v5 v5.15.3/go.mod h1:ee+AZaB15yUwZigJdRCwZZ3u7HIvEQzxNUdxVpnJHY8= +github.com/IBM/vpc-go-sdk v0.48.0 h1:4yeSxVX9mizsIW2F0rsVI47rZoNKBrZ1QK9RwwRas9Q= +github.com/IBM/vpc-go-sdk v0.48.0/go.mod h1:FDJpiokOmaYG2hNYDfqKVxUPe8mm/dPi3mdz8Zt4o/Q= github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk= github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ= github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Masterminds/sprig/v3 v3.2.2/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= github.com/Microsoft/go-winio v0.4.11/go.mod h1:VhR8bwka0BXejwEJY73c50VrPtXAaKcyvVC4A4RozmA= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= @@ -683,6 +690,7 @@ github.com/Shopify/logrus-bugsnag v0.0.0-20171204204709-577dee27f20d/go.mod h1:H github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat636LX7Bqt5lYEZ27JNDcqxfjdBQuJ/MM4CN/Lzo= github.com/acomagu/bufpipe v1.0.3/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= +github.com/acomagu/bufpipe v1.0.4/go.mod h1:mxdxdup/WdsKVreO5GpW4+M/1CE2sMG4jeGJ2sYmHc4= github.com/ajstarks/deck v0.0.0-20200831202436-30c9fc6549a9/go.mod h1:JynElWSGnm/4RlzPXRlREEwqTHAN3T56Bv2ITsFT3gY= github.com/ajstarks/deck/generate v0.0.0-20210309230005-c3f852c02e19/go.mod h1:T13YZdzov6OU0A1+RfKZiZN9ca6VeKdBdyDV+BY97Tk= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= @@ -701,6 +709,7 @@ github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOS github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= +github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/antlr/antlr4/runtime/Go/antlr v0.0.0-20210826220005-b48c857c3a0e/go.mod h1:F7bn7fEU90QkQ3tnmaTx3LTKLEDqnwWODIYppRQ5hnY= github.com/antlr/antlr4/runtime/Go/antlr v1.4.10 h1:yL7+Jz0jTC6yykIK/Wh74gnTJnrGr5AyrNMXuA0gves= @@ -719,9 +728,12 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= +github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= github.com/avast/retry-go/v4 v4.3.3 h1:G56Bp6mU0b5HE1SkaoVjscZjlQb0oy4mezwY/cGH19w= github.com/avast/retry-go/v4 v4.3.3/go.mod h1:rg6XFaiuFYII0Xu3RDbZQkxCofFwruZKW8oEF1jpWiU= github.com/aws/aws-sdk-go v1.15.11/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= @@ -818,6 +830,7 @@ github.com/chai2010/gettext-go v1.0.2 h1:1Lwwip6Q2QGsAdl/ZKPCwTe9fe0CjlUbqj5bFNS github.com/chai2010/gettext-go v1.0.2/go.mod h1:y+wnP2cHYaVj19NZhYKAwEMH2CI1gNHeQQ+5AjwawxA= github.com/checkpoint-restore/go-criu/v4 v4.1.0/go.mod h1:xUQBLp4RLc5zJtWY++yjOoMoB5lihDt7fai+75m+rGw= github.com/checkpoint-restore/go-criu/v5 v5.0.0/go.mod h1:cfwC0EG7HMUenopBsUf9d89JlCLQIfgVcNsNN0t6T2M= +github.com/checkpoint-restore/go-criu/v5 v5.3.0/go.mod h1:E/eQpaFtUKGOOSEBZgmKAcn+zUUwWxqcaKZlF54wK8E= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -826,6 +839,8 @@ github.com/cilium/ebpf v0.0.0-20200702112145-1c8d4c9ef775/go.mod h1:7cR51M8ViRLI github.com/cilium/ebpf v0.2.0/go.mod h1:To2CFviqOWL/M0gIMsvSMlqe7em/l1ALkX1PyjrX2Qs= github.com/cilium/ebpf v0.4.0/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= github.com/cilium/ebpf v0.6.2/go.mod h1:4tRaxcgiL706VnOzHOdBlY8IEAIdxINsQBcU4xJJXRs= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/cjwagner/httpcache v0.0.0-20230907212505-d4841bbad466 h1:eUjwn08FDjbj8vBM31026tjBraJCu+qpDvo/q0EAvQk= github.com/cjwagner/httpcache v0.0.0-20230907212505-d4841bbad466/go.mod h1:f7xZ2fRr8CqTp834KCxLW2pOXC/raqwhTbEvtxu/lRo= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= @@ -876,6 +891,7 @@ github.com/containerd/console v0.0.0-20181022165439-0650fd9eeb50/go.mod h1:Tj/on github.com/containerd/console v0.0.0-20191206165004-02ecf6a7291e/go.mod h1:8Pf4gM6VEbTNRIT26AyyU7hxdQU3MvAvxVI0sc00XBE= github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw= github.com/containerd/console v1.0.2/go.mod h1:ytZPjGgY2oeTkAONYafi2kSj0aYggsf8acV1PGKCbzQ= +github.com/containerd/console v1.0.3/go.mod h1:7LqA/THxQ86k76b8c/EMSiaJ3h1eZkMkXar0TQ1gf3U= github.com/containerd/containerd v1.2.10/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= github.com/containerd/containerd v1.3.0/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -1136,10 +1152,13 @@ github.com/fvbommel/sortorder v1.0.1/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui72 github.com/fvbommel/sortorder v1.1.0 h1:fUmoe+HLsBTctBDoaBwpQo5N+nrCp8g/BjKb/6ZQmYw= github.com/fvbommel/sortorder v1.1.0/go.mod h1:uk88iVf1ovNn1iLfgUVU2F9o5eO30ui720w+kxuqRs0= github.com/fvbommel/util v0.0.0-20180919145318-efcd4e0f9787/go.mod h1:AlRx4sdoz6EdWGYPMeunQWYf46cKnq7J4iVvLgyb5cY= +github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/garyburd/redigo v0.0.0-20150301180006-535138d7bcd7/go.mod h1:NR3MbYisc3/PwhQ00EMzDiPmrwpPxAn5GI05/YaO1SY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/gliderlabs/ssh v0.3.5 h1:OcaySEmAQJgyYcArR+gGGTHCyE7nvhEMTlYY+Dp8CpY= +github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-bindata/go-bindata/v3 v3.1.3/go.mod h1:1/zrpXsLD8YDIbhZRqXzm1Ghc7NhEvIN9+Z6R5/xH4I= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= @@ -1199,6 +1218,9 @@ github.com/go-logr/zapr v0.4.0/go.mod h1:tabnROwaDl0UNxkVeFRbY8bwB37GwRv0P8lg6aA github.com/go-logr/zapr v1.2.3/go.mod h1:eIauM6P8qSvTw5o2ez6UEAfGjQKrxQTl5EoK+Qa2oG4= github.com/go-logr/zapr v1.2.4 h1:QHVo+6stLbfJmYGkQ7uGHUCu5hnAFAj6mDe6Ea0SeOo= github.com/go-logr/zapr v1.2.4/go.mod h1:FyHWQIzQORZ0QVE1BtVHv3cKtNLuXsbNLtpuhNapBOA= +github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-openapi/errors v0.21.0 h1:FhChC/duCnfoLj1gZ0BgaBmzhJC2SL/sJr8a2vAobSY= +github.com/go-openapi/errors v0.21.0/go.mod h1:jxNTMUxRCKj65yb/okJGEtahVd7uvWnuWfj53bse4ho= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= @@ -1209,6 +1231,8 @@ github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXym github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= +github.com/go-openapi/strfmt v0.22.0 h1:Ew9PnEYc246TwrEspvBdDHS4BVKXy/AOVsfqGDgAcaI= +github.com/go-openapi/strfmt v0.22.0/go.mod h1:HzJ9kokGIju3/K6ap8jL+OlGAbjpSv27135Yr9OivU4= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.14/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= @@ -1217,7 +1241,13 @@ github.com/go-openapi/swag v0.22.4/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+ github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.17.0 h1:SmVVlfAOtlZncTxRuinDPomC2DkXJ4E5T9gDA0AIH74= +github.com/go-playground/validator/v10 v10.17.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-redis/cache/v9 v9.0.0 h1:0thdtFo0xJi0/WXbRVu8B066z8OvVymXTJGaXrVWnN0= github.com/go-redis/cache/v9 v9.0.0/go.mod h1:cMwi1N8ASBOufbIvk7cdXe2PbPjK/WMRL95FFHWsSgI= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -1240,6 +1270,7 @@ github.com/godbus/dbus/v5 v5.0.3/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofri/go-github-ratelimit v1.0.3-0.20230428184158-a500e14de53f h1:Kzf4F+3yVpgqLvgp8IM4BwHwCiPA5wghoHhCdR8Fcpw= github.com/gofri/go-github-ratelimit v1.0.3-0.20230428184158-a500e14de53f/go.mod h1:OnCi5gV+hAG/LMR7llGhU7yHt44se9sYgKPnafoL7RY= +github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.2.0/go.mod h1:Njal3psf3qN6dwBtQfUmBZh2ybovJ0tlu3o/AC7HYjU= @@ -1295,6 +1326,7 @@ github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= @@ -1346,10 +1378,12 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/go-containerregistry v0.5.1/go.mod h1:Ct15B4yir3PLOP5jsy0GNeYVaIZs/MK/Jz5any1wFW0= github.com/google/go-containerregistry v0.18.0 h1:ShE7erKNPqRh5ue6Z9DUOlk04WsnFWPO6YGr3OxnfoQ= github.com/google/go-containerregistry v0.18.0/go.mod h1:u0qB2l7mvtWVR5kNcbFIhFY1hLbf8eeGapA+vbFDCtQ= +github.com/google/go-github/v41 v41.0.0/go.mod h1:XgmCA5H323A9rtgExdTcnDkcqp6S30AVACCBDOonIxg= github.com/google/go-github/v44 v44.1.0 h1:shWPaufgdhr+Ad4eo/pZv9ORTxFpsxPEPEuuXAKIQGA= github.com/google/go-github/v44 v44.1.0/go.mod h1:iWn00mWcP6PRWHhXm0zuFJ8wbEjE5AGO5D5HXYM4zgw= github.com/google/go-github/v45 v45.2.0 h1:5oRLszbrkvxDDqBCNj2hjDZMKmvexaZ1xw/FCD+K3FI= github.com/google/go-github/v45 v45.2.0/go.mod h1:FObaZJEDSTa/WGCzZ2Z3eoCDXWJKMenWWTrd8jrta28= +github.com/google/go-github/v53 v53.2.0/go.mod h1:XhFRObz+m/l+UCm9b7KSIC3lT3NWSXGt7mOsAWEloao= github.com/google/go-github/v56 v56.0.0 h1:TysL7dMa/r7wsQi44BjqlwaHvwlFlqkK8CtBWCX3gb4= github.com/google/go-github/v56 v56.0.0/go.mod h1:D8cdcX98YWJvi7TLo7zM4/h8ZTx6u6fwGEkCdisopo0= github.com/google/go-intervals v0.0.2/go.mod h1:MkaR3LNRfeKLPmqgJYs4E66z5InYjmCjbbr4TQlcT6Y= @@ -1462,6 +1496,7 @@ github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/S github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= @@ -1470,7 +1505,10 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-retryablehttp v0.7.4 h1:ZQgVdpTdAL7WpMIwLzCfbalOcSUdkDZnpUv3/+BxzFA= github.com/hashicorp/go-retryablehttp v0.7.4/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= +github.com/hashicorp/go-retryablehttp v0.7.5 h1:bJj+Pj19UZMIweq/iie+1u5YCdGrnxCT9yvm0e+Nd5M= +github.com/hashicorp/go-retryablehttp v0.7.5/go.mod h1:Jy/gPYAdjqffZ/yFGCFV2doI5wjtH1ewM9u8iYVjtX8= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -1488,6 +1526,7 @@ github.com/hashicorp/golang-lru v0.6.0 h1:uL2shRDx7RTrOrTCUZEGP/wJUFiUI8QT6E7z5o github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -1587,6 +1626,8 @@ github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LE github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.3.0 h1:jX8FDLfW4ThVXctBNZ+3cIWnCSnrACDV73r76dy0aQQ= +github.com/leodido/go-urn v1.3.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI= github.com/lestrrat-go/jwx v0.9.0/go.mod h1:iEoxlYfZjvoGpuWwxUz+eR5e6KTJGsaRcy/YNA/UnBk= github.com/letsencrypt/boulder v0.0.0-20221109233200-85aa52084eaf h1:ndns1qx/5dL43g16EQkPV/i8+b3l5bYQwLeoSBe7tS8= github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0= @@ -1594,6 +1635,7 @@ github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9 github.com/linuxkit/virtsock v0.0.0-20201010232012-f8cee7dfc7a3/go.mod h1:3r6x7q95whyfWQpmGZTu3gk3v2YkMi05HEzl7Tf7YEo= github.com/lithammer/dedent v1.1.0/go.mod h1:jrXYCQtgg0nJiN+StA2KgR7w6CiQNv9Fd/Z9BP0jIOc= github.com/lucasjones/reggen v0.0.0-20200904144131-37ba4fa293bb/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= +github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I= github.com/lunixbochs/vtclean v0.0.0-20180621232353-2d01aacdc34a/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= github.com/lyft/protoc-gen-star v0.6.1/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= @@ -1642,6 +1684,7 @@ github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 h1:jWpvCLoY8Z/e3VKvls github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0/go.mod h1:QUyp042oQthUoa9bqDv0ER0wrtXnBruoNd7aNjkbP+k= github.com/maxbrunsfeld/counterfeiter/v6 v6.2.2/go.mod h1:eD9eIE7cdwcMi9rYluz88Jz2VyhSmden33/aXg4oVIY= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/miekg/pkcs11 v1.0.3/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs= github.com/mikefarah/yq/v3 v3.0.0-20201202084205-8846255d1c37/go.mod h1:dYWq+UWoFCDY1TndvFUQuhBbIYmZpjreC8adEAx93zE= @@ -1667,6 +1710,8 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 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/osext v0.0.0-20151018003038-5e2d6d41470f/go.mod h1:OkQIRizQZAeMln+1tSwduZz7+Af5oFlKirV/MSYes2A= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -1702,6 +1747,7 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/2gBQ3RWajuToeY6ZtZTIKv2v7ThUy5KKusIT0yc0= github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4= +github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= @@ -1720,8 +1766,10 @@ github.com/nsf/jsondiff v0.0.0-20210926074059-1e845ec5d249/go.mod h1:mpRZBD8SJ55 github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= +github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/oliveagle/jsonpath v0.0.0-20180606110733-2e52cf6e6852/go.mod h1:eqOVx5Vwu4gd2mmMZvVZsgIqNSaW3xxRThUJ0k/TPk4= github.com/onsi/ginkgo v0.0.0-20151202141238-7f8ab55aaf3b/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -1859,6 +1907,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN 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= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= github.com/pquerna/cachecontrol v0.1.0/go.mod h1:NrUG3Z7Rdu85UNR3vm7SOsl1nFIeSiQnrHV5K9mBcUI= github.com/prometheus/client_golang v0.0.0-20180209125602-c332b6f63c06/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -1967,6 +2016,7 @@ github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncj github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -2100,6 +2150,7 @@ github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/urfave/cli v1.22.12/go.mod h1:sSBEIC79qR6OvcmsD4U3KABeOTxDqQtdDnaFuUN30b8= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/vbatts/tar-split v0.11.1/go.mod h1:LEuURwDEiWjRjwu46yU3KVGuUdVv/dcnpcEPSzR8z6g= github.com/vbatts/tar-split v0.11.3 h1:hLFqsOLQ1SsppQNTMpkpPXClLDfC2A3Zgy9OUU+RVck= github.com/vbatts/tar-split v0.11.3/go.mod h1:9QlHN18E+fEH7RdG+QAJJcuya3rqT7eXSTY7wGrAokY= @@ -2123,6 +2174,9 @@ github.com/xanzy/go-gitlab v0.91.1/go.mod h1:5ryv+MnpZStBH8I/77HuQBsMbBGANtVpLWC github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= +github.com/xdg-go/scram v1.1.2/go.mod h1:RT/sEzTbU5y00aCK8UOx6R7YryM0iF1N2MOmC3kKLN4= +github.com/xdg-go/stringprep v1.0.4/go.mod h1:mPGuuIYwz7CmR2bT9j4GbQqutWS1zV24gijq1dTyGkM= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190809123943-df4f5c81cb3b/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= @@ -2140,6 +2194,7 @@ github.com/xlab/treeprint v1.1.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ= github.com/xlab/treeprint v1.2.0/go.mod h1:gj5Gd3gPdKtR1ikdDK6fnFLdmIS0X30kTTuNd/WEJu0= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -2176,6 +2231,8 @@ go.etcd.io/etcd/pkg/v3 v3.5.9/go.mod h1:BZl0SAShQFk0IpLWR78T/+pyt8AruMHhTNNX73hk go.etcd.io/etcd/raft/v3 v3.5.9/go.mod h1:WnFkqzFdZua4LVlVXQEGhmooLeyS7mqzS4Pf4BCVqXg= go.etcd.io/etcd/server/v3 v3.5.9/go.mod h1:GgI1fQClQCFIzuVjlvdbMxNbnISt90gdfYyqiAIt65g= go.etcd.io/gofail v0.1.0/go.mod h1:VZBCXYGZhHAinaBiiqYvuDynvahNsAyLFwB3kEHKz1M= +go.mongodb.org/mongo-driver v1.13.1 h1:YIc7HTYsKndGK4RFzJ3covLz1byri52x0IoMB0Pt/vk= +go.mongodb.org/mongo-driver v1.13.1/go.mod h1:wcDf1JBCXy2mOW0bWHwO/IOYqdca1MPCwDtFu/Z9+eo= go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -2286,6 +2343,8 @@ golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45 golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.18.0 h1:PGVlW0xEltQnzFZ55hkuX5+KLyrMYhHld1YHO4AKcdc= +golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2438,6 +2497,8 @@ golang.org/x/net v0.11.0/go.mod h1:2L/ixqYpgIVXmeoSA/4Lu7BzTG4KIyPIryS4IsOd1oQ= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= 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= @@ -2637,6 +2698,8 @@ golang.org/x/sys v0.9.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2653,6 +2716,8 @@ golang.org/x/term v0.9.0/go.mod h1:M6DEAAIenWoTxdKrOltXcmDY3rSplQUkrvaDU5FcQyo= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.16.0 h1:m+B6fahuftsE9qjo0VWp2FW0mB3MTJvR0BaMQrq0pmE= +golang.org/x/term v0.16.0/go.mod h1:yn7UURbUtPyrVJPGPq404EukNFxcm/foM+bV/bfcDsY= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -3090,6 +3155,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= diff --git a/magefiles/magefile.go b/magefiles/magefile.go index 974fb92fb8..df92b6f523 100644 --- a/magefiles/magefile.go +++ b/magefiles/magefile.go @@ -56,6 +56,7 @@ var ( requiresSprayProxyRegistering bool requiresMultiPlatformTests bool + platforms = []string{"linux/arm64", "linux/s390x", "linux/ppc64le"} sprayProxyConfig *sprayproxy.SprayProxyConfig quayTokenNotFoundError = "DEFAULT_QUAY_ORG_TOKEN env var was not found" @@ -272,7 +273,7 @@ func (ci CI) TestE2E() error { } if requiresMultiPlatformTests { - if err := setupMultiPlatformTests(); err != nil { + if err := SetupMultiPlatformTests(); err != nil { return err } } @@ -548,70 +549,75 @@ func setRequiredEnvVars() error { return nil } -func setupMultiPlatformTests() error { +func SetupMultiPlatformTests() error { klog.Infof("going to create new Tekton bundle remote-build for the purpose of testing multi-platform-controller PR") var err error var defaultBundleRef string var tektonObj runtime.Object - tag := fmt.Sprintf("%d-%s", time.Now().Unix(), util.GenerateRandomString(4)) - quayOrg := utils.GetEnv(constants.DEFAULT_QUAY_ORG_ENV, constants.DefaultQuayOrg) - newMultiPlatformBuilderPipelineImg := strings.ReplaceAll(constants.DefaultImagePushRepo, constants.DefaultQuayOrg, quayOrg) - var newRemotePipeline, _ = name.ParseReference(fmt.Sprintf("%s:pipeline-bundle-%s", newMultiPlatformBuilderPipelineImg, tag)) - var newPipelineYaml []byte - - if err = utils.CreateDockerConfigFile(os.Getenv("QUAY_TOKEN")); err != nil { - return fmt.Errorf("failed to create docker config file: %+v", err) - } - if defaultBundleRef, err = tekton.GetDefaultPipelineBundleRef(constants.BuildPipelineSelectorYamlURL, "Docker build"); err != nil { - return fmt.Errorf("failed to get the pipeline bundle ref: %+v", err) - } - if tektonObj, err = tekton.ExtractTektonObjectFromBundle(defaultBundleRef, "pipeline", "docker-build"); err != nil { - return fmt.Errorf("failed to extract the Tekton Pipeline from bundle: %+v", err) - } - dockerPipelineObject := tektonObj.(*tektonapi.Pipeline) - - var currentBuildahTaskRef string - for i := range dockerPipelineObject.PipelineSpec().Tasks { - t := &dockerPipelineObject.PipelineSpec().Tasks[i] - params := t.TaskRef.Params - var lastBundle *tektonapi.Param - var lastName *tektonapi.Param - buildahTask := false - for i, param := range params { - if param.Name == "bundle" { - lastBundle = &t.TaskRef.Params[i] - } else if param.Name == "name" && param.Value.StringVal == "buildah" { - lastName = &t.TaskRef.Params[i] - buildahTask = true + for _, platformType := range platforms { + tag := fmt.Sprintf("%d-%s", time.Now().Unix(), util.GenerateRandomString(4)) + quayOrg := utils.GetEnv(constants.DEFAULT_QUAY_ORG_ENV, constants.DefaultQuayOrg) + newMultiPlatformBuilderPipelineImg := strings.ReplaceAll(constants.DefaultImagePushRepo, constants.DefaultQuayOrg, quayOrg) + var newRemotePipeline, _ = name.ParseReference(fmt.Sprintf("%s:pipeline-bundle-%s", newMultiPlatformBuilderPipelineImg, tag)) + var newPipelineYaml []byte + + if err = utils.CreateDockerConfigFile(os.Getenv("QUAY_TOKEN")); err != nil { + return fmt.Errorf("failed to create docker config file: %+v", err) + } + if defaultBundleRef, err = tekton.GetDefaultPipelineBundleRef(constants.BuildPipelineSelectorYamlURL, "Docker build"); err != nil { + return fmt.Errorf("failed to get the pipeline bundle ref: %+v", err) + } + if tektonObj, err = tekton.ExtractTektonObjectFromBundle(defaultBundleRef, "pipeline", "docker-build"); err != nil { + return fmt.Errorf("failed to extract the Tekton Pipeline from bundle: %+v", err) + } + dockerPipelineObject := tektonObj.(*tektonapi.Pipeline) + + var currentBuildahTaskRef string + for i := range dockerPipelineObject.PipelineSpec().Tasks { + t := &dockerPipelineObject.PipelineSpec().Tasks[i] + params := t.TaskRef.Params + var lastBundle *tektonapi.Param + var lastName *tektonapi.Param + buildahTask := false + for i, param := range params { + if param.Name == "bundle" { + lastBundle = &t.TaskRef.Params[i] + } else if param.Name == "name" && param.Value.StringVal == "buildah" { + lastName = &t.TaskRef.Params[i] + buildahTask = true + } + } + if buildahTask { + currentBuildahTaskRef = lastBundle.Value.StringVal + klog.Infof("Found current task ref %s", currentBuildahTaskRef) + //TODO: current use pinned sha? + lastBundle.Value = *tektonapi.NewStructuredValues("quay.io/redhat-appstudio-tekton-catalog/task-buildah-remote:0.1") + lastName.Value = *tektonapi.NewStructuredValues("buildah-remote") + t.Params = append(t.Params, tektonapi.Param{Name: "PLATFORM", Value: *tektonapi.NewStructuredValues("$(params.PLATFORM)")}) + dockerPipelineObject.Spec.Params = append(dockerPipelineObject.PipelineSpec().Params, tektonapi.ParamSpec{Name: "PLATFORM", Default: tektonapi.NewStructuredValues(platformType)}) + dockerPipelineObject.Name = "buildah-remote-pipeline" + break } } - if buildahTask { - currentBuildahTaskRef = lastBundle.Value.StringVal - klog.Infof("Found current task ref %s", currentBuildahTaskRef) - //TODO: current use pinned sha? - lastBundle.Value = *tektonapi.NewStructuredValues("quay.io/redhat-appstudio-tekton-catalog/task-buildah-remote:0.1") - lastName.Value = *tektonapi.NewStructuredValues("buildah-remote") - t.Params = append(t.Params, tektonapi.Param{Name: "PLATFORM", Value: *tektonapi.NewStructuredValues("$(params.PLATFORM)")}) - dockerPipelineObject.Spec.Params = append(dockerPipelineObject.PipelineSpec().Params, tektonapi.ParamSpec{Name: "PLATFORM", Default: tektonapi.NewStructuredValues("linux/arm64")}) - dockerPipelineObject.Name = "buildah-remote-pipeline" - break + if currentBuildahTaskRef == "" { + return fmt.Errorf("failed to extract the Tekton Task from bundle: %+v", err) + } + if newPipelineYaml, err = yaml.Marshal(dockerPipelineObject); err != nil { + return fmt.Errorf("error when marshalling a new pipeline to YAML: %v", err) } - } - if currentBuildahTaskRef == "" { - return fmt.Errorf("failed to extract the Tekton Task from bundle: %+v", err) - } - if newPipelineYaml, err = yaml.Marshal(dockerPipelineObject); err != nil { - return fmt.Errorf("error when marshalling a new pipeline to YAML: %v", err) - } - keychain := authn.NewMultiKeychain(authn.DefaultKeychain) - authOption := remoteimg.WithAuthFromKeychain(keychain) + keychain := authn.NewMultiKeychain(authn.DefaultKeychain) + authOption := remoteimg.WithAuthFromKeychain(keychain) - if err = tekton.BuildAndPushTektonBundle(newPipelineYaml, newRemotePipeline, authOption); err != nil { - return fmt.Errorf("error when building/pushing a tekton pipeline bundle: %v", err) + if err = tekton.BuildAndPushTektonBundle(newPipelineYaml, newRemotePipeline, authOption); err != nil { + return fmt.Errorf("error when building/pushing a tekton pipeline bundle: %v", err) + } + platform := strings.ToUpper(strings.Split(platformType, "/")[1]) + klog.Infof("SETTING ENV VAR %s to value %s\n", constants.CUSTOM_BUILDAH_REMOTE_PIPELINE_BUILD_BUNDLE_ENV+"_"+platform, newRemotePipeline.String()) + os.Setenv(constants.CUSTOM_BUILDAH_REMOTE_PIPELINE_BUILD_BUNDLE_ENV+"_"+platform, newRemotePipeline.String()) } - os.Setenv(constants.CUSTOM_BUILDAH_REMOTE_PIPELINE_BUILD_BUNDLE_ENV, newRemotePipeline.String()) + return nil } @@ -963,7 +969,7 @@ func (ci CI) TestUpgrade() error { } if requiresMultiPlatformTests { - if err := setupMultiPlatformTests(); err != nil { + if err := SetupMultiPlatformTests(); err != nil { return err } } diff --git a/tests/build/multi-platform.go b/tests/build/multi-platform.go index a263052a8e..372c7c5dff 100644 --- a/tests/build/multi-platform.go +++ b/tests/build/multi-platform.go @@ -2,6 +2,7 @@ package build import ( "context" + "encoding/json" "fmt" "log" "os" @@ -29,6 +30,9 @@ import ( "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/ec2" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + + "github.com/IBM/go-sdk-core/v5/core" + "github.com/IBM/vpc-go-sdk/vpcv1" ) const ( @@ -36,16 +40,22 @@ const ( HostConfig = "host-config" ControllerNamespace = "multi-platform-controller" AwsSecretName = "awskeys" + IbmSecretName = "ibmkey" + IbmKey = "multi-platform-tests" SshSecretName = "sshkeys" Ec2User = "ec2-user" AwsRegion = "us-east-1" AwsPlatform = "linux/arm64" DynamicMaxInstances = "1" + IbmZUrl = "https://us-east.iaas.cloud.ibm.com/v1" + IbmPUrl = "https://us-south.power-iaas.cloud.ibm.com" + CRN = "crn:v1:bluemix:public:power-iaas:dal10:a/934e118c399b4a28a70afdf2210d708f:8c9ef568-16a5-4aa2-bfd5-946349c9aeac::" MultiPlatformSecretKey = "build.appstudio.redhat.com/multi-platform-secret" MultiPlatformConfigKey = "build.appstudio.redhat.com/multi-platform-config" ) var ( + IbmVpc = "us-east-default-vpc" multiPlatformProjectGitUrl = utils.GetEnv("MULTI_PLATFORM_TEST_REPO_URL", "https://github.com/devfile-samples/devfile-sample-go-basic") multiPlatformProjectRevision = utils.GetEnv("MULTI_PLATFORM_TEST_REPO_REVISION", "c713067b0e65fb3de50d1f7c457eb51c2ab0dbb0") ) @@ -93,7 +103,7 @@ var _ = framework.MultiPlatformBuildSuiteDescribe("Multi Platform Controller E2E err = createSecretForHostPool(f) Expect(err).ShouldNot(HaveOccurred()) - err = createBuildPipelineSelector(f, testNamespace) + err = createBuildPipelineSelector(f, testNamespace, "ARM64") Expect(err).ShouldNot(HaveOccurred()) timeout = time.Minute * 20 @@ -271,7 +281,7 @@ var _ = framework.MultiPlatformBuildSuiteDescribe("Multi Platform Controller E2E Expect(testNamespace).NotTo(BeNil(), "failed to create sandbox user namespace") Expect(err).ShouldNot(HaveOccurred()) - dynamicInstanceTag := "dynamic-instance" + "-" + util.GenerateRandomString(4) + dynamicInstanceTag := "dynamic-instance-" + util.GenerateRandomString(4) GinkgoWriter.Printf("Generated dynamic instance tag: %q\n", dynamicInstanceTag) // Restart multi-platform-controller pod to reload configMap again @@ -295,7 +305,7 @@ var _ = framework.MultiPlatformBuildSuiteDescribe("Multi Platform Controller E2E err = createSecretsForDynamicInstance(f) Expect(err).ShouldNot(HaveOccurred()) - err = createBuildPipelineSelector(f, testNamespace) + err = createBuildPipelineSelector(f, testNamespace, "ARM64") Expect(err).ShouldNot(HaveOccurred()) timeout = time.Minute * 20 @@ -411,8 +421,617 @@ var _ = framework.MultiPlatformBuildSuiteDescribe("Multi Platform Controller E2E }) }) + Describe("ibmz dynamic allocation", Label("ibmz-dynamic"), func() { + var testNamespace, applicationName, componentName, multiPlatformSecretName, multiPlatformTaskName, dynamicInstanceTag, instanceId string + var component *appservice.Component + var timeout, interval time.Duration + + AfterAll(func() { + //Cleanup ibm&ssh secrets and host-config + Expect(f.AsKubeAdmin.CommonController.DeleteSecret(ControllerNamespace, IbmSecretName)).To(Succeed()) + Expect(f.AsKubeAdmin.CommonController.DeleteSecret(ControllerNamespace, SshSecretName)).To(Succeed()) + Expect(f.AsKubeAdmin.CommonController.DeleteConfigMap(HostConfig, ControllerNamespace, true)).To(Succeed()) + + //Forcefully remove instance incase it is not removed by multi-platform-controller + err = terminateIbmZInstance(instanceId) + if err != nil { + GinkgoWriter.Printf("error terminating instance again: %v", err) + } + + if !CurrentSpecReport().Failed() { + Expect(f.AsKubeAdmin.HasController.DeleteComponent(componentName, testNamespace, false)).To(Succeed()) + Expect(f.AsKubeAdmin.HasController.DeleteApplication(applicationName, testNamespace, false)).To(Succeed()) + Expect(f.AsKubeAdmin.TektonController.DeleteAllPipelineRunsInASpecificNamespace(testNamespace)).To(Succeed()) + } else { + Expect(f.AsKubeAdmin.CommonController.StoreAllPods(testNamespace)).To(Succeed()) + Expect(f.AsKubeAdmin.TektonController.StoreAllPipelineRuns(testNamespace)).To(Succeed()) + } + }) + + BeforeAll(func() { + + f, err = framework.NewFramework(utils.GetGeneratedNamespace("multi-platform-ibmz")) + Expect(err).NotTo(HaveOccurred()) + testNamespace = f.UserNamespace + Expect(testNamespace).NotTo(BeNil(), "failed to create sandbox user namespace") + Expect(err).ShouldNot(HaveOccurred()) + + // Restart multi-platform-controller pod to reload configMap again + podList, err := f.AsKubeAdmin.CommonController.ListAllPods(ControllerNamespace) + Expect(err).ShouldNot(HaveOccurred()) + for i := range podList.Items { + podName := podList.Items[i].Name + if strings.HasPrefix(podName, ControllerNamespace) { + err := f.AsKubeAdmin.CommonController.DeletePod(podName, ControllerNamespace) + Expect(err).ShouldNot(HaveOccurred()) + } + } + + //sleep for 10 sec so that multi-platform-controller pod comes up + time.Sleep(10 * time.Second) + + dynamicInstanceTag = "ibmz-instance-" + util.GenerateRandomString(4) + err = createConfigMapForIbmZDynamicInstance(f, dynamicInstanceTag) + Expect(err).ShouldNot(HaveOccurred()) + + err = createSecretsForIbmDynamicInstance(f) + Expect(err).ShouldNot(HaveOccurred()) + + err = createBuildPipelineSelector(f, testNamespace, "S390X") + Expect(err).ShouldNot(HaveOccurred()) + + timeout = time.Minute * 20 + interval = time.Second * 10 + + applicationName = fmt.Sprintf("multi-platform-suite-application-%s", util.GenerateRandomString(4)) + app, err := f.AsKubeAdmin.HasController.CreateApplication(applicationName, testNamespace) + Expect(err).NotTo(HaveOccurred()) + Expect(utils.WaitUntil(f.AsKubeAdmin.HasController.ApplicationGitopsRepoExists(app.Status.Devfile), 30*time.Second)).To( + Succeed(), fmt.Sprintf("timed out waiting for gitops content to be created for app %s in namespace %s: %+v", app.Name, app.Namespace, err), + ) + + componentName = fmt.Sprintf("multi-platform-suite-component-%s", util.GenerateRandomString(4)) + + // Create a component with Git Source URL being defined + componentObj := appservice.ComponentSpec{ + ComponentName: componentName, + Source: appservice.ComponentSource{ + ComponentSourceUnion: appservice.ComponentSourceUnion{ + GitSource: &appservice.GitSource{ + URL: multiPlatformProjectGitUrl, + Revision: multiPlatformProjectRevision, + }, + }, + }, + } + component, err = f.AsKubeAdmin.HasController.CreateComponent(componentObj, testNamespace, "", "", applicationName, true, map[string]string{}) + Expect(err).ShouldNot(HaveOccurred()) + }) + + When("the Component with multi-platform-build is created", func() { + It("a PipelineRun is triggered", func() { + Eventually(func() error { + pr, err := f.AsKubeAdmin.HasController.GetComponentPipelineRun(componentName, applicationName, testNamespace, "") + if err != nil { + GinkgoWriter.Printf("PipelineRun has not been created yet for the component %s/%s", testNamespace, componentName) + return err + } + if !pr.HasStarted() { + return fmt.Errorf("pipelinerun %s/%s hasn't started yet", pr.GetNamespace(), pr.GetName()) + } + return nil + }, timeout, constants.PipelineRunPollingInterval).Should(Succeed(), fmt.Sprintf("timed out when waiting for the PipelineRun to start for the component %s/%s", testNamespace, componentName)) + }) + + It("the build-container task from component pipelinerun is buildah-remote", func() { + Eventually(func() error { + pr, err := f.AsKubeAdmin.HasController.GetComponentPipelineRun(componentName, applicationName, testNamespace, "") + Expect(err).ShouldNot(HaveOccurred()) + + for _, chr := range pr.Status.ChildReferences { + taskRun := &pipeline.TaskRun{} + taskRunKey := types.NamespacedName{Namespace: pr.Namespace, Name: chr.Name} + err := f.AsKubeAdmin.CommonController.KubeRest().Get(context.TODO(), taskRunKey, taskRun) + Expect(err).ShouldNot(HaveOccurred()) + + prTrStatus := &pipeline.PipelineRunTaskRunStatus{ + PipelineTaskName: chr.PipelineTaskName, + Status: &taskRun.Status, + } + + if chr.PipelineTaskName == constants.BuildTaskRunName && prTrStatus.Status != nil && prTrStatus.Status.TaskSpec != nil && prTrStatus.Status.TaskSpec.Volumes != nil { + multiPlatformTaskName = chr.Name + for _, vol := range prTrStatus.Status.TaskSpec.Volumes { + if vol.Secret != nil && strings.HasPrefix(vol.Secret.SecretName, "multi-platform-ssh-") { + multiPlatformSecretName = vol.Secret.SecretName + return nil + } + } + } + } + return fmt.Errorf("couldn't find a matching step buildah-remote or ssh secret attached as a volume in the task %s in PipelineRun %s/%s", constants.BuildTaskRunName, testNamespace, pr.GetName()) + }, timeout, interval).Should(Succeed(), "timed out when verifying the buildah-remote image reference in pipelinerun") + }) + + It("The multi platform secret is populated", func() { + Eventually(func() error { + _, err := f.AsKubeAdmin.CommonController.GetSecret(testNamespace, multiPlatformSecretName) + if err != nil { + return err + } + return nil + }, timeout, interval).Should(Succeed(), "timed out when verifying the secret is created") + + // Get the instance id from the task so that we can check during cleanup + taskRun, err := f.AsKubeDeveloper.TektonController.GetTaskRun(multiPlatformTaskName, testNamespace) + Expect(err).ShouldNot(HaveOccurred()) + instanceId = taskRun.Annotations["build.appstudio.redhat.com/cloud-instance-id"] + GinkgoWriter.Printf("INSTANCE ID: %s\n", instanceId) + Expect(instanceId).ShouldNot(BeEmpty()) + }) + + It("that PipelineRun completes successfully", func() { + Expect(f.AsKubeAdmin.HasController.WaitForComponentPipelineToBeFinished(component, "", f.AsKubeAdmin.TektonController, &has.RetryOptions{Retries: 2, Always: true})).To(Succeed()) + pr, err := f.AsKubeAdmin.HasController.GetComponentPipelineRun(componentName, applicationName, testNamespace, "") + Expect(err).ShouldNot(HaveOccurred()) + //now delete it so it can't interfere with later test logic + Expect(f.AsKubeAdmin.TektonController.DeletePipelineRun(pr.Name, testNamespace)).Should(Succeed()) + }) + + It("check cleanup happened successfully", func() { + Eventually(func() error { + instances, err := getIbmZDynamicInstances(dynamicInstanceTag) + if err != nil { + return err + } + if len(instances) != 0 { + return fmt.Errorf("instance is not cleaned up properly, current running instances: %v", instances) + } + return nil + }, timeout, interval).Should(Succeed(), "timed out when verifying that the remote host was cleaned up correctly") + }) + + }) + }) + Describe("ibmp dynamic allocation", Label("ibmp-dynamic"), func() { + var testNamespace, applicationName, componentName, multiPlatformSecretName, multiPlatformTaskName, dynamicInstanceTag, instanceId string + var component *appservice.Component + var timeout, interval time.Duration + + AfterAll(func() { + // Cleanup ibm key & ssh secrets and host-config + Expect(f.AsKubeAdmin.CommonController.DeleteSecret(ControllerNamespace, IbmSecretName)).To(Succeed()) + Expect(f.AsKubeAdmin.CommonController.DeleteSecret(ControllerNamespace, SshSecretName)).To(Succeed()) + Expect(f.AsKubeAdmin.CommonController.DeleteConfigMap(HostConfig, ControllerNamespace, true)).To(Succeed()) + + //Forcefully remove instance incase it is not removed by multi-platform-controller + err = terminateIbmPInstance(instanceId) + if err != nil { + GinkgoWriter.Printf("error terminating instance again: %v", err) + } + + if !CurrentSpecReport().Failed() { + Expect(f.AsKubeAdmin.HasController.DeleteComponent(componentName, testNamespace, false)).To(Succeed()) + Expect(f.AsKubeAdmin.HasController.DeleteApplication(applicationName, testNamespace, false)).To(Succeed()) + Expect(f.AsKubeAdmin.TektonController.DeleteAllPipelineRunsInASpecificNamespace(testNamespace)).To(Succeed()) + } else { + Expect(f.AsKubeAdmin.CommonController.StoreAllPods(testNamespace)).To(Succeed()) + Expect(f.AsKubeAdmin.TektonController.StoreAllPipelineRuns(testNamespace)).To(Succeed()) + } + }) + + BeforeAll(func() { + + f, err = framework.NewFramework(utils.GetGeneratedNamespace("multi-platform-ibmp")) + Expect(err).NotTo(HaveOccurred()) + testNamespace = f.UserNamespace + Expect(testNamespace).NotTo(BeNil(), "failed to create sandbox user namespace") + Expect(err).ShouldNot(HaveOccurred()) + + // Restart multi-platform-controller pod to reload configMap again + podList, err := f.AsKubeAdmin.CommonController.ListAllPods(ControllerNamespace) + Expect(err).ShouldNot(HaveOccurred()) + for i := range podList.Items { + podName := podList.Items[i].Name + if strings.HasPrefix(podName, ControllerNamespace) { + err := f.AsKubeAdmin.CommonController.DeletePod(podName, ControllerNamespace) + Expect(err).ShouldNot(HaveOccurred()) + } + } + + //sleep for 10 sec so that multi-platform-controller pod comes up + time.Sleep(10 * time.Second) + + dynamicInstanceTag = "ibmp-instance-" + util.GenerateRandomString(4) + err = createConfigMapForIbmPDynamicInstance(f, dynamicInstanceTag) + Expect(err).ShouldNot(HaveOccurred()) + + err = createSecretsForIbmDynamicInstance(f) + Expect(err).ShouldNot(HaveOccurred()) + + err = createBuildPipelineSelector(f, testNamespace, "PPC64LE") + Expect(err).ShouldNot(HaveOccurred()) + + timeout = time.Minute * 20 + interval = time.Second * 10 + + applicationName = fmt.Sprintf("multi-platform-suite-application-%s", util.GenerateRandomString(4)) + app, err := f.AsKubeAdmin.HasController.CreateApplication(applicationName, testNamespace) + Expect(err).NotTo(HaveOccurred()) + Expect(utils.WaitUntil(f.AsKubeAdmin.HasController.ApplicationGitopsRepoExists(app.Status.Devfile), 30*time.Second)).To( + Succeed(), fmt.Sprintf("timed out waiting for gitops content to be created for app %s in namespace %s: %+v", app.Name, app.Namespace, err), + ) + + componentName = fmt.Sprintf("multi-platform-suite-component-%s", util.GenerateRandomString(4)) + + // Create a component with Git Source URL being defined + componentObj := appservice.ComponentSpec{ + ComponentName: componentName, + Source: appservice.ComponentSource{ + ComponentSourceUnion: appservice.ComponentSourceUnion{ + GitSource: &appservice.GitSource{ + URL: multiPlatformProjectGitUrl, + Revision: multiPlatformProjectRevision, + }, + }, + }, + } + component, err = f.AsKubeAdmin.HasController.CreateComponent(componentObj, testNamespace, "", "", applicationName, true, map[string]string{}) + Expect(err).ShouldNot(HaveOccurred()) + }) + + When("the Component with multi-platform-build is created", func() { + It("a PipelineRun is triggered", func() { + Eventually(func() error { + pr, err := f.AsKubeAdmin.HasController.GetComponentPipelineRun(componentName, applicationName, testNamespace, "") + if err != nil { + GinkgoWriter.Printf("PipelineRun has not been created yet for the component %s/%s", testNamespace, componentName) + return err + } + if !pr.HasStarted() { + return fmt.Errorf("pipelinerun %s/%s hasn't started yet", pr.GetNamespace(), pr.GetName()) + } + return nil + }, timeout, constants.PipelineRunPollingInterval).Should(Succeed(), fmt.Sprintf("timed out when waiting for the PipelineRun to start for the component %s/%s", testNamespace, componentName)) + }) + + It("the build-container task from component pipelinerun is buildah-remote", func() { + Eventually(func() error { + pr, err := f.AsKubeAdmin.HasController.GetComponentPipelineRun(componentName, applicationName, testNamespace, "") + Expect(err).ShouldNot(HaveOccurred()) + + for _, chr := range pr.Status.ChildReferences { + taskRun := &pipeline.TaskRun{} + taskRunKey := types.NamespacedName{Namespace: pr.Namespace, Name: chr.Name} + err := f.AsKubeAdmin.CommonController.KubeRest().Get(context.TODO(), taskRunKey, taskRun) + Expect(err).ShouldNot(HaveOccurred()) + + prTrStatus := &pipeline.PipelineRunTaskRunStatus{ + PipelineTaskName: chr.PipelineTaskName, + Status: &taskRun.Status, + } + + if chr.PipelineTaskName == constants.BuildTaskRunName && prTrStatus.Status != nil && prTrStatus.Status.TaskSpec != nil && prTrStatus.Status.TaskSpec.Volumes != nil { + multiPlatformTaskName = chr.Name + for _, vol := range prTrStatus.Status.TaskSpec.Volumes { + if vol.Secret != nil && strings.HasPrefix(vol.Secret.SecretName, "multi-platform-ssh-") { + multiPlatformSecretName = vol.Secret.SecretName + return nil + } + } + } + } + return fmt.Errorf("couldn't find a matching step buildah-remote or ssh secret attached as a volume in the task %s in PipelineRun %s/%s", constants.BuildTaskRunName, testNamespace, pr.GetName()) + }, timeout, interval).Should(Succeed(), "timed out when verifying the buildah-remote image reference in pipelinerun") + }) + + It("The multi platform secret is populated", func() { + Eventually(func() error { + _, err := f.AsKubeAdmin.CommonController.GetSecret(testNamespace, multiPlatformSecretName) + if err != nil { + return err + } + return nil + }, timeout, interval).Should(Succeed(), "timed out when verifying the secret is created") + + // Get the instance id from the task so that we can check during cleanup + taskRun, err := f.AsKubeDeveloper.TektonController.GetTaskRun(multiPlatformTaskName, testNamespace) + Expect(err).ShouldNot(HaveOccurred()) + instanceId = taskRun.Annotations["build.appstudio.redhat.com/cloud-instance-id"] + GinkgoWriter.Printf("INSTANCE ID: %s\n", instanceId) + Expect(instanceId).ShouldNot(BeEmpty()) + }) + + It("that PipelineRun completes successfully", func() { + Expect(f.AsKubeAdmin.HasController.WaitForComponentPipelineToBeFinished(component, "", f.AsKubeAdmin.TektonController, &has.RetryOptions{Retries: 2, Always: true})).To(Succeed()) + pr, err := f.AsKubeAdmin.HasController.GetComponentPipelineRun(componentName, applicationName, testNamespace, "") + Expect(err).ShouldNot(HaveOccurred()) + //now delete it so it can't interfere with later test logic + Expect(f.AsKubeAdmin.TektonController.DeletePipelineRun(pr.Name, testNamespace)).Should(Succeed()) + }) + + It("check cleanup happened successfully", func() { + Eventually(func() error { + count, err := getIbmPDynamicInstanceCount(dynamicInstanceTag) + if err != nil { + return err + } + if count != 0 { + return fmt.Errorf("instance is not cleaned up properly, running instances count: %d", count) + } + return nil + }, timeout, interval).Should(Succeed(), "timed out when verifying that the remote host was cleaned up correctly") + }) + + }) + }) }) +func pCloudId() string { + return strings.Split(strings.Split(CRN, "/")[1], ":")[1] +} + +func getIbmPDynamicInstanceCount(instanceTag string) (int, error) { + apiKey := os.Getenv("MULTI_PLATFORM_IBM_API_KEY") + serviceOptions := &core.ServiceOptions{ + URL: IbmPUrl, + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + baseService, err := core.NewBaseService(serviceOptions) + if err != nil { + return 0, err + } + + builder := core.NewRequestBuilder(core.GET) + builder = builder.WithContext(context.Background()) + builder.EnableGzipCompression = baseService.GetEnableGzipCompression() + + pathParamsMap := map[string]string{ + "cloud": pCloudId(), + } + _, err = builder.ResolveRequestURL(IbmPUrl, `/pcloud/v1/cloud-instances/{cloud}/pvm-instances`, pathParamsMap) + if err != nil { + return 0, err + } + builder.AddHeader("CRN", CRN) + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return 0, err + } + + var rawResponse map[string]json.RawMessage + _, err = baseService.Request(request, &rawResponse) + if err != nil { + return 0, err + } + instancesData := rawResponse["pvmInstances"] + instances := []json.RawMessage{} + err = json.Unmarshal(instancesData, &instances) + if err != nil { + return 0, err + } + count := 0 + type Instance struct { + ServerName string + } + singleInstance := &Instance{} + for i := range instances { + err = json.Unmarshal(instances[i], singleInstance) + if err != nil { + return 0, err + } + if strings.HasPrefix(singleInstance.ServerName, instanceTag) { + count++ + } + } + return count, nil +} + +func terminateIbmPInstance(instanceId string) error { + apiKey := os.Getenv("MULTI_PLATFORM_IBM_API_KEY") + serviceOptions := &core.ServiceOptions{ + URL: IbmPUrl, + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + } + baseService, err := core.NewBaseService(serviceOptions) + if err != nil { + return err + } + //_ = r.deleteServer(context.Background(), baseService, string(instanceId)) + builder := core.NewRequestBuilder(core.DELETE) + builder = builder.WithContext(context.Background()) + builder.EnableGzipCompression = baseService.GetEnableGzipCompression() + + pathParamsMap := map[string]string{ + "cloud": pCloudId(), + "pvm_instance_id": instanceId, + } + _, err = builder.ResolveRequestURL(IbmPUrl, `/pcloud/v1/cloud-instances/{cloud}/pvm-instances/{pvm_instance_id}`, pathParamsMap) + if err != nil { + return err + } + builder.AddQuery("delete_data_volumes", "true") + builder.AddHeader("CRN", CRN) + builder.AddHeader("Accept", "application/json") + + request, err := builder.Build() + if err != nil { + return err + } + + var rawResponse map[string]json.RawMessage + _, err = baseService.Request(request, &rawResponse) + if err != nil { + if err.Error() == "pvm-instance not found" { + return nil + } + return err + } + return nil +} +func getIbmZDynamicInstances(instanceTag string) ([]string, error) { + apiKey := os.Getenv("MULTI_PLATFORM_IBM_API_KEY") + if apiKey == "" { + return nil, fmt.Errorf("ibm api key is not set") + } + // Instantiate the service with an API key based IAM authenticator + vpcService, err := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{ + URL: IbmZUrl, + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + }) + if err != nil { + return nil, err + } + // Lookup VPC + vpcs, _, err := vpcService.ListVpcs(&vpcv1.ListVpcsOptions{}) + if err != nil { + return nil, err + } + var vpc *vpcv1.VPC + for i := range vpcs.Vpcs { + //GinkgoWriter.Println("VPC: " + *vpcs.Vpcs[i].Name) + if *vpcs.Vpcs[i].Name == IbmVpc { + vpc = &vpcs.Vpcs[i] + break + } + } + if vpc == nil { + return nil, fmt.Errorf("failed to find VPC %s", IbmVpc) + } + + instances, _, err := vpcService.ListInstances(&vpcv1.ListInstancesOptions{ResourceGroupID: vpc.ResourceGroup.ID, VPCName: &IbmVpc}) + if err != nil { + return nil, err + } + var instanceIds []string + for _, instance := range instances.Instances { + if strings.HasPrefix(*instance.Name, instanceTag) { + instanceIds = append(instanceIds, *instance.ID) + } + } + return instanceIds, nil +} + +func terminateIbmZInstance(instanceId string) error { + apiKey := os.Getenv("MULTI_PLATFORM_IBM_API_KEY") + if apiKey == "" { + return fmt.Errorf("ibm api key is not set correctly") + } + vpcService, err := vpcv1.NewVpcV1(&vpcv1.VpcV1Options{ + URL: IbmZUrl, + Authenticator: &core.IamAuthenticator{ + ApiKey: apiKey, + }, + }) + if err != nil { + return err + } + instance, _, err := vpcService.GetInstance(&vpcv1.GetInstanceOptions{ID: &instanceId}) + if err != nil { + if err.Error() == "Instance not found" { + return nil + } + GinkgoWriter.Printf("failed to delete system z instance, unable to get instance with error: %v\n", err) + return err + } + _, err = vpcService.DeleteInstance(&vpcv1.DeleteInstanceOptions{ID: instance.ID}) + if err != nil { + GinkgoWriter.Printf("failed to delete system z instance: %v\n", err) + return err + } + return nil +} + +func createConfigMapForIbmZDynamicInstance(f *framework.Framework, instanceTag string) error { + hostConfig := &v1.ConfigMap{} + hostConfig.Name = HostConfig + hostConfig.Namespace = ControllerNamespace + hostConfig.Labels = map[string]string{MultiPlatformConfigKey: "hosts"} + + hostConfig.Data = map[string]string{} + hostConfig.Data["dynamic-platforms"] = "linux/s390x" + hostConfig.Data["instance-tag"] = instanceTag + hostConfig.Data["dynamic.linux-s390x.type"] = "ibmz" + hostConfig.Data["dynamic.linux-s390x.ssh-secret"] = SshSecretName + hostConfig.Data["dynamic.linux-s390x.secret"] = IbmSecretName + hostConfig.Data["dynamic.linux-s390x.vpc"] = IbmVpc + hostConfig.Data["dynamic.linux-s390x.key"] = IbmKey + hostConfig.Data["dynamic.linux-s390x.subnet"] = "us-east-2-default-subnet" + hostConfig.Data["dynamic.linux-s390x.image-id"] = "r014-17c957e0-01a1-4f7f-bc24-191f5f10eba8" + hostConfig.Data["dynamic.linux-s390x.region"] = "us-east-2" + hostConfig.Data["dynamic.linux-s390x.url"] = IbmZUrl + hostConfig.Data["dynamic.linux-s390x.profile"] = "bz2-1x4" + hostConfig.Data["dynamic.linux-s390x.max-instances"] = "1" + + _, err := f.AsKubeAdmin.CommonController.CreateConfigMap(hostConfig, ControllerNamespace) + if err != nil { + return fmt.Errorf("error while creating config map for dynamic instance: %v", err) + } + return nil +} + +func createSecretsForIbmDynamicInstance(f *framework.Framework) error { + ibmKey := v1.Secret{} + ibmKey.Name = "ibmkey" + ibmKey.Namespace = ControllerNamespace + ibmKey.Labels = map[string]string{MultiPlatformSecretKey: "true"} + ibmKey.StringData = map[string]string{ + "api-key": os.Getenv("MULTI_PLATFORM_IBM_API_KEY"), + } + _, err := f.AsKubeAdmin.CommonController.CreateSecret(ControllerNamespace, &ibmKey) + if err != nil { + return fmt.Errorf("error creating secret with api_key: %v", err) + } + + sshKeys := v1.Secret{} + sshKeys.Name = SshSecretName + sshKeys.Namespace = ControllerNamespace + sshKeys.Labels = map[string]string{MultiPlatformSecretKey: "true"} + sshKeys.StringData = map[string]string{"id_rsa": os.Getenv("MULTI_PLATFORM_AWS_SSH_KEY")} + _, err = f.AsKubeAdmin.CommonController.CreateSecret(ControllerNamespace, &sshKeys) + if err != nil { + return fmt.Errorf("error creating secret with ssh private key: %v", err) + } + return nil +} + +func createConfigMapForIbmPDynamicInstance(f *framework.Framework, instanceTag string) error { + hostConfig := &v1.ConfigMap{} + hostConfig.Name = HostConfig + hostConfig.Namespace = ControllerNamespace + hostConfig.Labels = map[string]string{MultiPlatformConfigKey: "hosts"} + + hostConfig.Data = map[string]string{} + hostConfig.Data["dynamic-platforms"] = "linux/ppc64le" + hostConfig.Data["instance-tag"] = instanceTag + hostConfig.Data["dynamic.linux-ppc64le.type"] = "ibmp" + hostConfig.Data["dynamic.linux-ppc64le.ssh-secret"] = SshSecretName + hostConfig.Data["dynamic.linux-ppc64le.secret"] = "ibmkey" + hostConfig.Data["dynamic.linux-ppc64le.key"] = IbmKey + hostConfig.Data["dynamic.linux-ppc64le.image"] = "sdouglas-rhel-test" + hostConfig.Data["dynamic.linux-ppc64le.crn"] = CRN + hostConfig.Data["dynamic.linux-ppc64le.url"] = IbmPUrl + hostConfig.Data["dynamic.linux-ppc64le.network"] = "dff71085-73da-49f5-9bf2-5ea60c66c99b" + hostConfig.Data["dynamic.linux-ppc64le.system"] = "e980" + hostConfig.Data["dynamic.linux-ppc64le.cores"] = "0.25" + hostConfig.Data["dynamic.linux-ppc64le.memory"] = "2" + hostConfig.Data["dynamic.linux-ppc64le.max-instances"] = "2" + + _, err := f.AsKubeAdmin.CommonController.CreateConfigMap(hostConfig, ControllerNamespace) + if err != nil { + return fmt.Errorf("error while creating config map for dynamic instance: %v", err) + } + return nil +} + // Function to check if a file exists on the remote host func dirExists(session *ssh.Session, dirPath string) bool { cmd := fmt.Sprintf("[ -d %s ] && echo 'exists'", dirPath) @@ -544,9 +1163,9 @@ func createSecretsForDynamicInstance(f *framework.Framework) error { return nil } -func createBuildPipelineSelector(f *framework.Framework, namespace string) error { +func createBuildPipelineSelector(f *framework.Framework, namespace string, platform string) error { trueBool := true - customBuildahRemotePipeline := os.Getenv(constants.CUSTOM_BUILDAH_REMOTE_PIPELINE_BUILD_BUNDLE_ENV) + customBuildahRemotePipeline := os.Getenv(constants.CUSTOM_BUILDAH_REMOTE_PIPELINE_BUILD_BUNDLE_ENV + "_" + platform) Expect(customBuildahRemotePipeline).ShouldNot(BeEmpty()) if customBuildahRemotePipeline == "" { return fmt.Errorf("remote build pipeline bundle is empty")