From 21debe2c00aca24a4c8725da268af0ee6f95d945 Mon Sep 17 00:00:00 2001 From: Yuwen Ma Date: Thu, 22 Apr 2021 15:07:17 -0700 Subject: [PATCH] [V3] New V3 SkaffoldRunner (#5692) * [V3] New V3 SkaffoldRunner 1. Refactored the runner directory. 2. Create a New SkaffoldRunner for V3. Both runner.SkaffoldRunner and v3.SkaffoldRunner implements the Runner interface. 2. Build, Test, Prune and other shared methods are moved from SkaffoldRunner to several individual structs (BuildRunner, TestRunner). 3. Both SkaffoldRunner and the V3 SkaffoldRunner have the shared structs as components. 4. Unittests are updated. 5. Add placeholders (not implemented error) in v3 SkaffoldRunner for later implementation. * Rename BuildRunner TestRunner and PruneRunner to runner.Builder runner.Tester and runner.Pruner --- go.mod | 15 +++-- go.sum | 63 ++++++++---------- pkg/skaffold/runner/build_deploy.go | 73 +++++++-------------- pkg/skaffold/runner/changeset.go | 16 ++--- pkg/skaffold/runner/deploy.go | 40 +++++++++++ pkg/skaffold/runner/dev_test.go | 16 ++--- pkg/skaffold/runner/intent.go | 36 +++++----- pkg/skaffold/runner/load_images_test.go | 4 +- pkg/skaffold/runner/new.go | 21 ++++-- pkg/skaffold/runner/prune.go | 10 ++- pkg/skaffold/runner/runner.go | 22 ++----- pkg/skaffold/runner/runner_test.go | 4 +- pkg/skaffold/runner/tester.go | 37 +++++++++++ pkg/skaffold/runner/v3/apply.go | 26 ++++++++ pkg/skaffold/runner/v3/cleanup.go | 26 ++++++++ pkg/skaffold/runner/v3/deploy.go | 28 ++++++++ pkg/skaffold/runner/v3/dev.go | 28 ++++++++ pkg/skaffold/runner/v3/generate_pipeline.go | 28 ++++++++ pkg/skaffold/runner/v3/render.go | 28 ++++++++ pkg/skaffold/runner/v3/runner.go | 28 ++++++++ pkg/skaffold/test/types.go | 2 +- 21 files changed, 403 insertions(+), 148 deletions(-) create mode 100644 pkg/skaffold/runner/tester.go create mode 100644 pkg/skaffold/runner/v3/apply.go create mode 100644 pkg/skaffold/runner/v3/cleanup.go create mode 100644 pkg/skaffold/runner/v3/deploy.go create mode 100644 pkg/skaffold/runner/v3/dev.go create mode 100644 pkg/skaffold/runner/v3/generate_pipeline.go create mode 100644 pkg/skaffold/runner/v3/render.go create mode 100644 pkg/skaffold/runner/v3/runner.go diff --git a/go.mod b/go.mod index 9a78f513c71..6a06015f032 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( cloud.google.com/go/storage v1.10.0 github.com/AlecAivazis/survey/v2 v2.2.7 github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.13.0 + github.com/aws/aws-sdk-go v1.36.30 // indirect github.com/blang/semver v3.5.1+incompatible github.com/bmatcuk/doublestar v1.2.4 github.com/buildpacks/imgutil v0.0.0-20201211223552-8581300fe2b2 @@ -49,6 +50,9 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // github.com/moby/buildkit v0.7.1 github.com/moby/buildkit v0.8.0 + github.com/nxadm/tail v1.4.8 // indirect + github.com/onsi/ginkgo v1.15.0 // indirect + github.com/onsi/gomega v1.10.5 // indirect github.com/opencontainers/go-digest v1.0.0 github.com/opencontainers/image-spec v1.0.1 github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 @@ -57,20 +61,22 @@ require ( github.com/rjeczalik/notify v0.9.3-0.20201210012515-e2a77dcc14cf github.com/russross/blackfriday/v2 v2.0.1 github.com/segmentio/textio v1.2.0 - github.com/sirupsen/logrus v1.7.0 - github.com/spf13/cobra v1.1.1 + github.com/sirupsen/logrus v1.8.1 + github.com/spf13/cobra v1.1.3 github.com/spf13/pflag v1.0.5 + github.com/stretchr/testify v1.7.0 // indirect github.com/tektoncd/pipeline v0.5.1-0.20190731183258-9d7e37e85bf8 github.com/xeipuuv/gojsonschema v1.2.0 go.opentelemetry.io/otel v0.13.0 go.opentelemetry.io/otel/exporters/stdout v0.13.0 go.opentelemetry.io/otel/sdk v0.13.0 + golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 // indirect golang.org/x/mod v0.4.1 + golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 // indirect golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58 golang.org/x/sync v0.0.0-20201207232520-09787c993a3a - golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c + golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 - golang.org/x/tools v0.1.0 // indirect google.golang.org/api v0.35.0 google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20201202151023-55d61f90c1ce @@ -78,6 +84,7 @@ require ( google.golang.org/protobuf v1.25.0 gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 + honnef.co/go/tools v0.1.3 // indirect k8s.io/api v0.19.7 k8s.io/apimachinery v0.19.7 k8s.io/client-go v0.19.7 diff --git a/go.sum b/go.sum index 9c274a522d8..1a885cc4eaa 100644 --- a/go.sum +++ b/go.sum @@ -75,7 +75,6 @@ github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9mo github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v38.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v42.3.0+incompatible h1:PAHkmPqd/vQV4LJcqzEUM1elCyTMWjbrO8oFMl0dvBE= github.com/Azure/azure-sdk-for-go v42.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v43.0.0+incompatible h1:/wSNCu0e6EsHFR4Qa3vBEBbicaprEHMyyga9g8RTULI= github.com/Azure/azure-sdk-for-go v43.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= @@ -221,8 +220,9 @@ github.com/aws/aws-sdk-go v1.27.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aws/aws-sdk-go v1.27.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.28.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.31.6/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.31.12 h1:SxRRGyhlCagI0DYkhOg+FgdXGXzRTE3vEX/gsgFaiKQ= github.com/aws/aws-sdk-go v1.31.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.36.30 h1:hAwyfe7eZa7sM+S5mIJZFiNFwJMia9Whz6CYblioLoU= +github.com/aws/aws-sdk-go v1.36.30/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/aws/aws-sdk-go-v2 v0.18.0/go.mod h1:JWVYvqSMppoMJC0x5wdwiImzgXTI9FuZwxzkQq9wy+g= github.com/aybabtme/rgbterm v0.0.0-20170906152045-cc83f3b3ce59/go.mod h1:q/89r3U2H7sSsE2t6Kca0lfwTK8JdoNGS/yzM/4iH5I= github.com/benbjohnson/clock v1.0.3 h1:vkLuvpK4fmtSCuo60+yC63p7y0BmQ8gm5ZXGuBCJyXg= @@ -473,7 +473,6 @@ github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9 github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0 h1:QvGt2nLcHH0WK9orKa+ppBPAxREcH364nPUedEpK0TY= github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= github.com/go-logr/logr v0.4.0 h1:K7/B1jt6fIBQVd4Owv2MqGQClcgf0R266+7C/QjRcLc= github.com/go-logr/logr v0.4.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= @@ -649,7 +648,6 @@ github.com/google/go-containerregistry v0.0.0-20191010200024-a3d713f9b7f8/go.mod github.com/google/go-containerregistry v0.1.2/go.mod h1:GPivBPgdAyd2SU+vf6EpsgOtWDuPqjW0hJZt4rNdTZ4= github.com/google/go-containerregistry v0.2.1/go.mod h1:Ts3Wioz1r5ayWx8sS6vLcWltWcM1aqFjd/eVrkFhrWM= github.com/google/go-containerregistry v0.3.0/go.mod h1:BJ7VxR1hAhdiZBGGnvGETHEmFs1hzXc4VM1xjOPO9wA= -github.com/google/go-containerregistry v0.4.0 h1:45axtqLd66llqD8R9XgiCQ64foc7I2xkAG40NwR5YFw= github.com/google/go-containerregistry v0.4.0/go.mod h1:TX4KwzBRckt63iM22ZNHzUGqXMdLE1UFJuEQnC/14fE= github.com/google/go-containerregistry v0.4.1-0.20210128200529-19c2b639fab1 h1:o2ykCuuhHeUwtzNg89pH2hi+821aqjLWkaREVR3ziTQ= github.com/google/go-containerregistry v0.4.1-0.20210128200529-19c2b639fab1/go.mod h1:GU9FUA/X9rd2cV3ZoUNaWihp27tki6/38EsVzL2Dyzc= @@ -804,8 +802,11 @@ github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20160803190731-bd40a432e4c7/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.2.1-0.20190826204134-d7d95172beb5/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/joefitzgerald/rainbow-reporter v0.1.0/go.mod h1:481CNgqmVHQZzdIbN52CupLJyoVwB10FQ/IQlF1pdL8= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= @@ -976,8 +977,9 @@ github.com/nbutton23/zxcvbn-go v0.0.0-20180912185939-ae427f1e4c1d/go.mod h1:o96d github.com/ncw/swift v1.0.47/go.mod h1:23YIA4yWVnGwv2dQlN4bB7egfYX6YLn0Yo/S6zZO/ZM= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= 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/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= @@ -990,8 +992,9 @@ github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/ginkgo v1.12.1 h1:mFwc4LvZ0xpSvDZ3E+k8Yte0hLOMxXUlP+yXtJqkYfQ= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= @@ -1001,8 +1004,9 @@ github.com/onsi/gomega v1.8.1/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoT github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= -github.com/onsi/gomega v1.10.4 h1:NiTx7EEvBzu9sFOD1zORteLSt3o8gnlvZZwSE9TnY9U= github.com/onsi/gomega v1.10.4/go.mod h1:g/HbgYopi++010VEqkFgJHKC09uJiW9UkXvMUuKHUCQ= +github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= @@ -1168,8 +1172,9 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.7.0 h1:ShrD1U9pZB12TX0cVy0DtePoCH97K8EtX+mg7ZARUtM= github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= github.com/smartystreets/assertions v1.0.0/go.mod h1:kHHU4qYBaI3q23Pp3VPrmWhuIUrLW/7eUrw0BU5VaoM= github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= @@ -1189,8 +1194,9 @@ github.com/spf13/cobra v0.0.2-0.20171109065643-2da4a54c5cee/go.mod h1:1l0Ry5zgKv github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= +github.com/spf13/cobra v1.1.3 h1:xghbfqPkxzxP3C/f3n5DdpAbdKLj4ZE4BWQI362l53M= +github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= @@ -1222,8 +1228,9 @@ github.com/stretchr/testify v1.2.3-0.20181224173747-660f15d67dbb/go.mod h1:a8OnR github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/syndtr/gocapability v0.0.0-20180916011248-d98352740cb2/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= @@ -1270,7 +1277,6 @@ github.com/valyala/fasthttp v1.2.0/go.mod h1:4vX61m6KN+xDduDNwXrhIAVZaZaZiQ1luJk github.com/valyala/quicktemplate v1.2.0/go.mod h1:EH+4AkTd43SvgIbQHYu59/cJyxDoOVRUAfrukLPuGJ4= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= github.com/vdemeester/k8s-pkg-credentialprovider v1.17.4/go.mod h1:inCTmtUdr5KJbreVojo06krnTgaeAz/Z7lynpPk/Q2c= -github.com/vdemeester/k8s-pkg-credentialprovider v1.18.1-0.20201019120933-f1d16962a4db h1:lWvSzFrGhtYgApDvR5X+43rqfpLzRumLzypyL1YhDww= github.com/vdemeester/k8s-pkg-credentialprovider v1.18.1-0.20201019120933-f1d16962a4db/go.mod h1:grWy0bkr1XO6hqbaaCKaPXqkBVlMGHYG6PGykktwbJc= github.com/vdemeester/k8s-pkg-credentialprovider v1.19.7 h1:MJ5fV2Z0OyIuPvFVs0vi6VjTjxpdK1QT8oX/aWiUjYM= github.com/vdemeester/k8s-pkg-credentialprovider v1.19.7/go.mod h1:K2nMO14cgZitdwBqdQps9tInJgcaXcU/7q5F59lpbNI= @@ -1381,8 +1387,9 @@ golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9 h1:phUcVbl53swtrUN8kQEXFhUxPlIlWyBfKmidCu7P95o= golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83 h1:/ZScEX8SfEmUGRHs0gxpqteO5nfNW6axyZbBdw9A12g= +golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1418,7 +1425,6 @@ golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1 h1:Kvvh58BN8Y9/lBi7hTekvtMpm07eUZ0ck5pRHpsMWrY= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -1478,10 +1484,10 @@ golang.org/x/net v0.0.0-20201006153459-a7d1128ccaa0/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U= golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210119194325-5f4716e94777 h1:003p0dJM77cxMSyCPFphvZf/Y5/NXf5fzg6ufd1/Oew= golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180724155351-3d292e4d0cdc/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1504,7 +1510,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1590,14 +1595,14 @@ golang.org/x/sys v0.0.0-20200917073148-efd3b9a0ff20/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200922070232-aee5d888a860/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201013081832-0aaa2718063a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211 h1:9UQO31fZ+0aKQOFldThf7BKPMJTiBfWycGh/u3UoO88= golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201112073958-5cba982894dd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c h1:VwygUrnw9jn88c4u8GD3rZQbqrP/tgas88tPUbBxQrk= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/term v0.0.0-20201117132131-f5c789dd3221 h1:/ZHdbVpdR/jk3g30/d4yUL0JU9kksj8+F/bnQUVLGDM= +golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46 h1:V066+OYJ66oTjnhm4Yrn7SXIwSCiDQJxpBxmvqb1N1c= +golang.org/x/sys v0.0.0-20210228012217-479acdf4ea46/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= @@ -1607,7 +1612,6 @@ 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -1703,8 +1707,8 @@ golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/tools v0.0.0-20200916195026-c9a70fc28ce3/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd h1:kJP9fbfkpUoA4y03Nxor8be+YbShcXP16fc7G4nlgpw= golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1852,7 +1856,6 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/check.v1 v1.0.0-20141024133853-64131543e789/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b h1:QRR6H1YWRnHb4Y/HeNFCTJLFVxaq6wH4YuVdsUOr75U= gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -1890,7 +1893,6 @@ gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= @@ -1910,14 +1912,14 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.0.1-2020.1.5 h1:nI5egYTGJakVyOryqLs1cQO5dO0ksin5XXs2pspk75k= honnef.co/go/tools v0.0.1-2020.1.5/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.1.3 h1:qTakTkI6ni6LFD5sBwwsdSO+AQqbSIxOauHTTQKZ/7o= +honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= k8s.io/api v0.0.0-20180904230853-4e7be11eab3f/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/api v0.17.4/go.mod h1:5qxx6vjmwUVG2nHQTKGlLts8Tbok8PzHl4vHtVFuZCA= k8s.io/api v0.18.8/go.mod h1:d/CXqwWv+Z2XEG1LgceeDmHQwpUJhROPx16SlxJgERY= k8s.io/api v0.18.12/go.mod h1:3sS78jmUoGHwERyMbEhxP6owcQ77UxGo+Yy+dKNWrh0= k8s.io/api v0.19.0/go.mod h1:I1K45XlvTrDjmj5LoM5LuP/KYrhWbjUKT/SoPG0qTjw= -k8s.io/api v0.19.4 h1:I+1I4cgJYuCDgiLNjKx7SLmIbwgj9w7N7Zr5vSIdwpo= k8s.io/api v0.19.4/go.mod h1:SbtJ2aHCItirzdJ36YslycFNzWADYH3tgOhvBEFtZAk= k8s.io/api v0.19.7 h1:MpHhls03C2pyzoYcpbe4QqYiiZjdvW+tuWq6TbjV14Y= k8s.io/api v0.19.7/go.mod h1:KTryDUT3l6Mtv7K2J2486PNL9DBns3wOYTkGR+iz63Y= @@ -1928,7 +1930,6 @@ k8s.io/apimachinery v0.17.4/go.mod h1:gxLnyZcGNdZTCLnq3fgzyg2A5BVCHTNDFrw8AmuJ+0 k8s.io/apimachinery v0.18.8/go.mod h1:6sQd+iHEqmOtALqOFjSWp2KZ9F0wlU/nWm0ZgsYWMig= k8s.io/apimachinery v0.18.12/go.mod h1:PF5taHbXgTEJLU+xMypMmYTXTWPJ5LaW8bfsisxnEXk= k8s.io/apimachinery v0.19.0/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= -k8s.io/apimachinery v0.19.4 h1:+ZoddM7nbzrDCp0T3SWnyxqf8cbWPT2fkZImoyvHUG0= k8s.io/apimachinery v0.19.4/go.mod h1:DnPGDnARWFvYa3pMHgSxtbZb7gpzzAZ1pTfaUNDVlmA= k8s.io/apimachinery v0.19.7 h1:nTaEnYVH+i//aPgMA0zTEV2lfVLCV9LextqVd67mulc= k8s.io/apimachinery v0.19.7/go.mod h1:6sRbGRAVY5DOCuZwB5XkqguBqpqLU6q/kOaOdk29z6Q= @@ -1942,7 +1943,6 @@ k8s.io/client-go v0.17.4/go.mod h1:ouF6o5pz3is8qU0/qYL2RnoxOPqgfuidYLowytyLJmc= k8s.io/client-go v0.18.8/go.mod h1:HqFqMllQ5NnQJNwjro9k5zMyfhZlOwpuTLVrxjkYSxU= k8s.io/client-go v0.18.12/go.mod h1:0aC8XkA09dX/goYqHQJ/kVv0zL1t+weOZt3pmz9LpxA= k8s.io/client-go v0.19.0/go.mod h1:H9E/VT95blcFQnlyShFgnFT9ZnJOAceiUHM3MlRC+mU= -k8s.io/client-go v0.19.4 h1:85D3mDNoLF+xqpyE9Dh/OtrJDyJrSRKkHmDXIbEzer8= k8s.io/client-go v0.19.4/go.mod h1:ZrEy7+wj9PjH5VMBCuu/BDlvtUAku0oVFk4MmnW9mWA= k8s.io/client-go v0.19.7 h1:SoJ4mzZ9LyXBGDe8MmpMznw0CwQ1ITWgsmG7GixvhUU= k8s.io/client-go v0.19.7/go.mod h1:iytGI7S3kmv6bWnn+bSQUE4VlrEi4YFssvVB7J7Hvqg= @@ -1957,7 +1957,6 @@ k8s.io/code-generator v0.20.1/go.mod h1:UsqdF+VX4PU2g46NC2JRs4gc+IfrctnwHb76RNbW k8s.io/component-base v0.17.4/go.mod h1:5BRqHMbbQPm2kKu35v3G+CpVq4K0RJKC7TRioF0I9lE= k8s.io/component-base v0.18.8/go.mod h1:00frPRDas29rx58pPCxNkhUfPbwajlyyvu8ruNgSErU= k8s.io/component-base v0.18.12/go.mod h1:pRGKXsx2KWfsJqlDi4sbCc1jpaB87rXIIqupjhr5wj0= -k8s.io/component-base v0.19.4 h1:HobPRToQ8KJ9ubRju6PUAk9I5V1GNMJZ4PyWbiWA0uI= k8s.io/component-base v0.19.4/go.mod h1:ZzuSLlsWhajIDEkKF73j64Gz/5o0AgON08FgRbEPI70= k8s.io/component-base v0.19.7 h1:ZXS2VRWOWBOc2fTd1zjzhi/b/mkqFT9FDqiNsn1cH30= k8s.io/component-base v0.19.7/go.mod h1:YX8spPBgwl3I6UGcSdQiEMAqRMSUsGQOW7SEr4+Qa3U= @@ -1977,9 +1976,7 @@ k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= k8s.io/klog v1.0.0 h1:Pt+yjF5aB1xDSVbau4VsWe+dQNzA0qv1LlXdC2dF6Q8= k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0 h1:XRvcwJozkgZ1UQJmfMGpvRthQHOvihEhYtDfAaxMz/A= k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.4.0 h1:7+X0fUguPyrKEC4WjH8iGDg3laWgMo5tMnRTIGTTxGQ= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= k8s.io/klog/v2 v2.5.0 h1:8mOnjf1RmUPW6KRqQCfYSZq/K20Unmp3IhuZUhxl8KI= k8s.io/klog/v2 v2.5.0/go.mod h1:hy9LJ/NvuK+iVyP4Ehqva4HxZG/oXyIS3n3Jmire4Ec= @@ -1987,9 +1984,7 @@ k8s.io/kube-openapi v0.0.0-20180731170545-e3762e86a74c/go.mod h1:BXM9ceUBTj2QnfH k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kube-openapi v0.0.0-20200410145947-61e04a5be9a6/go.mod h1:GRQhZsXIAJ1xR0C9bd8UpWHZ5plfAS9fzPjJuQ6JL3E= k8s.io/kube-openapi v0.0.0-20200410145947-bcb3869e6f29/go.mod h1:F+5wygcW0wmRTnM3cOgIqGivxkwSWIWT5YdsDbeAOaU= -k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6 h1:+WnxoVtG8TMiudHBSEtrVL1egv36TkkJm+bA8AxicmQ= k8s.io/kube-openapi v0.0.0-20200805222855-6aeccd4b50c6/go.mod h1:UuqjUnNftUyPE5H64/qeyjQoUZhGpeFDVdxjTeEVN2o= -k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd h1:sOHNzJIkytDF6qadMNKhhDRpc6ODik8lVC6nOur7B2c= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/kube-openapi v0.0.0-20210113233702-8566a335510f h1:ZcWbnalfwIst131Zff7dGd1HQdt+NA9q7z9Fi0vbsHY= k8s.io/kube-openapi v0.0.0-20210113233702-8566a335510f/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= @@ -1998,7 +1993,6 @@ k8s.io/kubectl v0.19.4/go.mod h1:XPmlu4DJEYgD83pvZFeKF8+MSvGnYGqunbFSrJsqHv0= k8s.io/kubernetes v1.11.10/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= k8s.io/legacy-cloud-providers v0.17.4/go.mod h1:FikRNoD64ECjkxO36gkDgJeiQWwyZTuBkhu+yxOc1Js= -k8s.io/legacy-cloud-providers v0.18.8 h1:IGASZSYJjkMk5d1HU9+zskZqoRG3zccVzvA3hV7hCL0= k8s.io/legacy-cloud-providers v0.18.8/go.mod h1:tgp4xYf6lvjrWnjQwTOPvWQE9IVqSBGPF4on0IyICQE= k8s.io/legacy-cloud-providers v0.19.7 h1:YJ/l/8/Hn56I9m1cudK8aNypRA/NvI/hYhg8fo/CTus= k8s.io/legacy-cloud-providers v0.19.7/go.mod h1:dsZk4gH9QIwAtHQ8CK0Ps257xlfgoXE3tMkMNhW2xDU= @@ -2038,7 +2032,6 @@ sigs.k8s.io/structured-merge-diff/v2 v2.0.1/go.mod h1:Wb7vfKAodbKgf6tn1Kl0VvGj7m sigs.k8s.io/structured-merge-diff/v3 v3.0.0-20200116222232-67a7b8c61874/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.0/go.mod h1:PlARxl6Hbt/+BC80dRLi1qAmnMqwqDg62YvvVkZjemw= sigs.k8s.io/structured-merge-diff/v3 v3.0.1-0.20200706213357-43c19bbb7fba/go.mod h1:V06abazjHneE37ZdSY/UUwPVgcJMKI/jU5XGUjgIKoc= -sigs.k8s.io/structured-merge-diff/v4 v4.0.1 h1:YXTMot5Qz/X1iBRJhAt+vI+HVttY0WkSqqhKxQ0xVbA= sigs.k8s.io/structured-merge-diff/v4 v4.0.1/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= sigs.k8s.io/structured-merge-diff/v4 v4.0.2 h1:YHQV7Dajm86OuqnIR6zAelnDWBRjo+YhYV9PmGrh1s8= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= diff --git a/pkg/skaffold/runner/build_deploy.go b/pkg/skaffold/runner/build_deploy.go index 8c3ba84837a..4eaa37adc96 100644 --- a/pkg/skaffold/runner/build_deploy.go +++ b/pkg/skaffold/runner/build_deploy.go @@ -26,18 +26,35 @@ import ( "github.com/sirupsen/logrus" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/build" + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/build/cache" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/color" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/constants" deployutil "github.com/GoogleContainerTools/skaffold/pkg/skaffold/deploy/util" eventV2 "github.com/GoogleContainerTools/skaffold/pkg/skaffold/event/v2" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/graph" + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/kubernetes" + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner/runcontext" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/tag" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" ) +type Builder struct { + builder build.Builder + tagger tag.Tagger + cache cache.Cache + builds []graph.Artifact + + // podSelector is used to determine relevant pods for logging and portForwarding + podSelector *kubernetes.ImageList + + hasBuilt bool + devIteration int + runCtx *runcontext.RunContext +} + // Build builds a list of artifacts. -func (r *SkaffoldRunner) Build(ctx context.Context, out io.Writer, artifacts []*latest.Artifact) ([]graph.Artifact, error) { +func (r *Builder) Build(ctx context.Context, out io.Writer, artifacts []*latest.Artifact) ([]graph.Artifact, error) { eventV2.TaskInProgress(constants.Build, r.devIteration) // Use tags directly from the Kubernetes manifests. @@ -99,55 +116,13 @@ func (r *SkaffoldRunner) Build(ctx context.Context, out io.Writer, artifacts []* return bRes, nil } -// Test tests a list of already built artifacts. -func (r *SkaffoldRunner) Test(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error { - eventV2.TaskInProgress(constants.Test, r.devIteration) - if err := r.tester.Test(ctx, out, artifacts); err != nil { - eventV2.TaskFailed(constants.Test, r.devIteration, err) - return err - } - - eventV2.TaskSucceeded(constants.Test, r.devIteration) - return nil -} - -// DeployAndLog deploys a list of already built artifacts and optionally show the logs. -func (r *SkaffoldRunner) DeployAndLog(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error { - // Update which images are logged. - r.addTagsToPodSelector(artifacts) - - logger := r.createLogger(out, artifacts) - defer logger.Stop() - - // Logs should be retrieved up to just before the deploy - logger.SetSince(time.Now()) - // First deploy - if err := r.Deploy(ctx, out, artifacts); err != nil { - return err - } - - forwarderManager := r.createForwarder(out) - defer forwarderManager.Stop() - - if err := forwarderManager.Start(ctx, r.runCtx.GetNamespaces()); err != nil { - logrus.Warnln("Error starting port forwarding:", err) - } - - // Start printing the logs after deploy is finished - if err := logger.Start(ctx, r.runCtx.GetNamespaces()); err != nil { - return fmt.Errorf("starting logger: %w", err) - } - - if r.runCtx.Tail() || r.runCtx.PortForward() { - color.Yellow.Fprintln(out, "Press Ctrl+C to exit") - <-ctx.Done() - } - - return nil +// HasBuilt returns true if this runner has built something. +func (r *Builder) HasBuilt() bool { + return r.hasBuilt } // Update which images are logged. -func (r *SkaffoldRunner) addTagsToPodSelector(artifacts []graph.Artifact) { +func (r *Builder) addTagsToPodSelector(artifacts []graph.Artifact) { for _, artifact := range artifacts { r.podSelector.Add(artifact.Tag) } @@ -159,12 +134,12 @@ type tagErr struct { } // ApplyDefaultRepo applies the default repo to a given image tag. -func (r *SkaffoldRunner) ApplyDefaultRepo(tag string) (string, error) { +func (r *Builder) ApplyDefaultRepo(tag string) (string, error) { return deployutil.ApplyDefaultRepo(r.runCtx.GlobalConfig(), r.runCtx.DefaultRepo(), tag) } // imageTags generates tags for a list of artifacts -func (r *SkaffoldRunner) imageTags(ctx context.Context, out io.Writer, artifacts []*latest.Artifact) (tag.ImageTags, error) { +func (r *Builder) imageTags(ctx context.Context, out io.Writer, artifacts []*latest.Artifact) (tag.ImageTags, error) { start := time.Now() color.Default.Fprintln(out, "Generating tags...") diff --git a/pkg/skaffold/runner/changeset.go b/pkg/skaffold/runner/changeset.go index e918263f4fd..03128026de0 100644 --- a/pkg/skaffold/runner/changeset.go +++ b/pkg/skaffold/runner/changeset.go @@ -21,7 +21,7 @@ import ( "github.com/GoogleContainerTools/skaffold/pkg/skaffold/sync" ) -type changeSet struct { +type ChangeSet struct { needsRebuild []*latest.Artifact rebuildTracker map[string]*latest.Artifact needsResync []*sync.Item @@ -31,7 +31,7 @@ type changeSet struct { needsReload bool } -func (c *changeSet) AddRebuild(a *latest.Artifact) { +func (c *ChangeSet) AddRebuild(a *latest.Artifact) { if _, ok := c.rebuildTracker[a.ImageName]; ok { return } @@ -43,14 +43,14 @@ func (c *changeSet) AddRebuild(a *latest.Artifact) { c.needsRebuild = append(c.needsRebuild, a) } -func (c *changeSet) AddRetest(a *latest.Artifact) { +func (c *ChangeSet) AddRetest(a *latest.Artifact) { if c.needsRetest == nil { c.needsRetest = make(map[string]bool) } c.needsRetest[a.ImageName] = true } -func (c *changeSet) AddResync(s *sync.Item) { +func (c *ChangeSet) AddResync(s *sync.Item) { if _, ok := c.resyncTracker[s.Image]; ok { return } @@ -62,20 +62,20 @@ func (c *changeSet) AddResync(s *sync.Item) { c.needsResync = append(c.needsResync, s) } -func (c *changeSet) resetBuild() { +func (c *ChangeSet) resetBuild() { c.rebuildTracker = make(map[string]*latest.Artifact) c.needsRebuild = nil } -func (c *changeSet) resetSync() { +func (c *ChangeSet) resetSync() { c.resyncTracker = make(map[string]*sync.Item) c.needsResync = nil } -func (c *changeSet) resetDeploy() { +func (c *ChangeSet) resetDeploy() { c.needsRedeploy = false } -func (c *changeSet) resetTest() { +func (c *ChangeSet) resetTest() { c.needsRetest = make(map[string]bool) } diff --git a/pkg/skaffold/runner/deploy.go b/pkg/skaffold/runner/deploy.go index c782f5ef3f6..96cd5ed04be 100644 --- a/pkg/skaffold/runner/deploy.go +++ b/pkg/skaffold/runner/deploy.go @@ -37,6 +37,46 @@ import ( "github.com/GoogleContainerTools/skaffold/pkg/skaffold/util" ) +// DeployAndLog deploys a list of already built artifacts and optionally show the logs. +func (r *SkaffoldRunner) DeployAndLog(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error { + eventV2.TaskInProgress(constants.Deploy, r.devIteration) + + // Update which images are logged. + r.addTagsToPodSelector(artifacts) + + logger := r.createLogger(out, artifacts) + defer logger.Stop() + + // Logs should be retrieved up to just before the deploy + logger.SetSince(time.Now()) + // First deploy + if err := r.Deploy(ctx, out, artifacts); err != nil { + eventV2.TaskFailed(constants.Deploy, r.devIteration, err) + return err + } + + forwarderManager := r.createForwarder(out) + defer forwarderManager.Stop() + + if err := forwarderManager.Start(ctx, r.runCtx.GetNamespaces()); err != nil { + logrus.Warnln("Error starting port forwarding:", err) + } + + // Start printing the logs after deploy is finished + if err := logger.Start(ctx, r.runCtx.GetNamespaces()); err != nil { + eventV2.TaskFailed(constants.Deploy, r.devIteration, err) + return fmt.Errorf("starting logger: %w", err) + } + + if r.runCtx.Tail() || r.runCtx.PortForward() { + color.Yellow.Fprintln(out, "Press Ctrl+C to exit") + <-ctx.Done() + } + + eventV2.TaskSucceeded(constants.Deploy, r.devIteration) + return nil +} + func (r *SkaffoldRunner) Deploy(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error { if r.runCtx.RenderOnly() { return r.Render(ctx, out, artifacts, false, r.runCtx.RenderOutput()) diff --git a/pkg/skaffold/runner/dev_test.go b/pkg/skaffold/runner/dev_test.go index 38e164fc82b..ae13bf8dc0a 100644 --- a/pkg/skaffold/runner/dev_test.go +++ b/pkg/skaffold/runner/dev_test.go @@ -298,7 +298,7 @@ func TestDevAutoTriggers(t *testing.T) { expectedActions []Actions autoTriggers triggerState // the state of auto triggers singleTriggers triggerState // the state of single intent triggers at the end of dev loop - userIntents []func(i *intents) + userIntents []func(i *Intents) }{ { description: "build on; sync on; deploy on", @@ -368,8 +368,8 @@ func TestDevAutoTriggers(t *testing.T) { autoTriggers: triggerState{false, false, false}, singleTriggers: triggerState{false, false, false}, expectedActions: []Actions{}, - userIntents: []func(i *intents){ - func(i *intents) { + userIntents: []func(i *Intents){ + func(i *Intents) { i.setBuild(true) }, }, @@ -380,8 +380,8 @@ func TestDevAutoTriggers(t *testing.T) { autoTriggers: triggerState{false, false, false}, singleTriggers: triggerState{false, false, false}, expectedActions: []Actions{}, - userIntents: []func(i *intents){ - func(i *intents) { + userIntents: []func(i *Intents){ + func(i *Intents) { i.setBuild(true) i.setSync(true) }, @@ -393,11 +393,11 @@ func TestDevAutoTriggers(t *testing.T) { autoTriggers: triggerState{false, false, false}, singleTriggers: triggerState{false, false, false}, expectedActions: []Actions{}, - userIntents: []func(i *intents){ - func(i *intents) { + userIntents: []func(i *Intents){ + func(i *Intents) { i.setBuild(true) }, - func(i *intents) { + func(i *Intents) { i.setSync(true) }, }, diff --git a/pkg/skaffold/runner/intent.go b/pkg/skaffold/runner/intent.go index c1650a5ffbf..601355f0f81 100644 --- a/pkg/skaffold/runner/intent.go +++ b/pkg/skaffold/runner/intent.go @@ -18,7 +18,7 @@ package runner import "sync" -type intents struct { +type Intents struct { build bool sync bool deploy bool @@ -29,8 +29,8 @@ type intents struct { lock sync.Mutex } -func newIntents(autoBuild, autoSync, autoDeploy bool) *intents { - i := &intents{ +func newIntents(autoBuild, autoSync, autoDeploy bool) *Intents { + i := &Intents{ autoBuild: autoBuild, autoSync: autoSync, autoDeploy: autoDeploy, @@ -39,7 +39,7 @@ func newIntents(autoBuild, autoSync, autoDeploy bool) *intents { return i } -func (i *intents) reset() { +func (i *Intents) reset() { i.lock.Lock() i.build = i.autoBuild i.sync = i.autoSync @@ -47,86 +47,86 @@ func (i *intents) reset() { i.lock.Unlock() } -func (i *intents) resetBuild() { +func (i *Intents) resetBuild() { i.lock.Lock() i.build = i.autoBuild i.lock.Unlock() } -func (i *intents) resetSync() { +func (i *Intents) resetSync() { i.lock.Lock() i.sync = i.autoSync i.lock.Unlock() } -func (i *intents) resetDeploy() { +func (i *Intents) resetDeploy() { i.lock.Lock() i.deploy = i.autoDeploy i.lock.Unlock() } -func (i *intents) setBuild(val bool) { +func (i *Intents) setBuild(val bool) { i.lock.Lock() i.build = val i.lock.Unlock() } -func (i *intents) setSync(val bool) { +func (i *Intents) setSync(val bool) { i.lock.Lock() i.sync = val i.lock.Unlock() } -func (i *intents) setDeploy(val bool) { +func (i *Intents) setDeploy(val bool) { i.lock.Lock() i.deploy = val i.lock.Unlock() } -func (i *intents) getAutoBuild() bool { +func (i *Intents) getAutoBuild() bool { i.lock.Lock() defer i.lock.Unlock() return i.autoBuild } -func (i *intents) getAutoSync() bool { +func (i *Intents) getAutoSync() bool { i.lock.Lock() defer i.lock.Unlock() return i.autoSync } -func (i *intents) getAutoDeploy() bool { +func (i *Intents) getAutoDeploy() bool { i.lock.Lock() defer i.lock.Unlock() return i.autoDeploy } -func (i *intents) setAutoBuild(val bool) { +func (i *Intents) setAutoBuild(val bool) { i.lock.Lock() i.autoBuild = val i.lock.Unlock() } -func (i *intents) setAutoSync(val bool) { +func (i *Intents) setAutoSync(val bool) { i.lock.Lock() i.autoSync = val i.lock.Unlock() } -func (i *intents) setAutoDeploy(val bool) { +func (i *Intents) setAutoDeploy(val bool) { i.lock.Lock() i.autoDeploy = val i.lock.Unlock() } // returns build, sync, and deploy intents (in that order) -func (i *intents) GetIntents() (bool, bool, bool) { +func (i *Intents) GetIntents() (bool, bool, bool) { i.lock.Lock() defer i.lock.Unlock() return i.build, i.sync, i.deploy } -func (i *intents) IsAnyAutoEnabled() bool { +func (i *Intents) IsAnyAutoEnabled() bool { i.lock.Lock() defer i.lock.Unlock() return i.autoBuild || i.autoSync || i.autoDeploy diff --git a/pkg/skaffold/runner/load_images_test.go b/pkg/skaffold/runner/load_images_test.go index c60da0c8f9a..f86c4437802 100644 --- a/pkg/skaffold/runner/load_images_test.go +++ b/pkg/skaffold/runner/load_images_test.go @@ -201,7 +201,9 @@ func runImageLoadingTests(t *testing.T, tests []ImageLoadingTest, loadingFunc fu r := &SkaffoldRunner{ runCtx: runCtx, kubectlCLI: kubectl.NewCLI(runCtx, ""), - builds: test.built, + Builder: Builder{ + builds: test.built, + }, } err := loadingFunc(r, test) diff --git a/pkg/skaffold/runner/new.go b/pkg/skaffold/runner/new.go index 75e06d7a9b3..e19524288dd 100644 --- a/pkg/skaffold/runner/new.go +++ b/pkg/skaffold/runner/new.go @@ -118,11 +118,22 @@ func NewForConfig(runCtx *runcontext.RunContext) (*SkaffoldRunner, error) { return nil, fmt.Errorf("creating watch trigger: %w", err) } + podSelectors := kubernetes.NewImageList() return &SkaffoldRunner{ - builder: builder, - tester: tester, + Builder: Builder{ + builder: builder, + tagger: tagger, + cache: artifactCache, + podSelector: podSelectors, + runCtx: runCtx, + }, + Pruner: Pruner{ + builder, + }, + Tester: Tester{ + tester: tester, + }, deployer: deployer, - tagger: tagger, syncer: syncer, monitor: monitor, listener: &SkaffoldListener{ @@ -135,7 +146,7 @@ func NewForConfig(runCtx *runcontext.RunContext) (*SkaffoldRunner, error) { sourceDependencies: sourceDependencies, kubectlCLI: kubectlCLI, labeller: labeller, - podSelector: kubernetes.NewImageList(), + podSelector: podSelectors, cache: artifactCache, runCtx: runCtx, intents: intents, @@ -143,7 +154,7 @@ func NewForConfig(runCtx *runcontext.RunContext) (*SkaffoldRunner, error) { }, nil } -func setupIntents(runCtx *runcontext.RunContext) (*intents, chan bool) { +func setupIntents(runCtx *runcontext.RunContext) (*Intents, chan bool) { intents := newIntents(runCtx.AutoBuild(), runCtx.AutoSync(), runCtx.AutoDeploy()) intentChan := make(chan bool, 1) diff --git a/pkg/skaffold/runner/prune.go b/pkg/skaffold/runner/prune.go index eae749fb52a..3befd25c8ef 100644 --- a/pkg/skaffold/runner/prune.go +++ b/pkg/skaffold/runner/prune.go @@ -19,8 +19,14 @@ package runner import ( "context" "io" + + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/build" ) -func (r *SkaffoldRunner) Prune(ctx context.Context, out io.Writer) error { - return r.builder.Prune(ctx, out) +type Pruner struct { + build.Builder +} + +func (r *Pruner) Prune(ctx context.Context, out io.Writer) error { + return r.Builder.Prune(ctx, out) } diff --git a/pkg/skaffold/runner/runner.go b/pkg/skaffold/runner/runner.go index 7261480dc9d..e5461c666fb 100644 --- a/pkg/skaffold/runner/runner.go +++ b/pkg/skaffold/runner/runner.go @@ -32,8 +32,6 @@ import ( "github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner/runcontext" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" "github.com/GoogleContainerTools/skaffold/pkg/skaffold/sync" - "github.com/GoogleContainerTools/skaffold/pkg/skaffold/tag" - "github.com/GoogleContainerTools/skaffold/pkg/skaffold/test" ) const ( @@ -49,6 +47,7 @@ type Runner interface { Build(context.Context, io.Writer, []*latest.Artifact) ([]graph.Artifact, error) Cleanup(context.Context, io.Writer) error Dev(context.Context, io.Writer, []*latest.Artifact) error + Deploy(context.Context, io.Writer, []graph.Artifact) error DeployAndLog(context.Context, io.Writer, []graph.Artifact) error GeneratePipeline(context.Context, io.Writer, []*latest.SkaffoldConfig, []string, string) error HasBuilt() bool @@ -60,30 +59,28 @@ type Runner interface { // SkaffoldRunner is responsible for running the skaffold build, test and deploy config. type SkaffoldRunner struct { - builder build.Builder + Builder + Pruner + Tester + deployer deploy.Deployer - tester test.Tester - tagger tag.Tagger syncer sync.Syncer monitor filemon.Monitor listener Listener kubectlCLI *kubectl.CLI cache cache.Cache - changeSet changeSet + changeSet ChangeSet runCtx *runcontext.RunContext labeller *label.DefaultLabeller - builds []graph.Artifact artifactStore build.ArtifactStore sourceDependencies graph.TransitiveSourceDependenciesCache // podSelector is used to determine relevant pods for logging and portForwarding podSelector *kubernetes.ImageList isLocalImage func(imageName string) (bool, error) - hasBuilt bool hasDeployed bool - intents *intents - devIteration int + intents *Intents } // for testing @@ -95,8 +92,3 @@ var ( func (r *SkaffoldRunner) HasDeployed() bool { return r.hasDeployed } - -// HasBuilt returns true if this runner has built something. -func (r *SkaffoldRunner) HasBuilt() bool { - return r.hasBuilt -} diff --git a/pkg/skaffold/runner/runner_test.go b/pkg/skaffold/runner/runner_test.go index f3343958276..d9bf949894e 100644 --- a/pkg/skaffold/runner/runner_test.go +++ b/pkg/skaffold/runner/runner_test.go @@ -55,8 +55,8 @@ type TestBench struct { testErrors []error deployErrors []error namespaces []string - userIntents []func(*intents) - intents *intents + userIntents []func(*Intents) + intents *Intents intentTrigger bool devLoop func(context.Context, io.Writer, func() error) error diff --git a/pkg/skaffold/runner/tester.go b/pkg/skaffold/runner/tester.go new file mode 100644 index 00000000000..25ac83c5fb8 --- /dev/null +++ b/pkg/skaffold/runner/tester.go @@ -0,0 +1,37 @@ +/* +Copyright 2021 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package runner + +import ( + "context" + "io" + + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/graph" + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/test" +) + +type Tester struct { + tester test.Tester +} + +// Test tests a list of already built artifacts. +func (r *Tester) Test(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error { + if err := r.tester.Test(ctx, out, artifacts); err != nil { + return err + } + + return nil +} diff --git a/pkg/skaffold/runner/v3/apply.go b/pkg/skaffold/runner/v3/apply.go new file mode 100644 index 00000000000..e792e080ee7 --- /dev/null +++ b/pkg/skaffold/runner/v3/apply.go @@ -0,0 +1,26 @@ +/* +Copyright 2021 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v3 + +import ( + "context" + "fmt" + "io" +) + +func (r *SkaffoldRunner) Apply(ctx context.Context, out io.Writer) error { + return fmt.Errorf("not implemented error: SkaffoldRunner(v3).Apply") +} diff --git a/pkg/skaffold/runner/v3/cleanup.go b/pkg/skaffold/runner/v3/cleanup.go new file mode 100644 index 00000000000..1c57954c205 --- /dev/null +++ b/pkg/skaffold/runner/v3/cleanup.go @@ -0,0 +1,26 @@ +/* +Copyright 2021 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v3 + +import ( + "context" + "fmt" + "io" +) + +func (r *SkaffoldRunner) Cleanup(ctx context.Context, out io.Writer) error { + return fmt.Errorf("not implemented error: SkaffoldRunner(v3).Cleanup") +} diff --git a/pkg/skaffold/runner/v3/deploy.go b/pkg/skaffold/runner/v3/deploy.go new file mode 100644 index 00000000000..aed032cb564 --- /dev/null +++ b/pkg/skaffold/runner/v3/deploy.go @@ -0,0 +1,28 @@ +/* +Copyright 2021 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v3 + +import ( + "context" + "fmt" + "io" + + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/graph" +) + +func (r *SkaffoldRunner) Deploy(ctx context.Context, out io.Writer, artifacts []graph.Artifact) error { + return fmt.Errorf("not implemented error: SkaffoldRunner(v3).Deploy") +} diff --git a/pkg/skaffold/runner/v3/dev.go b/pkg/skaffold/runner/v3/dev.go new file mode 100644 index 00000000000..4c05707771a --- /dev/null +++ b/pkg/skaffold/runner/v3/dev.go @@ -0,0 +1,28 @@ +/* +Copyright 2021 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v3 + +import ( + "context" + "fmt" + "io" + + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" +) + +func (r *SkaffoldRunner) Dev(ctx context.Context, out io.Writer, artifacts []*latest.Artifact) error { + return fmt.Errorf("not implemented error: SkaffoldRunner(v3).Dev") +} diff --git a/pkg/skaffold/runner/v3/generate_pipeline.go b/pkg/skaffold/runner/v3/generate_pipeline.go new file mode 100644 index 00000000000..91abe307d4d --- /dev/null +++ b/pkg/skaffold/runner/v3/generate_pipeline.go @@ -0,0 +1,28 @@ +/* +Copyright 2021 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v3 + +import ( + "context" + "fmt" + "io" + + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/schema/latest" +) + +func (r *SkaffoldRunner) GeneratePipeline(ctx context.Context, out io.Writer, configs []*latest.SkaffoldConfig, configPaths []string, fileOut string) error { + return fmt.Errorf("not implemented error: SkaffoldRunner(v3).GeneratePipeline") +} diff --git a/pkg/skaffold/runner/v3/render.go b/pkg/skaffold/runner/v3/render.go new file mode 100644 index 00000000000..c897d210f93 --- /dev/null +++ b/pkg/skaffold/runner/v3/render.go @@ -0,0 +1,28 @@ +/* +Copyright 2021 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v3 + +import ( + "context" + "fmt" + "io" + + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/graph" +) + +func (r *SkaffoldRunner) Render(ctx context.Context, out io.Writer, builds []graph.Artifact, offline bool, filepath string) error { + return fmt.Errorf("not implemented error: SkaffoldRunner(v3).Dev") +} diff --git a/pkg/skaffold/runner/v3/runner.go b/pkg/skaffold/runner/v3/runner.go new file mode 100644 index 00000000000..33b97969e62 --- /dev/null +++ b/pkg/skaffold/runner/v3/runner.go @@ -0,0 +1,28 @@ +/* +Copyright 2021 The Skaffold Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ +package v3 + +import ( + "github.com/GoogleContainerTools/skaffold/pkg/skaffold/runner" +) + +type SkaffoldRunner struct { + runner.Builder + runner.Pruner + runner.Tester +} + +func (r *SkaffoldRunner) HasDeployed() bool { return true } diff --git a/pkg/skaffold/test/types.go b/pkg/skaffold/test/types.go index b90e0de6c32..1404bbf0a3b 100644 --- a/pkg/skaffold/test/types.go +++ b/pkg/skaffold/test/types.go @@ -26,7 +26,7 @@ import ( // Tester is the top level test executor in Skaffold. // A tester is really a collection of artifact-specific testers, -// each of which contains one or more TestRunners which implements +// each of which contains one or more Tester which implements // a single test run. type Tester interface { Test(context.Context, io.Writer, []graph.Artifact) error